Details
Details is an expandable panel for showing and hiding content from the user, to make the UI less cluttered.
new tab
Source code
details-basic.ts
DetailsBasic.java
Anatomy
Details consists of a summary area and a content area.
Summary
The Summary is the part that’s always visible, and typically describes the contents, for example with a title. Clicking on the summary toggles the content area’s visibility.
The summary supports rich content and can contain any component. This can be used, for example, to display the status of the corresponding content.
new tab
Source code
details-summary.ts
Country.ts
Country.ts
DetailsSummary.java
Content
This is the collapsible part of Details. It can contain any component. When the content area is collapsed, the content is invisible and inaccessible by keyboard or screen reader.
new tab
Source code
details-content.ts
DetailsContent.java
Theme Variants
Details has three theme variants: filled
, small
, and reverse
.
Theme variants can be combined with each other.
For example, all three themes variants can be applied to the same Details component.
Filled
The filled
theme variant makes the component’s boundaries visible, which helps tie its content together visually and distinguishes it from the surrounding UI.
new tab
Source code
details-filled.ts
DetailsFilled.java
Small
Use the small
theme variant for compact UIs.
new tab
Source code
details-small.ts
DetailsSmall.java
Reverse
The reverse theme variant places the toggle icon after the summary contents, which can be useful for visually aligning the summary with other content.
new tab
Source code
details-reverse.ts
DetailsReverse.java
Disabled
Details can be disabled to prevent them from being expanded or collapsed. Components inside a disabled expanded Details are automatically disabled as well.
new tab
Source code
details-disabled.ts
DetailsDisabled.java
Best Practices
Use Details to group related content and to reduce the risk of overwhelming the user with information. However, avoid putting important information in a Details component unless it’s expanded by default. Otherwise, the user might not notice it.
Details can be used instead of Accordion if there is a need to see content from multiple collapsible content areas, simultaneously.
The expandable and collapsible nature of Details can sometimes be difficult for users to discover. Use the filled variant and apply a tooltips to make this more discoverable.