Skip to content

Inspect

Real components seen like a selection in a design tool: tilted on a dark stage, a cursor measuring one part at a time live from the DOM, padding, gap, size and a guide. Three subjects on one stage.

On this page
Used for
  • The hero or a feature section of a developer product
  • A pair beside a headline, one mirrored, taking turns
  • A still frame for launch posts and social images
  • Design reviews

Examples

Approval

Composer

Agent card

Beside a headline

Two of them, one each side: mirror tilts the left one the other way and delay holds one back, so the cursors take turns.

Measure your own UI

The overlay ships with the item. Mark the parts of your own component with data-inspect="Name" and wrap it in InspectMeasure: every number comes from the browser, so it stays right when your styles change.

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

subject / defaultSubject
"approval" | "composer" | "agent-card"
Default"approval"
The subject on the stage, controlled or not. A new subject crossfades in and starts on its first part.
onSubjectChange
(subject) => void
Called when the visitor picks a subject.
subjects
InspectSubject[]
Defaultall three
The subjects on the switch above the stage. One hides the switch.
autoplay
boolean
Defaultfalse
Each subject moves through its own states every 3s while on screen, until the visitor interacts.
links
Partial<Record<InspectSubject, { href, label }>>
A link under the stage per subject.
mirror, delay, still, narrowBelow
see InspectMeasure
Passed to every subject's overlay.
className
string
On the wrapper.
...ApprovalPromptProps
ApprovalPromptProps
Defaulta demo request
Passed to the real Approval Prompt: approvals, actors, onDecision and the rest. A state's props win over these.
states
{ id, label, props, parts?, measureHold? }[]
Defaultthe subject's three
The switch under the stage. Each state drives the real component through `props` and names the parts to measure. [] hides the switch.
value / defaultValue
string
Defaultthe first state
The state shown, controlled or not.
onValueChange
(id: string) => void
Called when the visitor or autoplay picks a state.
autoplay
boolean
Defaultfalse
Moves to the next state every 3s while on screen. Stops for good on hover, focus or a pick; off under reduced motion.
parts
MeasurePart[]
Defaultthe subject's parts
Replace the parts the cursor visits in every state.
mirror, delay, still, narrowBelow, link
see InspectMeasure
Passed to the overlay.
label
string
Defaultset
Names the figure for screen readers.
className
string
On the wrapper.
...ChatComposerProps
Partial<ChatComposerProps>
Passed to the real Chat Composer: models, mode, onModeChange, onSubmit and the rest. The text comes from the state, so its own value props are not taken.
states
{ id, label, props, parts?, measureHold? }[]
Defaultthe subject's three
The switch under the stage. Each state drives the real component through `props` and names the parts to measure. [] hides the switch.
value / defaultValue
string
Defaultthe first state
The state shown, controlled or not.
onValueChange
(id: string) => void
Called when the visitor or autoplay picks a state.
autoplay
boolean
Defaultfalse
Moves to the next state every 3s while on screen. Stops for good on hover, focus or a pick; off under reduced motion.
parts
MeasurePart[]
Defaultthe subject's parts
Replace the parts the cursor visits in every state.
mirror, delay, still, narrowBelow, link
see InspectMeasure
Passed to the overlay.
label
string
Defaultset
Names the figure for screen readers.
className
string
On the wrapper.
actor
Actor
Defaulta researcher agent
The agent or tool the card is about.
state
ActorState
Default"busy"
Its state; the summary word takes the state colour.
recent
Span[]
Defaultthree calls
Newest first: who it called or was called by, with the time per call.
peers
Actor[]
Defaultthree
The other end of each call.
spansPerMinute
number
Default6
Calls in the last minute.
onClose
() => void
The card's close button.
states
{ id, label, props, parts?, measureHold? }[]
Defaultthe subject's three
The switch under the stage. Each state drives the real component through `props` and names the parts to measure. [] hides the switch.
value / defaultValue
string
Defaultthe first state
The state shown, controlled or not.
onValueChange
(id: string) => void
Called when the visitor or autoplay picks a state.
autoplay
boolean
Defaultfalse
Moves to the next state every 3s while on screen. Stops for good on hover, focus or a pick; off under reduced motion.
parts
MeasurePart[]
Defaultthe subject's parts
Replace the parts the cursor visits in every state.
mirror, delay, still, narrowBelow, link
see InspectMeasure
Passed to the overlay.
label
string
Defaultset
Names the figure for screen readers.
className
string
On the wrapper.
parts
{ target, name }[]
What to measure, in the order the cursor visits. `target` is a selector, a ref or `(root) => Element`; `name` is the layer tag. Elements inside marked data-inspect="Name" are added after them.
children
ReactNode
The real component.
before, after
ReactNode
The neighbouring items, shown faded around it (inert, hidden from screen readers).
hold
number
Default0
The part measured at rest, in a still frame and under reduced motion.
autoplay
boolean
Defaulttrue
The cursor tours the parts while on screen, until the visitor points, taps or uses the keys.
tilt
boolean
Defaulttrue
The 3D tilt. Always off under `narrowBelow`.
stack
boolean
Defaulttrue
Show `before` and `after`.
mirror
boolean
Defaultfalse
Tilt the other way, for the left one of a pair.
delay
number
Default0
Wait this long (ms) after first view before the cursor moves, so a pair takes turns.
still
boolean
Defaultfalse
A still frame for posts and social images: the held part measured, no tour.
narrowBelow
number
Default640
Under this container width: no tilt, no neighbours, a tap measures.
label
string
Names the figure; the measured part is read out as text too.
controls, link
ReactNode, { href, label }
Under the stage: a switch on the left, a link on the right.

Accessibility

  • The stage is a figure named by `label` and takes focus: the arrow keys move between parts, and the measured part is read out as text (its size, padding and gap), politely when the visitor moves.
  • The component inside keeps its own roles, names and keyboard. Nothing in the overlay takes a pointer, so every control under it still works.
  • The neighbouring items are inert and hidden from screen readers.
  • The cursor tour stops on the first interaction, and reduced motion shows one part measured, still.

What it handles

  1. 01Renders the real component, live: every button and field inside still works.
  2. 02Tilts it on a dark stage between whole neighbouring items, the row in focus sharp and the rest fading, so it reads as a list seen in a design tool.
  3. 03Measures one part at a time live from the DOM: a selection with corner handles, padding as hatched bands with px badges, the gap to the next part (red at 0), a layer tag, the size (W Fill or Hug, in px) and a dashed guide down the rows.
  4. 04Places every badge where it covers neither the part's text, its neighbours nor another badge, and keeps them inside the stage on a narrow screen.
  5. 05Tours the parts with a cursor while on screen, whole rows first; pointing, tapping or the arrow keys take over.
  6. 06Measures your own UI too: mark parts with data-inspect="Name".

States

First render
The held part is measured, still
none
Cursor moves
The cursor, the focus and the frame glide to the next part together; padding, gap and guides crossfade
240 to 600ms by distance, ease in and out; details 120ms
The visitor points, taps or uses the keys
The tour stops; the frame glides to that part, and a badge that changes side fades across
280ms, ease in and out; badges 120ms out, 120ms in
Subject switch
The stage crossfades to the other subject, which starts on its first part
120ms
State switch
The component takes the new state's props; the overlay crossfades to that state's held part
120ms
Autoplay states (on)
The next state every 3s while on screen, until the visitor points, focuses or picks
3s per state
Under 640px
No tilt and no neighbours; a tap measures a part; badges stay inside the stage
none
Still
The held part measured, no tour
none
Reduced motion
One part measured, no cursor tour; every change snaps
0ms

Works with

When to use

When to use

  • A hero or feature section that shows the craft in real components: padding, gaps and sizes measured live, like a design tool.
  • A launch post or social image: a still frame with one part measured.
  • Measuring your own UI with the same overlay and data-inspect, in a design review.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Inspect to my app and wire it to my own data.
  • I need a hero or feature section that shows the craft in real components: padding, gaps and sizes measured live, like a design tool. Set that up with the Knowns UI Inspect.
  • Which Inspect props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "inspect" }) and search_docs({ query: "inspect" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Inspect, or found something off? We read every message.