faency
faency copied to clipboard
[RFC] `as` design pattern is deprecated on Radix-UI
Description
Radix deprecated as design pattern and Polymorphic in favor of asChild design pattern.
Their Slot lib component handles internal logic for the asChild pattern.
There's recommendations to reuse it, even if they deprecated it to drop support.
I think we should prepare for dropping of as design pattern and follow the asChild one.
WDYT?
https://www.radix-ui.com/docs/primitives/utilities/slot
Tasks
- Integrate Slot component
- Update components who could be using
asChildpattern:- Box
- Heading
- Text
- Button
- Flex
- Badge
- Card
It seems making sense 👍
Yes, I agree
@seedy Handle the update either by listing tasks in issue description or pushing separate issues
Then see if it can be handled quickly or not
Components already relying on the as behavior:
- [x]
Badge - [x]
Heading~~- [ ]Box~~ behavior makes sense ~~- [ ]Text~~ behavior makes sense - [x]
Button~~- [ ]Card~~ behavior makes sense ~~- [ ]Flex~~ behavior makes sense
Related issues:
- https://github.com/traefik/faency/issues/351
- https://github.com/traefik/faency/issues/107