Skip to content
Kimenpre-v1documentation home
Color scheme

ki-details

Use a disclosure for a short explanation, an FAQ answer, a settings section or tool output. Supply a plain summary or slot a heading into the summary when the disclosure titles a section.

<ki-details open>
<h2 slot="summary">Workspace settings</h2>
<p>Choose who can invite members to the workspace.</p>
</ki-details>

The browser manages expansion and can reveal a match in a closed panel. Press Enter or Space on the focused summary to toggle it. When disabled is set, the summary skips the tab order and open body content stays usable. Listen to ki-toggle for browser-originated state changes and read event.detail.open. Direct writes to open are silent on that disclosure.

Use ki-accordion for related disclosures. To share exclusivity without an accordion, give the disclosures the same nonempty name in one document or shadow root. For HTML served without JavaScript, use native <details><summary>…</summary>…</details> markup.

API reference

When to use: reveal a short explanation, FAQ answer, settings section or tool output on demand. Use ki-accordion for related disclosures.

When not to use: hide the primary action or information needed to complete a task. For script-free HTML, author native details and summary directly.

Properties & attributes

AttributePropertyTypeDefaultDescription
disableddisabledbooleanfalseDisables summary activation. The page can still set open.
namenamestring | undefined–Nonempty name for exclusive disclosures in the same document or shadow root.
openopenbooleanfalseWhether the panel is open. Native changes reflect back to this property.
summarysummarystring | undefined–Plain label for the control. Supply the summary slot for a rich label.

Events

EventDetail typeDescription
ki-toggleCustomEvent<KiDetailsToggleDetail>Emitted when the native disclosure toggles or an exclusive peer closes it.

Slots

SlotDescription
(default)Content shown when the disclosure is open.
summaryRich summary text or an authored heading, replacing the summary prop.

CSS custom properties

The public styling contract of ki-details: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-density-space-scaleMultiplies every scaled container padding and gap (card, dialog, alert, list, list item, select listbox, tab panel, tooltip).
--ki-density-target-minThe smallest pointer target any density may produce: 24 x 24 CSS px by default and in compact (WCAG 2.5.8 AA), 44 x 44 in touch (WCAG 2.5.5). It floors a shrinking control but never lifts what a control paints: a control painted smaller extends its target to it, invisibly; rows and tabs grow to it (spec 045 A1).
--ki-details-backdrop-filterComplete filter for the backdrop behind the disclosure surface.
--ki-details-bgColor of the disclosure surface.
--ki-details-bg-imageOptional image painted over the disclosure surface.
--ki-details-body-bgSurface color of the disclosure body.
--ki-details-body-fgSupporting text color of the disclosure body.
--ki-details-borderColor of the disclosure frame and accordion separators.
--ki-details-border-widthWidth of the disclosure or accordion frame.
--ki-details-disabled-fgText and icon color of a disabled summary.
--ki-details-fgText color on the disclosure surface.
--ki-details-motion-durationDuration of the chevron rotation.
--ki-details-motion-easingEasing of the chevron rotation.
--ki-details-paddingInline inset of the summary and inset of the panel body.
--ki-details-radiusCorners of a standalone disclosure or the accordion frame.
--ki-details-summary-hover-bgSurface color of a hovered summary.
--ki-details-summary-hover-fgText and icon color of a hovered summary.
--ki-details-summary-padding-blockBlock inset of the summary.
--ki-focus-ring-colorColour of the keyboard focus ring every focusable component draws: 3:1 or more against the page in every theme and scheme.
--ki-focus-ring-widthThickness of the keyboard focus ring every focusable component draws (its outline). One token instead of one per component, so a mode or a theme changes every ring at once.
--ki-typography-family-bodysemantic font family for typography family body.
--ki-typography-line-height-body-1semantic dimension for typography line height body 1.
--ki-typography-line-height-parasemantic dimension for typography line height para.
--ki-typography-size-body-1semantic dimension for typography size body 1.
--ki-typography-weight-body-mediumsemantic font weight for typography weight body medium.

Open Details in Storybook