CaptainCodeman / svelte-headlessui

HeadlessUI components for Svelte
https://captaincodeman.github.io/svelte-headlessui/
MIT License
560 stars 26 forks source link
autocomplete button combobox dialog disclosure dropdown headless listbox menu modal popover radio renderless select svelte svelte-components tabs tailwind toggle transition

minified minified + zipped

Svelte-HeadlessUI

Svelte Headless-UI

svelte-headlessui is an unofficial implementation of Tailwind HeadlessUI for Svelte. Just like the official implementation, they are:

But also:

BREAKING CHANGE (v0.0.39)

The latest 0.0.39 release switches to using "change" instead of "select" as the event fired when the selected item changes for semantic correctness and to better match native inputs. Be sure to change listeners from on:select to on:change!

Installation

Install using your package manager of choice, e.g.

pnpm install svelte-headlessui

Import the appropriate create... factory method in your component and use the custom store it returns to manage your component state and attach use:action behaviors to your elements.

See the individual component pages for usage examples.

Alternative

You may be interested in evaluating @rgossiaux/svelte-headlessui. This package aligns closer to the official components in it's approach although I believe that approach (driven by React / Vue) contributes to the larger size of 173kB minified / 29kB minified + gzipped.

Logo

Special thanks to Shoob for the logo!