Creates strongly typed polymorphic components.
This package has been deprecated in favour of the asChild prop. Learn more about how to change the rendered element here.
Typed attributes based on the `as` prop
Typed props based on the `as` prop
Typed events based on the `as` prop
Install the component from your command line.
Import the component.
Make a polymorphic Box component.
Adds polymorphic as prop types to a forwardRef component.
The OwnProps should not contain DOM attributes. These will be added for you. Use the Polymorphic.OwnProps utility to extract these from existing polymorphic components.
Extract props from a polymorphic component, excluding its DOM props.
Extract the JSX.IntrinsicElements key from a polymorphic component.
Maintain polymorphism when wrapping a polymorphic component in your own custom component by combining the above utilities.