RFC: Component API Changes #3499
Replies: 4 comments 10 replies
-
Honestly I really like this change and I don't see any immediate issues with it. |
Beta Was this translation helpful? Give feedback.
-
Overall I like this. Being able to just pass all classes into Being able to pass attributes into any part of a component is also nice. I was thinking of requesting a method of passing It does feel like there's some cost tradeoff in verbosity and ease of use. It seems like the user would need to learn the anatomy of each component for even a simple use-case. Today, if you're just using the default styles, you don't really need to learn the anatomy. Migration obv is a tradeoff. I'll stick with skeleton for sure, but I wonder if update fatigue will push people away... Not sure what timeline you're thinking for v4. However (without having tried) this feels like it wouldn't be hard to automatically migrate, and that would mitigate this concern a lot. Partly playing devil's advocate: at this point, should Skeleton components just wrap/style Ark UI components? |
Beta Was this translation helpful? Give feedback.
-
I'm not huge on Proposal A -- I've never been huge on that kind of setup, and as I mainly use the Svelte version I much prefer using the snippets. That said, if Prop A is what's needed for Prop C, then I'll go with it. I always enjoy components that are very strong guard rails, but also allow you to break out and do something very custom if/when necessary. For Prop B, I'm fine with that. I think it's a better way to do it. Again in my likeability-of-escape-hatch-iness what I've done for some custom components of my own is allowed people to define their own classes, whether they conflict with mine or not, and put an |
Beta Was this translation helpful? Give feedback.
-
Is there a way in the proposed API to opt-out of the For example, in the Skeleton v3, you can pass in
Perhaps there could be a I haven't carefully reviewed the related PR, so perhaps this is already addressed. |
Beta Was this translation helpful? Give feedback.
-
Hey everyone, Chris here from Skeleton. Today we're launching a new community-focused RFC (request for comment) regarding some proposed component API changes. Please read each proposal below very carefully and raise questions or leave you feedback in the comments section below this post.
The Goal
We know many of you are still acclimating to the changes introduce as part of Skeleton v3.0 release. Many of which were spurred by support for Svelte 5 APIs (such as runes and snippets), the introduction of React, and of course implementing Zag.js primitives as the foundation for each Skeleton component.
We also know migration is painful, but as we continue to move forward we've identified a handful of opportunity to improve the interface for Skeleton's first-party components. Including a new and novel strategy for implementing styles via new options provided by Tailwind v4. We'll cover each of these in detail below, explaining the change, and covering the benefits to you as the end user.
We ask that you come in with an open mind as we believe these changes to be critical for the continued health of the project. However, we're excited about what these changes may entail. As they help address pain points that have been present since the inception of Skeleton.
Proposal A: Component Composition
One of the biggest challenges facing Skeleton is need to feed more granular data to explicit portions of each component. Be that functional properties (state), style properties (classes), or common attributes (such as
required
,data-*
,style
, etc). To address this we're proposing that we break components into smaller, more modular, and much more composable parts.This takes inspiration from other popular component libraries, such as Bits UI, Shadcn, and more. In fact, after reviewing many of the most popular component libraries on the market, this appears to be the de-facto solution.
Here's a quick example using the Accordion component. You can compare this to the production implementation.
class
attributeProposal B: Condensing Style Props
If you're not already familiar, we recommend reading the current component fundamentals to learn how Skeleton components provide utility classes to each component template. This requires a huge number of manually defined props to ensure classes are inserted to the proper class list per template element.
With the proposed change, any and all styles would now be provided by a singular
class
attribute. All classes automatically take precedence and are assigned to these more bite-sized components. Here's a quick run down by Skeleton team member @Hugos68 on how this works. Comparing it to familiar alternatives such as Tailwind Merge.Here's an example of what this change would look like in practice. Simply put you just use
class
for any and all utility classes!The benefits of this are numerous:
class
base
, individual property, or arbitraryclasses
This new strategy is only now possible via the use of Tailwind v4, and comes courtesy of Haz from Ariakit. This was originally a concept proposed by Tailwind creator Adam Wathan, and nearly baked into Tailwind v4. It was excluded only because it's so simple to implement in user-land.
Proposal C: Bring Your Own Markup
Finally, let's talk through one more concept that would allow more control over component markup.
See the example below.
trigger
You are then free to essentially customize markup at any level!
What DOES NOT Change
While we're suggesting a number of exciting changes, it's worth nothing what will not change:
Try it Live (Coming Soon)
We have an active pull request where we're currently implementing all proposed changes. Use this as reference to see how these changes would be implemented in practice for real world components:
Note that over the next week or two, we will launch these changes into the production version of Skeleton. This will include a new Accordion and Avatar component for Svelte and React, which stand apart from the current production versions. Both versions will exist in parallel on the latest stable release of the v3
skeleton-svelte
andskeleton-react
packages. This will give you a chance to try out both versions.Note that we do not recommend using these experimental features for production use. All proposed features are subject to change between now and release - which we expect to be the core focus for Skeleton v4.
How to Submit Feedback
After reviewing all proposals above, please take a moment to provide your questions and feedback in the comments section below. @Hugos68 and I will be monitoring this closely and respond to everyone as soon as possible. We ask that you keep things professional. Off topic or non-constructive comments may be removed. Remember we're all trying to do the same thing - push Skeleton forward and provide a top-tier component library. So let's do this together!
Beta Was this translation helpful? Give feedback.
All reactions