Marker
An inline status row for a conversation: system notes, tool activity, and labeled separators.
Installation#
npx shadcn@latest add @formance/markerInstall the following dependencies:
npm install class-variance-authority radix-uiCopy and paste the following code into your project.
Update the import paths to match your project setup.
Usage#
import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';<Marker role="status"> <MarkerContent className="shimmer">Thinking…</MarkerContent></Marker>Add the shimmer utility to MarkerContent while a step is pending, and set
role="status" so that screen readers announce it.
Composition#
Marker├── MarkerIcon└── MarkerContentFeatures#
- Three variants: an inline marker, a row with a border, and a separator with a label.
- A decorative icon slot that assistive tech does not read.
asChildonMarkermakes a link marker or a button marker.- Works with the
shimmerutility for streaming status text. - Each part accepts
className.
Examples#
Variants#
Use variant to change between an inline marker, a row with a border, and a
separator with a label.
| Variant | Description |
|---|---|
default | An inline marker for status, notes, and actions. |
border | A default marker with a border below the row. |
separator | A label in the center, with a line on each side. |
Status#
Set role="status" and add a Spinner to a marker
that streams or is in progress, so that screen readers announce it.
Shimmer#
Add the shimmer utility to MarkerContent for an animated streaming text.
@formance/ds init installs the utility in your globals.css.
Separator#
Use variant="separator" for date breaks and mode changes. A
Checkpoint is a separator with a button that
restores the conversation to that point.
Border#
Use variant="border" for a list of rows, for example validation warnings.
With icon#
Use MarkerIcon to show an icon before the content. Add flex-col to put the
icon above the content.
Links and buttons#
Set asChild on Marker to render a marker as a link or as a button.
Accordion#
Put a Marker in an AccordionTrigger to show the details of a step when the person opens it.
Drawer#
A Marker with a button opens a Drawer with the details of the step.
<Marker asChild> <a href="/ledger/schema"> <MarkerContent>View the schema diff</MarkerContent> </a></Marker>Accessibility#
- For a marker that streams or shows progress, for example "Thinking…", set
role="status".Markersendsroleto its element. - A separator with a label needs no role. Its lines are decorative, and screen
readers read its text. Do not add
role="separator"to it: a separator takes its name fromaria-label, not from its text. - The border of a
bordermarker is decorative. Choose the role from the purpose of the marker. MarkerIconhasaria-hidden, soMarkerContentgives the meaning. For a marker with only an icon, add anaria-label.- When a marker is interactive, use a real
<button>or<a>withasChild. The text of the marker is the accessible name.
API reference#
Marker#
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "separator" | "border" | "default" | The visual treatment. |
asChild | boolean | false | Render the child, for example a link. |
className | string | - | More classes for the marker. |
MarkerIcon#
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | More classes for the icon slot. |
MarkerContent#
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | More classes for the content. |