5.0.0 • Published 8 months ago

svelte-hamburgers v5.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

🍔 Svelte Hamburgers

A customisable Svelte port of the popular hamburgers.css library.

demo gif

Installation

npm install svelte-hamburgers -D

If you want to use the Svelte 3/4 version of this library, please checkout svelte-hamburgers@4.

Usage

<script lang="ts">
    import { Hamburger } from 'svelte-hamburgers';
</script>

<Hamburger />

View the full docs.

Props

PropertyTypeDefault ValueDescription
openstringfalseControls and represents whether the hamburger is open.
typestringspinThe type of burger you want, you can see the types here, it should be lowercase.
titlestringHamburger menuCan be used to add a tooltip, also controls the default value of the ariaLabel prop.
ariaLabelstringvalue of titleA label that describes the hamburger menu.
ariaControlsstringThis identifies the element(s) whos presence is controlled by the hamburger menu.
--colorstringblackThe color of the burger.
--active-colorstringvalue of --colorThe color of the burger when active.
--paddingstring15pxThe padding.
--layer-widthstring30pxThe width of the burger.
--layer-heightstring2pxThe height of the burger.
--layer-spacingstring6pxThe spacing between layers of the burger.
--border-radiusstring4pxThe border radius of each burger part.
--hover-opacitynumber0.7The opacity amount on hover.
--hover-opacity-activenumbervalue of --hover-opacityThe opacity amount of hover when active.
onclickMouseEventHandler<HTMLButtonElement>Fires when the hamburger is clicked. This event won't propagate.

Migrating to svelte-hamburgers v5

  • Now requires Svelte 5, if you require Svelte 3/4 support checkout svelte-hamburgers@4.
  • We now call stopPropagation on hamburger click event for you.
  • The ariaLabel prop now gets its default value from the title prop.

View the full changelog on GitHub.

Support

5.0.0

8 months ago

4.2.1

11 months ago

4.2.0

2 years ago

4.1.0

2 years ago

4.1.1

2 years ago

4.0.2

2 years ago

4.0.0-0

3 years ago

4.0.0-1

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

3.0.0-1

4 years ago

3.0.0-0

4 years ago

3.0.0-3

4 years ago

3.0.0-2

4 years ago

3.0.0-5

4 years ago

3.0.0-4

4 years ago

2.0.5-test5

4 years ago

2.0.5-test4

4 years ago

2.0.5-test7

4 years ago

2.0.5-test6

4 years ago

2.0.5-test9

4 years ago

2.0.5-test8

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.6

4 years ago

2.0.5-test10

4 years ago

2.0.5-test1

4 years ago

2.0.5-test3

4 years ago

2.0.5-test2

4 years ago

2.0.4-test5

4 years ago

2.0.4-test4

4 years ago

2.0.4-test3

4 years ago

2.0.4-test2

4 years ago

2.0.4-test1

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.0

4 years ago