Selection Frame
That box Figma draws around a selected frame - corner handles and a crisp accent stroke. Wrap it around a text span or any div to call it out. Square or circle handles, solid, dashed, or long-dashed lines, static or marching-ants animated. It measures its child, so it always fits.
Installation
npx stepwise-ui add selection-frame
Default
Handles
Lines
dashed and long are tuned dash presets; pass dash to override either one's pattern directly.
Animated
Dashed and long lines march; a solid line has no dash pattern to march, so animated only affects the corner handles' entrance for it. Leave animated off for a fully static frame.
Usage
Inline by default, so it drops straight into a headline or a sentence - the classic "circle the one word that matters" move. Pass inline={false} to wrap a block-level element like a card or an image instead.
Props
PropTypeDescription
childrenReact.ReactNodeThe content to frame - it is measured live.
handles"square" | "circle"Corner handle shape. Default "square".
line"solid" | "dashed" | "long"Stroke style. Default "solid".
dash[number, number]Overrides the [dash, gap] px pair "dashed"/"long" resolve to.
animatedbooleanMarching ants for "dashed"/"long". Corner handles always animate in. Default false.
colorstringAccent color. Default Figma blue (#0d99ff).
radiusnumberFrame corner radius. Default 0.
paddingnumberGap between content and frame. Default 4.
inlinebooleanInline (text spans) vs block. Default true.