Component
Tools for building your own components on Rad UI: Slot, mergeProps and composeRefs.
View component changelog- Slot gives your components the asChild behavior Rad UI parts use
- mergeProps joins classes, merges styles and chains event handlers
- composeRefs combines callback and object refs
- Works with forwarded refs, so focus and measuring keep working
Import all parts of the component and piece them together
Renders its only child and merges its own props and ref onto it, the same way Rad UI parts do with asChild.
| Prop | Type | Default |
|---|---|---|
children | ReactElement | -- |
Merges props objects. Later ones win, except classNames join, styles merge and event handlers chain: the rightmost runs first, and calling event.preventDefault() skips the ones to its left.
| Prop | Type | Default |
|---|---|---|
...props | object[] | -- |
| Shortcut | Description |
|---|---|
None | These utilities add no keyboard behavior; the rendered element keeps its own. |
| Reference | What Rad UI follows |
|---|---|
Slot keeps the child's semantics; merge onto a native button or link to keep keyboard and screen reader support. |