App Svelte Component

App Svelte 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

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. <App params={f7params}>
  2. ...
  3. </App>
  4. <script>
  5. import { App } from 'framework7-svelte';
  6. import AboutPage from './about.svelte';
  7. import ServicesPage from './services.svelte';
  8. const f7params = {
  9. name: 'My App',
  10. id: 'com.myapp.test',
  11. // routes
  12. routes: [
  13. {
  14. path: '/about/',
  15. component: AboutPage,
  16. },
  17. {
  18. path: '/services/',
  19. component: ServicesPage,
  20. },
  21. ],
  22. // ... other params
  23. }
  24. </script>

Passing routes in separate prop:

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

← Color Properties

Accordion →