Sources
Preview

Collapsible source lists for response-level references.

Overview

Sources groups response references behind a compact trigger. It is useful when citations should be available without taking over the message body.

Usage

import {
  Source,
  Sources,
  SourcesContent,
  SourcesTrigger,
} from "@tilt-legal/cubitt-components/chat-elements";

Examples

Default

Closed

API Reference

Sources

Root collapsible wrapper for response sources. Extends Collapsible props.

PropTypeDefaultDescription
openboolean-Controlled open state inherited from Collapsible.
defaultOpenboolean-Initial open state when uncontrolled.
onOpenChange(open: boolean) => void-Callback fired when the source list opens/closes.
classNamestring-Additional CSS classes for the root wrapper.

SourcesTrigger

Trigger for opening and closing the source list. Extends CollapsibleTrigger props.

PropTypeDefaultDescription
countnumber-Number used by the default label, rendered as Used {count} sources. Required.
childrenReact.ReactNode-Custom trigger content. Replaces the default label and chevron.
classNamestring-Additional CSS classes for the trigger.

SourcesContent

Collapsible panel that contains Source links. Extends CollapsiblePanel props.

PropTypeDefaultDescription
childrenReact.ReactNode-Source links or custom source content.
classNamestring-Additional CSS classes for the panel.

Source

External source link. Extends all HTML a props.

PropTypeDefaultDescription
hrefstring-Source URL.
titlestring-Label used by the default source content. Also maps to the anchor title attribute.
childrenReact.ReactNode-Custom source content. Replaces the default icon/title row.
targetstring"_blank"Anchor target. Can be overridden through standard anchor props.
relstring"noreferrer"Anchor relationship. Can be overridden through standard anchor props.

On this page