VexellDocs · v1.5

AI primitive

ContextBadge

Small chip representing a piece of attached context (a file, a URL, a previous message). Removable by default, with file-type icons.

Usage

Pick your edition with the tabs. Selection syncs across all docs.

tsx
import { ContextBadge } from '@/components/molecules'

<ContextBadge
  label="pricing.md"
  kind="file"
  onRemove={() => removeContext('c1')}
/>

Props

Same surface in both editions; HTML version exposes equivalents through Alpine x-data.

PropTypeDefaultDescription
labelstringVisible chip text.
kind"file" | "url" | "message" | "code""file"Determines the icon.
onRemove() => voidRender the × button when provided.

Accessibility

  • role

    Renders as <span>; the remove button has aria-label='Remove'.

  • size

    Remove button hit-target ≥ 24px.

Read next