Marker

A highlighter stroke across the one phrase in a paragraph a reader should not miss. The first time the phrase scrolls into view, the stroke sweeps across it from the start of the line to the end, the way a pen would, and wraps across lines with the text.…

decorativeclientuiv1.0.1

Preview

Marker — live rendereffects-marker--default ↗

Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.

Install

Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.

Via shadcn URL
npx shadcn@latest add https://ds.interlace.tools/r/marker.json
With the @interlace alias
npx shadcn@latest add @interlace/marker

History

This component is at v1.0.1, first shipped in @interlace/ui 2.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.

@interlace/ui 2.0.02 entries

Import

3 named exports — pull the parts you need.

Public API
import { Marker, MarkerTone, MarkerVariant } from '@/components/ui/effects/marker';

API reference

Parsed from the type declarations in the source — the same file the install writes into your tree, so this table can't drift from the component you get.

MarkerProps

Also accepts every <mark> attribute.

PropTypeDescription
variantMarkerVariantThe shape of the stroke: `band` across the lower half, `full` across the line, `underline` under it. @default 'band'
toneMarkerToneThe colour of the stroke. @default 'highlight'
durationnumberMilliseconds the sweep takes. @default 700
delaynumberMilliseconds to wait after the phrase enters the viewport. @default 150

Accessibility

Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.

What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.

Focus + keyboard behaviour
Native element semantics — no interaction layer to get wrong.
Focus ring (WCAG 2.2 SC 2.4.13)
Not focusable — no focus indicator required.
Reduced motion
Animation is gated on prefers-reduced-motion.
ARIA in the source
None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.

Examples

2 more states from the same story file.

R-rule compliance

Every primitive in @interlace/ui models to the portable 26-rule floor enforced by the componentApi ESLint preset. The cells below pin exactly where each rule applies in this file.

RuleConceptWhere
R4Extends native el`mark` props
R6data-slot per partmarker
R7cn + ...rest`cn(…, className)` + `{...props}`
R8Enums, not booleans`variant`, `tone`
R19Tokens only`--highlight`, `--primary`
R25Client componentthe sweep runs in the browser
R26A11y from native el`<mark>` semantics

Dependencies

Base UI primitive
Native / no Base UI dependency
Lucide icons
none
NPM dependencies
none

Source

The full implementation — components/ui/effects/marker.tsx once installed.

164 lines · TypeScript
'use client';

import * as React from 'react';

// @interlace/marker v1.0.1 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/marker
// What changed since: https://ds.interlace.tools/c/marker#history
// Generated banner — keep it, the upgrade diff reads this version.

/**
 * @interlace/ui — Marker
 *
 * A highlighter stroke across the one phrase in a paragraph a reader should
 * not miss. The first time the phrase scrolls into view, the stroke sweeps
 * across it from the start of the line to the end, the way a pen would, and
 * wraps across lines with the text. It is emphasis, so use it once or twice
 * on a page, not on every sentence.
 *
 * ## Content first
 *

…144 more lines…

Registry JSON

The raw registry record — what the shadcn CLI fetches.