svelte-content-pages Svelte Themes

Svelte Content Pages

Svelte Content Switcher like <iron-pages> in Polymer 3

svelte-content-pages

Svelte Element to do easy Content Switching. The inspiration came from

How to use

Here is how you can use

# install 
npm i svelte-content-pages

Copy this in your App.svelte file

<script>
    import {
        Page, 
        Pages
    } from "svelte-content-pages";
    var page = "";
    let fallbackSelectionView = "home";
</script>
<Pages page={page} fallbackSelection="{fallbackSelectionView}">
    <Page page="home">
        Home Page
    </Page>
    <Page page="about">
        About Page
    </Page>
</Pages>

You can use dynamic views using this library, but you may need to set a static Page section

Top categories

Loading Svelte Themes