0.0.6 • Published 2 months ago

svelte-content-pages v0.0.6

Weekly downloads
-
License
-
Repository
github
Last release
2 months ago

svelte-content-pages

npm version

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