Details
Details is a styled component to enhance the native behaviors of the <details> element.
React
readyNot reviewed for a11y
Rails
readyNot reviewed for a11y
The details component can reveal additional information by using a button to toggle between hidden and visible. It includes a summary followed by the content that's hidden or visible.
By default, the information is hidden. When triggered, it expands and displays the information.
React examples
Default
See Details
Toggle Details
This is some contentDetails
component open by default
See Details
Toggle Details
This is some contentWith a callback for clicking outside the component
See Details
Toggle Details
This is some contentClose the Details
component when clicking outside of it
See Details
See Details
This is some contentProps
Details
Name | Required | Description |
---|---|---|
sx | SystemStyleObject |
Details.Summary
Name | Required | Description |
---|---|---|
as | React.ElementType<React.PropsWithChildren<any>> HTML element to render summary as. | |
children | React.ReactNode | |
sx | SystemStyleObject |