Details

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

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 DetailsToggle DetailsThis is some content

Details component open by default

See DetailsToggle DetailsThis is some content

With a callback for clicking outside the component

See DetailsToggle DetailsThis is some content

Close the Details component when clicking outside of it

See DetailsSee DetailsThis is some content

Props

Loading data for details...