Skip to content

Details

Disclosure element that hides content until the user chooses to reveal it. Built on native <details>/<summary> for progressive enhancement.


Demo

Default (border-left accent)

Hvad er design tokens?

Design tokens er de mindste byggesten i et designsystem — navngivne værdier for farver, typografi, spacing, radier og shadows. De sikrer konsistens på tværs af platforme og gør det muligt at ændre hele systemets udseende fra ét centralt sted.

Default (open)

Hvordan installerer jeg Grundtone?

Installér med pnpm add @grundtone/vue og importér komponenterne i dit projekt. Se installationsguiden for detaljer.

Subtle (inline, minimal)

Grundtone understøtter både lys og mørk tilstand via CSS custom properties.

Læs mere om theming

Tema-switching sker via klasser på rod-elementet. Alle farver defineres som semantiske tokens der automatisk skifter mellem lys og mørk palette.

Card (boxed, standalone)

Har jeg brug for @grundtone/core?

Ja — core indeholder TypeScript-typer, theme-presets, og ikonregistryet. Alle andre pakker afhænger af core.

Kan jeg bruge Grundtone med Nuxt?

Absolut. @grundtone/nuxt modulet auto-importerer komponenter og injicerer design-system CSS automatisk.


When to use

  • Make a page easier to scan by hiding supplementary information
  • FAQ-style content where users need answers to specific questions
  • Long reference material where most users only need certain sections

When not to use

  • As a replacement for accordions (use accordions for groups of related sections)
  • For content most users need to read — keep it visible
  • To hide navigation elements
  • Nested inside another details element — this confuses users

Installation

bash
pnpm add @grundtone/vue

Usage

Default (border-left accent)

vue
<template>
  <GTDetails summary="What are design tokens?">
    <p>Design tokens are the smallest building blocks of a design system.</p>
  </GTDetails>
</template>

Subtle (inline, minimal)

vue
<template>
  <p>
    We support both light and dark mode.
    <GTDetails variant="subtle" summary="Read more about theming">
      <p>Theme switching happens via CSS custom properties.</p>
    </GTDetails>
  </p>
</template>

Card (boxed, standalone)

vue
<template>
  <GTDetails variant="card" summary="Do I need @grundtone/core?">
    <p>Yes — core contains TypeScript types, theme presets, and the icon registry.</p>
  </GTDetails>
</template>

Start open

vue
<template>
  <GTDetails summary="Installation" :open="true">
    <p>Run <code>pnpm add @grundtone/vue</code>.</p>
  </GTDetails>
</template>

Props

PropTypeDefaultDescription
summarystringrequiredVisible trigger text
variant'default' | 'subtle' | 'card''default'Visual variant
openbooleanfalseStart in open state
ariaLabelstringAccessible label for the details element

Slots

SlotDescription
defaultHidden content revealed on expand

Accessibility

  • Uses native <details>/<summary> — browser handles aria-expanded, keyboard, focus
  • Summary is keyboard-accessible by default (Enter/Space to toggle)
  • Hidden content must still follow the document heading hierarchy
  • Arrow indicator is decorative (aria-hidden="true")
  • Keep summary text short and descriptive

CSS Classes

ClassElement
.gt-detailsRoot <details> element
.gt-details--defaultBorder-left accent variant
.gt-details--subtleInline minimal variant
.gt-details--cardBoxed standalone variant
.gt-details__summaryClickable <summary> trigger
.gt-details__arrowChevron indicator
.gt-details__contentContent wrapper
.gt-details__bodyInner body with padding

Design system

The CSS-only version of this component is documented in the Design System — Details reference.