Redline

Figma-style redlines for any layout. Point at an element to see its size, padding and gaps, with lines and labels that glide from one element to the next. Pin one and hold Alt to measure the distance to another.

  • Inspector
  • Hover
  • Design

Uses motion, clsx, tailwind-merge

Open in ChatGPTOpen in Claude

Craft

We sweat the details you'll never notice

Every space on this card was decided, not defaulted. Point at anything to see its numbers, click to pin it, then hold ⌥ and point at another to measure between them.

A gray floor lamp against a white wall

Kessel Floor Lamp

$240

Arrow keys move between elements: up to the parent, down to the first child, left and right to siblings. Enter pins one, and moving on then measures the distance from it. Escape clears.

Installation

Add the component on its own with the CLI, or copy the file in by hand.

The CLI writes components/ui/redline.tsx and installs motion, clsx and tailwind-merge. It needs the @keyframeui registry in components.json; add it once per project.

npx shadcn@latest add @keyframeui/redline

Examples

Finished sections built with Redline. Each one installs whole, with the component included.

Design System

A settings panel where every spacing label reads as a token through `tokens`, and `selector="[data-redline]"` keeps the pointer on named parts. Pin a row, hold Alt and point at another to see the space between them.

Notifications

Choose what reaches you, and when.

  • CommentsReplies and mentions in threads you follow
  • ReviewsWhen someone asks you to review a file
  • Weekly digestA summary of the week, every Monday
Arrow keys move between elements: up to the parent, down to the first child, left and right to siblings. Enter pins one, and moving on then measures the distance from it. Escape clears.

Click a row to pin it, then hold ⌥ Option and point at another. On a phone, tap two rows.

Dev Handoff

A design tool's handoff mode. `onSelect` fills the panel on the right with the CSS and the Tailwind classes of whatever layer is selected, and it swaps as you move.

Pricing /Pro plan

DesignDev Mode
Pro

$24 / month

For teams that ship every week.

  • Unlimited projects
  • Version history
  • Priority support
Arrow keys move between elements: up to the parent, down to the first child, left and right to siblings. Enter pins one, and moving on then measures the distance from it. Escape clears.

Props

childrenRequired

TypeReact.ReactNode

The layout to measure. Measurements are relative to the Redline box and keep up with resizes and with scrolling inside it.

data-redline

Typestring

Put it on any element inside to name it, for tour steps, for onSelect's name and for the announcement when it's selected.

tour

Type(string | [string, string])[]

Elements to walk through on their own while nobody is pointing, by data-redline name, 2.5s each. A pair of names measures between the two. It loops while on screen, stops when the pointer comes in and picks up 2s after it leaves.

tokens

TypeRecord<number, string>

Names for pixel values, so padding, gap and distance labels read space-4 instead of 16: { 16: "space-4" }. Sizes stay in pixels.

spec

TypebooleanDefaultfalse

Show a card beside text elements with their font, size and line height, weight, letter spacing and color.

selector

TypestringDefault"*"

Which elements can be measured. "[data-redline]" limits it to named elements, like layers in a design tool; the pointer then picks the nearest named element under it.

onSelect

Type(selection: RedlineSelection | null) => void

Called when the selected element changes, with the element, its name, width, height, padding, flex or grid gap, the spacing to its neighbors and, for text, its text style. Called with null when the redlines fade out.

colors

Type{ selection?: string; distance?: string; spacing?: string }Default{ selection: "#0C8CE9", distance: "#F24822", spacing: "#C026D3" }

Colors for the selection box and size pill, the distance lines and their labels, and the padding and gap hatching.

className

Typestring

Classes for the measured area. It takes keyboard focus: arrow keys walk the tree, Enter pins, Esc clears.