Skip to main content
Components

Details

Make a page easier to scan by letting users reveal more detailed information only if they need it.

Read the Design System guidance for details

Import

import * as Details from 'govuk-react/details';

Examples

Default

Code
<Details.Composite summary={summary}>
  {paragraphs[0]}
</Details.Composite>

Set as open

Code
<Details.Composite
  open
  summary={summary}
>
  {paragraphs[0]}
</Details.Composite>

With paragraph contents

Code
<Details.Composite
  open
  summary={summary}
>
  {(
    <>
      <Body>{paragraphs[0]}</Body>
      <Body>{paragraphs[1]}</Body>
    </>
  )}
</Details.Composite>

API reference

Details.Root

Make a page easier to scan by letting users reveal more detailed information only if they need it.

No props of its own. Other props are passed to the element it renders.

Details.Composite

Make a page easier to scan by letting users reveal more detailed information only if they need it.

PropType
summaryRequired

The summary element (the visible part of the details element).

ReactNode

Details.Summary

No props of its own. Other props are passed to the element it renders.

Details.SummaryText

No props of its own. Other props are passed to the element it renders.

Details.Text

No props of its own. Other props are passed to the element it renders.