Draw On
A line drawing that draws itself as it scrolls into view: an illustration, a diagram, an arrow that points at the next thing, a signature. Wrap any inline SVG; every stroked shape inside traces its own line, one after another in document order, and filled…
Preview
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.
npx shadcn@latest add https://ds.interlace.tools/r/draw-on.jsonnpx shadcn@latest add @interlace/draw-onHistory
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
- Addedminor
New DrawOn and Marker, editorial motion for line drawings and emphasis. DrawOn wraps any inline SVG and draws its stroked shapes as it scrolls into view, one after another (
order="sequence") or all at once, then fades in the fills. Marker is a<mark>whose highlighter stroke sweeps across a phrase from the inline-start edge, inband,fullorunderlineshapes andhighlightorprimarytones. Both render the finished result on the server, run once, and are simply there under reduced motion.Components - Addedminor
Animations started from script now follow the brand's
--ease-*and--duration-*tokens, like the CSS does. A newmotion-tokenlib item reads them from the element that moves.Components- @interlace/motion-token
- @interlace/calendar
- @interlace/time-slot-picker
- @interlace/multi-step-form
- @interlace/commitment
- @interlace/interest-signal
- @interlace/session-composer
- @interlace/guess-reveal
- @interlace/quiz-question
- @interlace/duel
- @interlace/order-game
- @interlace/podium
- @interlace/live-room
- @interlace/word-cloud
- @interlace/answer-pad
- @interlace/tally-bars
- @interlace/standings
- @interlace/closer-game
- @interlace/stagger-list
- @interlace/flip-group
- @interlace/reveal
- @interlace/celebrate
- @interlace/split-text
- @interlace/marker
- @interlace/rotating-text
Import
2 named exports — pull the parts you need.
import { DrawOn, DrawOnOrder } from '@/components/ui/effects/draw-on';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.
DrawOnProps
Also accepts every <div> attribute.
| Prop | Type | Description |
|---|---|---|
| order | DrawOnOrder | `sequence` draws one line after another in document order; `together` draws them all at once. @default 'sequence' |
| duration | number | Milliseconds each line takes to draw. @default 1200 |
| stagger | number | Milliseconds between the start of one line and the next, for `order="sequence"`. @default 150 |
| delay | number | Milliseconds to wait after the drawing enters the viewport. @default 0 |
| amount | number | How much of the drawing must be visible before it draws, from 0 to 1. @default 0.3 |
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.
| Rule | Concept | Where |
|---|---|---|
| R4 | Extends native el | `div` props |
| R6 | data-slot per part | draw-on |
| R7 | cn + ...rest | `cn(className)` + `{...props}` |
| R8 | Enums, not booleans | `order` |
| R25 | Client component | the drawing runs in the browser |
| R26 | A11y from native el | the SVG keeps its own semantics |
Dependencies
- Base UI primitive
- Native / no Base UI dependency
- Lucide icons
- none
- NPM dependencies
- none
Source
The full implementation — components/ui/effects/draw-on.tsx once installed.
'use client';
import * as React from 'react';
// @interlace/draw-on v1.0.1 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/draw-on
// What changed since: https://ds.interlace.tools/c/draw-on#history
// Generated banner — keep it, the upgrade diff reads this version.
/**
* @interlace/ui — DrawOn
*
* A line drawing that draws itself as it scrolls into view: an illustration,
* a diagram, an arrow that points at the next thing, a signature. Wrap any
* inline SVG; every stroked shape inside traces its own line, one after
* another in document order, and filled shapes fade in once the lines are
* down. It is the motion of a pen on paper, so it suits a calm, editorial
* page where line drawings stand in for photographs.
*
* ## Content first
…198 more lines…Registry JSON
The raw registry record — what the shadcn CLI fetches.