Details

Details is a styled component to enhance the native behaviors of the <details> element.

Page navigation navigation

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

Toggle DetailsThis is some content

Details component open by default

Toggle DetailsThis is some content

With a callback for clicking outside the component

Toggle DetailsThis is some content

Close the Details component when clicking outside of it

See DetailsThis is some content

Props

Details

No props documented

Details.Summary

NameDefaultDescription
as
summary
React.ElementType<React.PropsWithChildren<any>>

HTML element to render summary as.

children
React.ReactNode