ki-sources
@kimen/elements/ki-sources- Source
- Agent reference
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.
The study design
<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
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Whether the disclosure is expanded. Set to show the list initially. |
source-count-label | sourceCountLabel | string | '{count} source' | Localized summary when there is one source. Use {count} for its number. |
sources-count-label | sourcesCountLabel | string | '{count} sources' | Localized summary for multiple sources. Use {count} for their number. |
Slots
| Slot | Description |
|---|---|
| (default) | Direct ki-source definitions for this answer. |
CSS parts
| Part | Description |
|---|---|
disclosure | Native expandable section. |
domain | Hostname derived from the link destination. |
list | Ordered list of sources. |
number | Source order marker inside the card. |
snippet | Optional excerpt. |
source | Source card link. |
summary | Disclosure control with the localized source count. |
title | Visible 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.
| Token | Description |
|---|---|
--ki-density-space-scale | Multiplies every scaled container padding and gap (card, dialog, alert, list, list item, select listbox, tab panel, tooltip). |
--ki-density-target-min | The 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-color | Colour of the keyboard focus ring every focusable component draws: 3:1 or more against the page in every theme and scheme. |
--ki-focus-ring-offset | Gap between a focusable component and its keyboard focus ring. |
--ki-focus-ring-width | Thickness 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-filter | Complete backdrop filter for a source card. |
--ki-source-card-bg | Resting background of a source card. |
--ki-source-card-bg-image | Optional decorative image over a source card. |
--ki-source-card-border | Border color of a source card. |
--ki-source-card-border-width | Border width of a source card. |
--ki-source-card-fg | Text on a resting source card. |
--ki-source-card-hover-bg | Background of a hovered source card. |
--ki-source-card-hover-fg | Text on a hovered source card. |
--ki-source-card-padding | Inset around source card content. |
--ki-source-card-radius | Corner radius of a source card. |
--ki-source-number-bg | Background of the number in a source card. |
--ki-source-number-fg | Text color of the number in a source card. |
--ki-source-number-radius | Corner radius of the number in a source card. |
--ki-source-number-size | Minimum size of the number in a source card. |
--ki-sources-list-gap | Gap between source cards. |
--ki-sources-max-inline-size | Maximum line length of the source disclosure. |
--ki-sources-summary-bg | Background of the source-count control. |
--ki-sources-summary-fg | Text on the source-count control. |
--ki-typography-family-body | semantic font family for typography family body. |
--ki-typography-line-height-body-1 | semantic dimension for typography line height body 1. |
--ki-typography-line-height-caption-2 | semantic dimension for typography line height caption 2. |
--ki-typography-size-body-1 | semantic dimension for typography size body 1. |
--ki-typography-size-caption-2 | semantic dimension for typography size caption 2. |
--ki-typography-weight-body-medium | semantic font weight for typography weight body medium. |
--ki-typography-weight-body-semibold | semantic font weight for typography weight body semibold. |