Atoms

Marker

An inline status row for a conversation: system notes, tool activity, and labeled separators.

shadcn/ui
Docs

Installation#

npx shadcn@latest add @formance/marker

Install the following dependencies:

npm install class-variance-authority radix-ui

Copy 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└── MarkerContent

Features#

  • 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.
  • asChild on Marker makes a link marker or a button marker.
  • Works with the shimmer utility 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.

VariantDescription
defaultAn inline marker for status, notes, and actions.
borderA default marker with a border below the row.
separatorA 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.

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". Marker sends role to 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 from aria-label, not from its text.
  • The border of a border marker is decorative. Choose the role from the purpose of the marker.
  • MarkerIcon has aria-hidden, so MarkerContent gives the meaning. For a marker with only an icon, add an aria-label.
  • When a marker is interactive, use a real <button> or <a> with asChild. The text of the marker is the accessible name.

API reference#

Marker#

PropTypeDefaultDescription
variant"default" | "separator" | "border""default"The visual treatment.
asChildbooleanfalseRender the child, for example a link.
classNamestring-More classes for the marker.

MarkerIcon#

PropTypeDefaultDescription
classNamestring-More classes for the icon slot.

MarkerContent#

PropTypeDefaultDescription
classNamestring-More classes for the content.