GitHub

The asChild prop

Pass a child element to make it inherit the styles and props.

All components that support the asChild prop will inherit the styles and props of the parent component.

Creating new Components

You can use the ark factory to create your own elements that work just like the components in the library.

Example

You can use the asChild prop to make a link styled as a button.

Badge

You can use the asChild prop to make a badge styled as a button.

Dialog

You can use the asChild prop to make a dialog styled as a button.

You can use the asChild prop to make a menu styled as a button.

Popover

You can use the asChild prop to make a popover styled as a button.