rgossiaux / svelte-headlessui

Unofficial Svelte port of the Headless UI component library
https://svelte-headlessui.goss.io
MIT License
1.78k stars 96 forks source link

Why not namespace the components like they do in the React version? #65

Closed Evertt closed 2 years ago

Evertt commented 2 years ago

In the readme you write:

Components do not have . in their names; use ListboxButton instead of Listbox.Button

And I'm wondering, why though? It's 100% possible to do it the same way as the React version. See here: https://svelte.dev/repl/0899a509e81f472790133a21a3ac949f?version=3.46.4

And I think it would be nicer to namespace the components like that, because then your import statements can be a lot shorter.

import { Menu, MenuButton, MenuItems, MenuItem, Listbox, ListboxButton, ListboxOptions } from '@rgossiaux/svelte-headlessui'

Could then just be

import { Menu, Listbox } from '@rgossiaux/svelte-headlessui'