0.04K

Displays an inline status, system note, bordered row, or labeled separator in a conversation.

Switched to a new branch
Thinking…
Conversation compacted
Explored 4 files
import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';
import { Spinner } from '@/components/ui/spinner';

import GitBranchIcon from '~icons/lucide/git-branch';
import SearchIcon from '~icons/lucide/search';

<template>
  <div class="flex w-full max-w-sm flex-col gap-8 py-12">
    <Marker>
      <MarkerIcon>
        <GitBranchIcon />
      </MarkerIcon>
      <MarkerContent>Switched to a new branch</MarkerContent>
    </Marker>
    <Marker role="status">
      <MarkerIcon>
        <Spinner />
      </MarkerIcon>
      <MarkerContent class="shimmer">Thinking…</MarkerContent>
    </Marker>
    <Marker @variant="separator">
      <MarkerContent>Conversation compacted</MarkerContent>
    </Marker>
    <Marker>
      <MarkerIcon>
        <SearchIcon />
      </MarkerIcon>
      <MarkerContent>Explored 4 files</MarkerContent>
    </Marker>
  </div>
</template>

The Marker component displays inline conversation markers such as status updates, system notes, bordered rows, and labeled separators. Compose it with Message in a conversation thread.

Installation

pnpm dlx shadcn-ember@latest add marker

Usage

import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';
<Marker>
  <MarkerIcon>
    <CheckIcon />
  </MarkerIcon>
  <MarkerContent>Explored 4 files</MarkerContent>
</Marker>

Composition

Use the following composition to build a marker:

Marker
├── MarkerIcon
└── MarkerContent

Features

  • Inline marker, bordered row, and labeled separator variants
  • Decorative icon slot that is hidden from assistive tech
  • Polymorphic root via @asChild for link and button markers
  • Pairs with the shimmer utility for streaming status text
  • Customizable styling through the @class argument on every part

Examples

Variants

Use @variant to switch between an inline marker, bordered row, and labeled separator.

A default marker for inline notes.
A separator marker
A border marker for row boundaries.
import { Marker, MarkerContent } from '@/components/ui/marker';

<template>
  <div class="flex w-full max-w-sm flex-col gap-8 py-12">
    <Marker>
      <MarkerContent>A default marker for inline notes.</MarkerContent>
    </Marker>
    <Marker @variant="separator">
      <MarkerContent>A separator marker</MarkerContent>
    </Marker>
    <Marker @variant="border">
      <MarkerContent>A border marker for row boundaries.</MarkerContent>
    </Marker>
  </div>
</template>
Variant Description
default An inline marker for status, notes, and actions.
border A default marker with a bottom border under the row.
separator A centered label with divider lines on each side.

Status

Set role="status" and include a Spinner for streaming or in-progress markers so updates are announced.

Compacting conversation
Running tests
import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';
import { Spinner } from '@/components/ui/spinner';

<template>
  <div class="flex w-full max-w-sm flex-col gap-8 py-12">
    <Marker role="status">
      <MarkerIcon>
        <Spinner />
      </MarkerIcon>
      <MarkerContent>Compacting conversation</MarkerContent>
    </Marker>
    <Marker @variant="separator" role="status">
      <MarkerIcon>
        <Spinner />
      </MarkerIcon>
      <MarkerContent>Running tests</MarkerContent>
    </Marker>
  </div>
</template>

Shimmer

Add the shimmer utility class to MarkerContent for an animated streaming-text effect.

Thinking…
Reading 4 files
import { Marker, MarkerContent } from '@/components/ui/marker';

<template>
  <div class="flex w-full max-w-sm flex-col gap-8 py-12">
    <Marker role="status">
      <MarkerContent class="shimmer">Thinking…</MarkerContent>
    </Marker>
    <Marker @variant="separator" role="status">
      <MarkerContent class="shimmer">Reading 4 files</MarkerContent>
    </Marker>
  </div>
</template>

Separator

Use the separator variant for labeled dividers, such as dates or section breaks, in a conversation.

Today
Worked for 42s
Conversation compacted
import { Marker, MarkerContent } from '@/components/ui/marker';

<template>
  <div class="flex w-full max-w-sm flex-col gap-8 py-12">
    <Marker @variant="separator">
      <MarkerContent>Today</MarkerContent>
    </Marker>
    <Marker @variant="separator">
      <MarkerContent>Worked for 42s</MarkerContent>
    </Marker>
    <Marker @variant="separator">
      <MarkerContent>Conversation compacted</MarkerContent>
    </Marker>
  </div>
</template>

Border

Use the border variant for status rows that should keep the default marker alignment while separating the next row.

Switched to release-candidate
Reviewed 8 related files
Opened implementation notes
import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';

import FileTextIcon from '~icons/lucide/file-text';
import GitBranchIcon from '~icons/lucide/git-branch';
import SearchIcon from '~icons/lucide/search';

<template>
  <div class="flex w-full max-w-sm flex-col gap-3 py-12">
    <Marker @variant="border">
      <MarkerIcon>
        <GitBranchIcon />
      </MarkerIcon>
      <MarkerContent>Switched to release-candidate</MarkerContent>
    </Marker>
    <Marker @variant="border">
      <MarkerIcon>
        <SearchIcon />
      </MarkerIcon>
      <MarkerContent>Reviewed 8 related files</MarkerContent>
    </Marker>
    <Marker @variant="border">
      <MarkerIcon>
        <FileTextIcon />
      </MarkerIcon>
      <MarkerContent>Opened implementation notes</MarkerContent>
    </Marker>
  </div>
</template>

With Icon

Use MarkerIcon to render an icon alongside the content. Use flex-col to stack the icon above the content.

Switched to a new branch
Explored 4 files
Syncing completed
import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';

import BookOpenCheckIcon from '~icons/lucide/book-open-check';
import GitBranchIcon from '~icons/lucide/git-branch';
import SearchIcon from '~icons/lucide/search';

<template>
  <div class="flex w-full max-w-sm flex-col gap-12 py-12">
    <Marker>
      <MarkerIcon>
        <GitBranchIcon />
      </MarkerIcon>
      <MarkerContent>Switched to a new branch</MarkerContent>
    </Marker>
    <Marker @variant="separator">
      <MarkerIcon>
        <SearchIcon />
      </MarkerIcon>
      <MarkerContent>Explored 4 files</MarkerContent>
    </Marker>
    <Marker class="flex-col">
      <MarkerIcon>
        <BookOpenCheckIcon />
      </MarkerIcon>
      <MarkerContent>Syncing completed</MarkerContent>
    </Marker>
  </div>
</template>

Turn a marker into a link or button with the @asChild argument on Marker . Apply the yielded classes and the data-slot="marker" attribute to your element.

View the pull request
import { on } from '@ember/modifier';
import { service } from '@ember/service';
import Component from '@glimmer/component';

import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';

import type ToastService from '@/services/toast';

import GitBranchIcon from '~icons/lucide/git-branch';
import RotateCcwIcon from '~icons/lucide/rotate-ccw';

export default class MarkerLinkButtonDemo extends Component {
  @service declare toast: ToastService;

  revert = () => {
    this.toast.add({ message: 'You clicked the revert button' });
  };

  <template>
    <div class="flex w-full max-w-sm flex-col gap-8 py-12">
      <Marker @asChild={{true}} as |marker|>
        <a
          class={{marker.classes}}
          data-slot="marker"
          data-variant="default"
          href="#links-and-buttons"
        >
          <MarkerIcon>
            <GitBranchIcon />
          </MarkerIcon>
          <MarkerContent>View the pull request</MarkerContent>
        </a>
      </Marker>
      <Marker @asChild={{true}} as |marker|>
        <button
          class="{{marker.classes}} transition-colors hover:text-foreground"
          data-slot="marker"
          data-variant="default"
          type="button"
          {{on "click" this.revert}}
        >
          <MarkerIcon>
            <RotateCcwIcon />
          </MarkerIcon>
          <MarkerContent>Revert this change</MarkerContent>
        </button>
      </Marker>
    </div>
  </template>
}
import { Marker, MarkerContent } from '@/components/ui/marker';

<template>
  <Marker @asChild={{true}} as |marker|>
    <a class={{marker.classes}} data-slot="marker" data-variant="default" href="#">
      <MarkerContent>View the pull request</MarkerContent>
    </a>
  </Marker>
</template>

Accessibility

Marker is presentational by default. The correct semantics depend on how you use it, so choose the role based on intent rather than relying on a single default.

Status and Progress

For streaming or progress markers such as "Thinking..." or a running tool, set role="status" so assistive tech announces the update as it appears. Marker forwards role to the underlying element.

<Marker role="status">
  <MarkerIcon>
    <Spinner />
  </MarkerIcon>
  <MarkerContent>Compacting conversation</MarkerContent>
</Marker>

Labeled Separators

A separator that carries text, such as a date or a section label, needs no role. The divider lines are decorative CSS pseudo-elements, and the text is announced as ordinary content.

<Marker @variant="separator">
  <MarkerContent>Today</MarkerContent>
</Marker>

Bordered Markers

A bordered marker keeps the same semantics as the default marker. The bottom border is decorative, so choose role="status" , @asChild , or no role based on the marker's purpose.

<Marker @variant="border">
  <MarkerIcon>
    <FileTextIcon />
  </MarkerIcon>
  <MarkerContent>Opened implementation notes</MarkerContent>
</Marker>

Decorative Icons

MarkerIcon is decorative and hidden from assistive tech with aria-hidden , so the adjacent MarkerContent carries the meaning. For an icon-only marker, provide an aria-label or visible text so it is not announced as empty.

<Marker aria-label="Synced">
  <MarkerIcon>
    <CheckIcon />
  </MarkerIcon>
</Marker>

Interactive Markers

When a marker links or triggers an action, render it as a real <button> or <a> with the @asChild argument so it is focusable and exposes the correct role. The accessible name comes from the marker text.

<Marker @asChild={{true}} as |marker|>
  <a class={{marker.classes}} data-slot="marker" data-variant="default" href="/files">
    <MarkerIcon>
      <FileTextIcon />
    </MarkerIcon>
    <MarkerContent>Explored 4 files</MarkerContent>
  </a>
</Marker>

API Reference

Marker

The root marker element. The file also exports markerVariants for composing the marker styles into custom components.

Prop Type Default Description
@variant "default" | "border" | "separator" "default" The marker layout.
@asChild boolean false Render as the child element, such as a link.
@class string - Additional classes to apply to the root element.

MarkerIcon

A decorative icon slot. Hidden from assistive tech with aria-hidden .

Prop Type Default Description
@class string - Additional classes to apply to the icon slot.

MarkerContent

The marker text content.

Prop Type Default Description
@class string - Additional classes to apply to the content slot.