2.0.5 • Published 2 years ago

svelte-burger-menu v2.0.5

Weekly downloads
29
License
ISC
Repository
github
Last release
2 years ago

svelte-burger-menu

Simple burger menu for Svelte with CSS transformations and transitions. Tested in Chrome, Edge, Firefox.
Demo: svelte-burger-menu This package uses typescript since 2.0.0, use 1.0.5 for the latest non-typescript version.

How to use

To import the Burgermenu, install the component using

npm install svelte-burger-menu

And in the file where you want to use it:

<script>
    import BurgerMenu from 'svelte-burger-menu';
</script>

<BurgerMenu>
    <h2>Home</h2>
    <h2>About</h2>
    <h2>Contact</h2>
</BurgerMenu>

Props

NameDescriptionDefault
durationDuration of the opening transition in seconds as a number0.4
widthWidth of the opened menu, accepts CSS values such as '300px' and '50%''300px'
backgroundColorBackground color of the opened menu, accepts CSS colors'rgb(1, 0, 74)'
menuColorColor of the text in the menu and the close menu button, accepts CSS colors'rgb(180, 180, 180)'
burgerColorColor of the burger when the menu is not open, accepts CSS colors'rgb(18.4, 18.4, 18.4)'
paddingpadding inside the menu for the props within, accepts CSS values such as '30px' and '10%''25px'
paddingToppadding inside the menu for the top to prevent items comign underneath the close menu button, accepts CSS values'50px'