The sources attached to a prompt shown as removable chips, each with its type and ready / processing status.
Loading demo: prompt-context-real-world
npx sdaia-ui@latest add prompt-context
import { PromptContext } from '@/components/ui/PromptContext';1<PromptContext2filename="customer_churn_logs_june.csv"3tokens="14.8k tokens"4fileType="CSV"5status="Loaded"6onRemove={() => {}}7/>
A raised surface — the default style.
Loading demo: prompt-context-brand
A subtle surface.
Loading demo: prompt-context-neutral
A transparent surface with a default border.
Loading demo: prompt-context-outline
Toggle the type badge, status badge and remove action.
Loading demo: prompt-context-toggles
Prop | Type | Default | Required |
|---|---|---|---|
variant | 'brand' | 'neutral' | 'outline' | 'brand' | optional |
filename | ReactNode | — | required |
tokens | ReactNode | — | optional |
fileType | ReactNode | — | optional |
status | ReactNode | — | optional |
statusColor | BadgeColor | 'primary' | optional |
showType / showStatus / showRemove | boolean | true | optional |
onRemove | MouseEventHandler | — | optional |
dir | 'ltr' | 'rtl' | — | optional |
labels | Partial<PromptContextLabels> | — | optional |
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | Fills the width of its container. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | Same layout with the mobile token values. Long file names are truncated and the meta row wraps. |