Search every page in the navigation.
Displays an inline status, system note, bordered row, or labeled separator in a conversation.
import { IconGitBranch, IconSearch } from "@tabler/icons-react"
import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"
import { Spinner } from "@/components/ui/spinner"
function MarkerDemo() {
return (
<div className="flex w-full max-w-sm flex-col gap-8 py-12">
<Marker>
<MarkerIcon>
<IconGitBranch />
</MarkerIcon>
<MarkerContent>Switched to a new branch</MarkerContent>
</Marker>
<Marker role="status">
<MarkerIcon>
<Spinner />
</MarkerIcon>
<MarkerContent className="shimmer">Thinking...</MarkerContent>
</Marker>
<Marker variant="separator">
<MarkerContent>Conversation compacted</MarkerContent>
</Marker>
<Marker>
<MarkerIcon>
<IconSearch />
</MarkerIcon>
<MarkerContent>Explored 4 files</MarkerContent>
</Marker>
</div>
)
}
export default MarkerDemoThe 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.
npx shadcn@latest add @ziiz/markerimport { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"<Marker>
<MarkerIcon>
<IconCheck />
</MarkerIcon>
<MarkerContent>Explored 4 files</MarkerContent>
</Marker>Use the following composition to build a marker:
Marker
โโโ MarkerIcon
โโโ MarkerContentrender for link and button markersshimmer utility for streaming status textclassName prop on every partUse variant to switch between an inline marker, bordered row, and labeled separator.
import { Marker, MarkerContent } from "@/components/ui/marker"
function MarkerVariantsDemo() {
return (
<div className="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>
)
}
export default MarkerVariantsDemo| 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. |
Set role="status" and include a Spinner for streaming or in-progress markers so updates are announced.
import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"
import { Spinner } from "@/components/ui/spinner"
function MarkerStatusDemo() {
return (
<div className="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>
)
}
export default MarkerStatusDemoAdd the shimmer utility class to MarkerContent for an animated streaming-text effect. The utility ships with the shadcn package; see the shimmer docs for installation.
import { Marker, MarkerContent } from "@/components/ui/marker"
function MarkerShimmerDemo() {
return (
<div className="flex w-full max-w-sm flex-col gap-8 py-12">
<Marker role="status">
<MarkerContent className="shimmer">Thinking...</MarkerContent>
</Marker>
<Marker variant="separator" role="status">
<MarkerContent className="shimmer">Reading 4 files</MarkerContent>
</Marker>
</div>
)
}
export default MarkerShimmerDemoUse the separator variant for labeled dividers, such as dates or section breaks, in a conversation.
import { Marker, MarkerContent } from "@/components/ui/marker"
function MarkerSeparatorDemo() {
return (
<div className="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>
)
}
export default MarkerSeparatorDemoUse the border variant for status rows that should keep the default marker alignment while separating the next row.
import { IconFileText, IconGitBranch, IconSearch } from "@tabler/icons-react"
import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"
function MarkerBorderDemo() {
return (
<div className="flex w-full max-w-sm flex-col gap-3 py-12">
<Marker variant="border">
<MarkerIcon>
<IconGitBranch />
</MarkerIcon>
<MarkerContent>Switched to release-candidate</MarkerContent>
</Marker>
<Marker variant="border">
<MarkerIcon>
<IconSearch />
</MarkerIcon>
<MarkerContent>Reviewed 8 related files</MarkerContent>
</Marker>
<Marker variant="border">
<MarkerIcon>
<IconFileText />
</MarkerIcon>
<MarkerContent>Opened implementation notes</MarkerContent>
</Marker>
</div>
)
}
export default MarkerBorderDemoUse MarkerIcon to render an icon alongside the content. Use flex-col to stack the icon above the content.
import { IconBook, IconGitBranch, IconSearch } from "@tabler/icons-react"
import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"
function MarkerIconDemo() {
return (
<div className="flex w-full max-w-sm flex-col gap-12 py-12">
<Marker>
<MarkerIcon>
<IconGitBranch />
</MarkerIcon>
<MarkerContent>Switched to a new branch</MarkerContent>
</Marker>
<Marker variant="separator">
<MarkerIcon>
<IconSearch />
</MarkerIcon>
<MarkerContent>Explored 4 files</MarkerContent>
</Marker>
<Marker className="flex-col">
<MarkerIcon>
<IconBook />
</MarkerIcon>
<MarkerContent>Syncing completed</MarkerContent>
</Marker>
</div>
)
}
export default MarkerIconDemoTurn a marker into a link or button with the render prop on Marker.
"use client"
import { IconGitBranch, IconRotate } from "@tabler/icons-react"
import { toast } from "sonner"
import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker"
function MarkerLinkButtonDemo() {
return (
<div className="flex w-full max-w-sm flex-col gap-8 py-12">
<Marker render={<a href="#links-and-buttons" />}>
<MarkerIcon>
<IconGitBranch />
</MarkerIcon>
<MarkerContent>View the pull request</MarkerContent>
</Marker>
<Marker
render={
<button
type="button"
className="transition-colors hover:text-gray-1000"
onClick={() => toast("You clicked the revert button")}
/>
}
>
<MarkerIcon>
<IconRotate />
</MarkerIcon>
<MarkerContent>Revert this change</MarkerContent>
</Marker>
</div>
)
}
export default MarkerLinkButtonDemoimport { Marker, MarkerContent } from "@/components/ui/marker"
export function MarkerLinkDemo() {
return (
<Marker render={<a href="#" />}>
<MarkerContent>View the pull request</MarkerContent>
</Marker>
)
}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.
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>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>Note: Do not add role="separator" to a labeled divider. A separator
takes its accessible name from aria-label, not from its text, and its
contents are treated as presentational, so the visible label would not be
announced. Reserve role="separator" for a divider with no meaningful text.
A bordered marker keeps the same semantics as the default marker. The bottom border is decorative, so choose role="status", render, or no role based on the marker's purpose.
<Marker variant="border">
<MarkerIcon>
<IconFileText />
</MarkerIcon>
<MarkerContent>Opened implementation notes</MarkerContent>
</Marker>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>
<IconCheck />
</MarkerIcon>
</Marker>When a marker links or triggers an action, render it as a real <button> or <a> with the render prop so it is focusable and exposes the correct role. The accessible name comes from the marker text.
<Marker render={<a href="/files" />}>
<MarkerIcon>
<IconFileText />
</MarkerIcon>
<MarkerContent>Explored 4 files</MarkerContent>
</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. |
render | ReactElement | function | - | Render as a different element, such as a link. |
className | string | - | Additional classes to apply to the root element. |
A decorative icon slot. Hidden from assistive tech with aria-hidden.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional classes to apply to the icon slot. |
The marker text content.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional classes to apply to the content slot. |