ui
ui copied to clipboard
feat(button): support render delegation with asChild parameter
This PR adds the asChild
parameter to Button
, which renders the child component with the Button
's behavior and styles, reducing DOM nodes.
Example:
<Button asChild variant="ghost">
<Link to="/login">Login</Link>
</Button>
This pattern is very common in frameworks (e.g. Next.js, Remix, etc) and is used throughout @radix-ui/primitives
Someone is attempting to deploy a commit to the shadcn-pro Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
ui | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 30, 2023 7:55am |
1 Ignored Deployment
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
next-template | ⬜️ Ignored (Inspect) | Visit Preview | Apr 30, 2023 7:55am |
@emrosenf This is brilliant 👏
I'll review and merge.
Sweet! Let me know if you need help with the documentation
Sweet! Let me know if you need help with the documentation
Yeah. Let's update this section with your example above: https://ui.shadcn.com/docs/components/button#link
(Can you also run pnpm format:write
to fix the formatting issues please?)
Thank you.
Sweet! Let me know if you need help with the documentation
Yeah. Let's update this section with your example above: https://ui.shadcn.com/docs/components/button#link
(Can you also run
pnpm format:write
to fix the formatting issues please?)Thank you.
Good call. Done. You can consider adding format
as a commit hook so your PRs all come in formatted correctly.