Selection frame
A drawing-tool frame around selected text or the control being addressed.
Specimen
Dimensions are drawn the way a technical sheet draws them: an extension line springing off each edge, a dimension line running between them terminated by 45-degree ticks, and the value breaking the line in the middle rather than floating beside it. Every rule is roughened by the same edge filter as the rest of the system; the values are not, because displacement smears glyphs.
Props
| Prop | Type | Note |
|---|---|---|
| — | none | Mounted once in the root layout. It tracks the document's own selection, and the store every actionable primitive publishes to. |
Use it for
- Nothing to wire up: it is global, and reads the browser's selection and the shared highlight store directly.
- Tune the box through --frame-line, --frame-line-hover, --frame-handle, --frame-handle-fill, --frame-label and --frame-z.
- Tune the dimensions through --dimension-line, --dimension-gap, --dimension-offset and --dimension-tick.
- Tune the travel through --frame-travel and --frame-travel-ease, and the exit through --frame-fade. GSAP reads the first two, CSS the third.
Do not use it for
- Giving it pointer events. It sits over text the reader is mid-drag on, and over every control on the page, and must never intercept either.
- Drawing the whole frame at hover. Hover happens on every sweep across the navigation; if it arrives fully drawn there is nothing left for press or focus to say, and the page reads as flashing.
- Treating it as the focus indicator. It is decorative and hidden from assistive technology — --focus-ring is still what marks focus.
- Drawing the full dimension apparatus around a single line, or around a control. The figures are worth having at any size, but the rules that carry them are a lot of drawing around very little.
- Easing it behind a text selection. It travels between controls, but it follows a live drag exactly — a frame catching up with the words being selected reads as lag, not grace.
- Writing --frame-x/y/w/h from anywhere but useFrameMotion. A tween writes them every frame, and a second writer would be fighting it.