Docs

Documentation versions (currently viewingVaadin 14)

You are viewing documentation for an older Vaadin version. View latest documentation

Details

The Details component is an expandable panel for showing and hiding content from the user to make the UI less crowded.

Open in a
new tab
Source code
DetailsBasic.java

Anatomy

Details consists of a summary and a content area.

Summary

The Summary is the part that is 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 utilised for example to indicate the status of the corresponding content.

Open in a
new tab
Source code
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.

Open in a
new tab
Source code
DetailsContent.java

Theme Variants

Details has three theme variants: filled, small, and reverse. Theme variants can be freely 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.

Open in a
new tab
Source code
DetailsFilled.java

Small

Use the small theme variant for compact UIs.

Open in a
new tab
Source code
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.

Open in a
new tab
Source code
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.

Open in a
new tab
Source code
DetailsDisabled.java

Best Practices

Use Details to group related content and to lessen the risk of overwhelming the user with information. However, avoid putting important information in a Details component unless it is 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.

Component Usage recommendations

Accordion

Vertically stacked set of expandable panels, in which only one panel can be expanded at a time.

Tabs

Component for organising and grouping content into navigable sections.

6C4A3E79-3F62-454E-B170-30C934D2106D