@kitn.ai/ui
Version:
Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.
24 lines (23 loc) • 1.13 kB
TypeScript
import { JSX } from 'solid-js';
import { CardEvent } from '../primitives/card-contract';
import { LinkPreviewData } from '../primitives/link-preview';
export interface LinkPreviewProps {
/** The card id correlating every emitted event. */
cardId: string;
/** The link payload (data-down). */
data: LinkPreviewData;
/** Emit a contract CardEvent up (host routes it). */
onEmit?: (event: CardEvent) => void;
/** Extra classes for the card root. */
class?: string;
}
/**
* `LinkPreview` — a pure, themed, accessible rich link / OG preview. Renders from the
* supplied metadata; it never fetches the network itself. When the payload is a
* bare `{ url }` and an app has registered a `configureLinkPreview` fetcher, it
* shows a skeleton, calls the hook, merges the result, and renders. Activating the
* card (click / Enter / Space) emits the contract `open` verb (`target:'tab'`); the
* host policy performs the navigation so it can veto/redirect.
*/
export declare function LinkPreview(props: LinkPreviewProps): JSX.Element;
export type { LinkPreviewData } from '../primitives/link-preview';