App React Component

App React component is the main Framework7 app component where all the Framework7 core initialization happens and where you pass all main Framework7 parameters.

App Components

There are following components included:

  • App / F7App

App Properties

PropTypeDefaultDescription
paramsobjectObject with Framework7 parameters
routesarrayArray with default routes for all views. Same as params.routes so you can use this one if you feel more comfortable with such approach
idstringApp element ID attribute

Examples

Passing all parameters in params prop

  1. import AboutPage from './about.jsx';
  2. import ServicesPage from './services.jsx';
  3. const f7params = {
  4. name: 'My App',
  5. id: 'com.myapp.test',
  6. // routes
  7. routes: [
  8. {
  9. path: '/about/',
  10. component: AboutPage,
  11. },
  12. {
  13. path: '/services/',
  14. component: ServicesPage,
  15. },
  16. ],
  17. // ... other params
  18. }
  19. export default () => (
  20. <App params={f7params}>
  21. ...
  22. </App>
  23. );

Passing routes in separate prop:

  1. import routes from './routes';
  2. const f7params = {
  3. name: 'My App',
  4. id: 'com.myapp.test',
  5. // ... other params
  6. };
  7. export default () => (
  8. <App params={f7params} routes={routes}>
  9. ...
  10. </App>
  11. );

← Color Properties

Accordion →