Skip to content
Kimenpre-v1documentation home
Color scheme

ki-sources

Use ki-sources to show the evidence behind an answer. Give every direct ki-source a unique identifier, destination and title. Place a ki-citation immediately after the supported claim and set its ref to that identifier.

Theme for this example
Color scheme for this example

The study design explains the results.

<p>The study design<ki-citation ref="methods"></ki-citation> explains the results.</p>
<ki-sources>
<ki-source id="methods" href="https://example.org/methods" title="Study design" snippet="How the study ran."></ki-source>
</ki-sources>

The disclosure starts closed. Add open to expand it initially. The first mention decides each number. Repeated mentions reuse that number. Sources without citations follow in declaration order.

Hover or focus a citation to preview its title and hostname. Escape dismisses the preview. Activating the citation expands the disclosure and focuses its source link. The links in the ordered list have their source titles as names.

Use label-template, source-count-label, and sources-count-label to localize the labels. Set source-id instead of id in a guarded spec. Use the same reference in the citation.

API reference

When to use: To show the evidence behind an answer. Add direct ki-source children and place ki-citation markers next to the claims they support.

When not to use: For ordinary navigation, unrelated links, or form controls.

Properties & attributes

AttributePropertyTypeDefaultDescription
openopenbooleanfalseWhether the disclosure is expanded. Set to show the list initially.
source-count-labelsourceCountLabelstring'{count} source'Localized summary when there is one source. Use {count} for its number.
sources-count-labelsourcesCountLabelstring'{count} sources'Localized summary for multiple sources. Use {count} for their number.

Slots

SlotDescription
(default)Direct ki-source definitions for this answer.

CSS parts

PartDescription
disclosureNative expandable section.
domainHostname derived from the link destination.
listOrdered list of sources.
numberSource order marker inside the card.
snippetOptional excerpt.
sourceSource card link.
summaryDisclosure control with the localized source count.
titleVisible title of the link.

CSS custom properties

The public styling contract of ki-sources: 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-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-offsetGap between a focusable component and its keyboard focus ring.
--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-source-card-backdrop-filterComplete backdrop filter for a source card.
--ki-source-card-bgResting background of a source card.
--ki-source-card-bg-imageOptional decorative image over a source card.
--ki-source-card-borderBorder color of a source card.
--ki-source-card-border-widthBorder width of a source card.
--ki-source-card-fgText on a resting source card.
--ki-source-card-hover-bgBackground of a hovered source card.
--ki-source-card-hover-fgText on a hovered source card.
--ki-source-card-paddingInset around source card content.
--ki-source-card-radiusCorner radius of a source card.
--ki-source-number-bgBackground of the number in a source card.
--ki-source-number-fgText color of the number in a source card.
--ki-source-number-radiusCorner radius of the number in a source card.
--ki-source-number-sizeMinimum size of the number in a source card.
--ki-sources-list-gapGap between source cards.
--ki-sources-max-inline-sizeMaximum line length of the source disclosure.
--ki-sources-summary-bgBackground of the source-count control.
--ki-sources-summary-fgText on the source-count control.
--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-caption-2semantic dimension for typography line height caption 2.
--ki-typography-size-body-1semantic dimension for typography size body 1.
--ki-typography-size-caption-2semantic dimension for typography size caption 2.
--ki-typography-weight-body-mediumsemantic font weight for typography weight body medium.
--ki-typography-weight-body-semiboldsemantic font weight for typography weight body semibold.

Workshop

Open Sources in Storybook