Skip to content
Nana UI

Details

A disclosure / expandable panel. A clickable summary toggles a smoothly animated content region. Compose the body from any markup via the default slot, and add a leading icon or trailing badge. Group several together with a shared name for accordion behaviour (one open at a time).

A framework-agnostic web component library built with Lit.
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/details";
<nana-details summary="What is Nana UI?" style="width:100%">
A framework-agnostic web component library built with Lit.
</nana-details>
Content. Content. Content. Content. Content. Content.

The indicator attribute sets the expand affordance — chevron, plus, or none.

Content. Content. Content.
PropertyTypeDefaultDescription
summarystring''Summary title text (ignored when the summary slot is used)
descriptionstring''Secondary description shown under the title
openbooleanfalseExpanded state
variant'default' | 'outlined' | 'filled' | 'card' | 'minimal' | 'divider''default'Visual style
size'sm' | 'md' | 'lg''md'Size
indicator'chevron' | 'plus' | 'none''chevron'Expand indicator style
indicatorPlacement'start' | 'end''end'Place the indicator at the start of the summary instead of the end
disabledbooleanfalseDisable the disclosure
namestring''Accordion group name — opening one closes others sharing the name
EventTypeDescription
nana-toggleCustomEventFired whenever the open state changes (detail.open)
nana-showCustomEventFired when expanded
nana-hideCustomEventFired when collapsed
SlotDescription
(default)The collapsible content
summaryCustom summary content (overrides summary / description)
iconLeading icon in the summary
badgeTrailing badge / status before the indicator
VariableDefaultDescription
--nana-details-radiusCorner radius
--nana-details-paddingSummary / content padding
--nana-details-durationExpand / chevron animation duration
PartDescription
baseThe outer container
summaryThe clickable trigger
contentThe content region
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Details interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook