-
Notifications
You must be signed in to change notification settings - Fork 619
add asChild prop to UI components #6110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
size-limit report 📦
|
8e0f77d to
7bda6cd
Compare
🦋 Changeset detectedLatest commit: 7bda6cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |

TL;DR
Added
asChildprop support to UI components, enabling better composition with custom elements.What changed?
asChildprop to various UI components includingSiteLink,AccountAddress,AccountAvatar,AccountBalance,AccountName,ChainIcon,ChainName,NFTDescription,NFTName,TokenIcon,TokenName,TokenSymbol,WalletIcon, andWalletName@radix-ui/react-slotas a new dependencyHow to test?
asChildprop along with a custom elementWhy make this change?
This change provides more flexibility in component composition, allowing developers to customize the rendered elements while maintaining the core functionality. This is particularly useful for:
PR-Codex overview
This PR focuses on allowing the
asChildprop for most UI components, enabling them to render as a different component (likeSlot.Root) rather than the default HTML element. This enhances flexibility in component usage.Detailed summary
asChildprop to various components.Slot.RootifasChildis true.SiteLink,AccountAddress,NFTName,NFTDescription,AccountName,WalletName,ChainName,ChainIcon,AccountBalance,AccountAvatar,TokenIcon,TokenSymbol,TokenName,WalletIcon, andSocialIcon.package.jsonfiles to update@radix-ui/react-slotversion to1.1.1.