huntabyte / bits-ui

The headless components for Svelte.
https://bits-ui.com
MIT License
1.32k stars 94 forks source link

Add Table component #706

Closed jesi-rgb closed 1 month ago

jesi-rgb commented 1 month ago

Describe the feature in detail (code, mocks, or screenshots encouraged)

Don't know if this was on the roadmap, but since bits is inspired/based on radix, it'd be awesome to include a Table component, just like theirs! :P

What type of pull request would this be?

New Feature

Provide relevant links or additional information.

https://www.radix-ui.com/themes/docs/components/table

huntabyte commented 1 month ago

Do you have an idea of what the value is in having this be a part of Bits UI?

I understand it being in Radix "Themes", as those components are styled, but wouldn't we just be wrapping the native table elements?

jesi-rgb commented 1 month ago

Correct me if I'm wrong, but I do see value in having the Table component as part of bits ui. I would have to import radix just for the table, since bits ui already offers so much.

And in the library's spirit, this table would be accessible and well crafted. Which is a tad more complicated than just creating a table in html (I think, but don't know for sure)

To be completely honest, I asked for it since I was using it in a project where bits ui was working flawlessly. But, of course I'd love to know your opinion on the topic, or, if I can help, how!

Thanks!

huntabyte commented 1 month ago

Hey there, the HTML table is accessible out of the box, and there isn't much we would even do other than just make <Table> components that, without styles, don't add much value and increase the surface area of the library. So, for those reasons, it won't be added to Bits UI!

Thanks for the request, though. Should a specific use case or deficiency in the native HTML table arise, we'd consider it in the future.

jesi-rgb commented 3 weeks ago

Cool! Knowing that the native html element is already accessible enough is great news actually, so win-win situation.

Thanks a lot!