Source
kai-source
A citation chip that shows a domain label and reveals a hover card with a headline and description — drop it below an assistant message to let users verify where an answer came from.
- Shadow DOM
- All props are attributes
- Optional favicon
- Hover-card preview
- No events
Preview
Section titled “Preview”All props are plain HTML attributes — no JavaScript needed:
<kai-source href="https://kitn.dev" headline="kitn — the kit" description="Composable SolidJS + web-component chat UI." show-favicon></kai-source><script type="module">import '@kitn.ai/ui/elements';</script>hrefis required. The element renders nothing without it.labeldefaults to the hostname (kitn.dev). Pass an explicit label when the domain is ambiguous or too long.headline(nottitle) —titleis a reserved HTML attribute that conflicts with custom element constructors.- Clicking the chip opens the URL directly — the element emits no events.
Examples
Section titled “Examples”Basic Citation
Section titled “Basic Citation”With Favicon
Section titled “With Favicon”Custom Label
Section titled “Custom Label”Override the domain default with label when you want a shorter or more recognisable name.
Full Detail with Favicon
Section titled “Full Detail with Favicon”| Property | Type | Default | Notes |
|---|---|---|---|
| href | string | '' | The URL this citation links to (the domain also seeds the default label/favicon). |
| label | string | — | Trigger label (defaults to the domain). |
| headline | string | '' | Hover-card headline. Attribute: `headline` (`title` is avoided — it's a global HTML attribute that reflects in a CE constructor and breaks it). |
| description | string | '' | Hover-card body text describing the source. |
| showFavicon | boolean | false | Show the source's favicon next to the trigger label. |
Composed from
Section titled “Composed from”This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.
SourceSourceTriggerSourceContentSourceList