Overlay Hint

On-canvas instruction or status pill with frosted, muted, and marquee variants.

Also known as: instruction chip, hint pill, canvas hint, marquee hint

Installation

Install with the CLI, or copy the component source into your project.

Add overlay-hint (npm)

npx --yes -p @default-file/ui df-ui add overlay-hint

Default

Frosted glass for tool canvases. Toggle the preview surface to switch between light and dark. Same recipe, inverted chrome.

Live previewAutosaved

Muted

Solid muted surface chip for light tool headers and stages (Color Lab, Design Extractor). Separate from frosted glass.

Slate11 stops

Single label

Pass children for a one-line hint. Prefer parts when you need a separator between segments.

Press Esc to close the panel

Custom separator

Replace the middle dot with a glyph, icon, or custom divider. Use OVERLAY_HINT_SEPARATOR for the stock dot.

Live previewAutosaved
Live previewAutosaved
Live previewAutosaved

Leading and trailing

Optional leading and trailing slots for icons or custom nodes.

Snap to gridOn

Muted with slots

Leading and trailing work the same on the muted variant.

Drop a screenshotExtract tokens

Radius and chrome

Tune corner radius, fill, border, label, shadow, and blur with props or --overlay-hint-* CSS variables.

Live previewAutosaved
Custom fillCustom border
TokenizedChrome

Marquee

Scrolling label with a trailing kit icon-only Button. Hover does not pause the loop. By default the whole chip is clickable (clickTarget chip). Docs demos toast on click instead of navigating away.

Marquee dark

Pass scheme="dark" for the dark marquee recipe on dark canvases.

Marquee click target

clickTarget chip makes the whole hint the hit target. action limits clicks to the trailing control only. Each demo toasts so you can tell which target fired.

Only the arrow button is clickable

Marquee size

size controls marquee density. sm is compact for marketing chrome; md is the default catalogue size.

Marquee width

marqueeWidth sets the visible scrolling viewport. Pass any CSS length; theme default is 12rem.

Radius

Three chip radii that read apart: none, md, and full. The trailing control stays a kit icon-only Button.

Marquee speed

speed is the loop duration in seconds. Smaller values scroll faster.

Faster loop at speed 8
Slower loop at speed 24

Properties

Instruction or status pill for tool chrome. Default is frosted glass that follows light and dark surfaces. Muted is a solid chip. Marquee scrolls the label with an optional trailing icon action and sm or md density. Label ink is optically centered to cap height with text-box when available, and a 1cap line box otherwise. Chrome is tokenized via --overlay-hint-*.

OverlayHint

PropTypeDefaultNotes
variant"default" | "muted" | "marquee""default"default frosted glass that adapts under a .dark surface. muted solid surface chip. marquee scrolling label with an optional trailing icon action.
scheme"light" | "dark"-Explicit light or dark recipe for marquee. When omitted, marquee follows a .dark ancestor like default.
speednumber18Marquee loop duration in seconds. Smaller values scroll faster. Sets --overlay-hint-marquee-duration.
marqueeWidthstring-Visible marquee viewport width. Any CSS length such as 10rem or 14rem. Theme default is 12rem. Sets --overlay-hint-marquee-width.
clickTarget"chip" | "action""chip"Marquee hit target. chip makes the whole hint clickable; the trailing icon is decorative. action limits clicks to the trailing control only.
size"sm" | "md""md"Marquee density only. md is the default chip. sm tightens padding, uses text-11 type, and shrinks the trailing control for compact tool chrome. Ignored on default and muted.
actionReactNode-Icon for the trailing marquee control. Renders as a kit icon-only Button (size icon-xs, variant secondary). Decorative when clickTarget is chip. Interactive when clickTarget is action.
actionLabelstring-Accessible name for the interactive control (whole chip or trailing action).
onActionMouseEventHandler<HTMLElement>-Click handler when the interactive control renders as a button.
actionHrefstring-When set, the interactive control renders as a link instead of a button.
radius"none" | "md" | "full""md"Corner radius for the hint chip: none square, md soft, full pill. Three steps kept distinct. Trailing marquee control uses the Button radius. Maps to --overlay-hint-radius.
cornerShape"round" | "smooth"-Instance corner curve. Omit to inherit --df-corner-shape from the theme (set at create/init).
backgroundstring-Background color. Prefer tokens such as var(--df-neutral-900). Sets --overlay-hint-bg.
borderColorstring-Border color. Prefer tokens such as var(--border). Sets --overlay-hint-border.
foregroundstring-Label color. Prefer tokens such as var(--muted-foreground). Sets --overlay-hint-fg.
shadowstring-Box shadow. Prefer tokens such as var(--overlay-shadow) or none. Sets --overlay-hint-shadow.
blurstring-Backdrop blur length. Prefer tokens such as var(--overlay-blur) or 0px. Sets --overlay-hint-blur.
partsReactNode[]-Label segments joined by separator. Prefer this for multi part hints. When set, children is ignored.
separatorReactNodeOVERLAY_HINT_SEPARATOR (·)Node between parts. Defaults to the middle dot constant. Pass a glyph, icon, or custom divider. Set null to omit.
childrenReactNode-Single label hint. Use parts instead when you need a separator between segments.
leadingReactNode-Optional icon, swatch, or node before the label.
trailingReactNode-Optional icon or node after the label.
classNamestring-Additional styles. On dark canvases without a .dark ancestor, pass className="dark" so default frosted uses the dark recipe.
styleCSSProperties-Inline styles. Override --overlay-hint-bg, --overlay-hint-border, --overlay-hint-fg, --overlay-hint-shadow, --overlay-hint-blur, or --overlay-hint-radius directly.

Exports

Named exports from the Overlay Hint module: OverlayHint component; OVERLAY_HINT_SEPARATOR middle-dot constant; OverlayHintSize (sm | md); OverlayHintClickTarget (chip | action).

Tokens

Theme defaults live on :root. Override these globally or set the instance vars via props or style.

TokenTypeDefaultNotes
--overlay-hint-radiusCSS lengthvar(--radius-md)Corner radius used by the hint.
--df-corner-shapeCSS corner-shapevar(--df-corner-shape-round)Theme corner curve for all kit chrome. round = circular arcs; smooth = continuous squircle. Set with df-ui init --corner-shape, or override on :root. Default round.
--df-label-line-heightCSS line-heightvar(--df-leading-none)Line box for label flex centering. Defaults to --df-leading-none. When text-box is unavailable and the cap unit is supported, the kit sets this to 1cap so flex centering matches cap-height ink.
--overlay-hint-bgCSS color-Resolved fill for the active surface.
--overlay-hint-borderCSS color-Resolved border color.
--overlay-hint-fgCSS color-Resolved label color.
--overlay-hint-shadowCSS shadow-Resolved box shadow.
--overlay-hint-blurCSS length-Resolved backdrop blur.
--overlay-hint-default-bgCSS colorcolor-mix(in oklch, white 78%, transparent)Default frosted fill on light surfaces.
--overlay-hint-default-borderCSS colorcolor-mix(in oklch, black 10%, transparent)Default frosted border on light surfaces.
--overlay-hint-default-fgCSS colorcolor-mix(in oklch, black 72%, transparent)Default frosted label on light surfaces.
--overlay-hint-default-shadowCSS shadow0 10px 28px color-mix(in oklch, black var(--df-shadow-intensity-md), transparent)Default frosted shadow on light surfaces.
--overlay-hint-default-blurCSS lengthvar(--overlay-blur)Default frosted blur on light surfaces.
--overlay-hint-default-dark-bgCSS colorvar(--overlay-bg)Default frosted fill on .dark surfaces.
--overlay-hint-default-dark-borderCSS colorvar(--overlay-border)Default frosted border on .dark surfaces.
--overlay-hint-default-dark-fgCSS colorvar(--overlay-item-fg)Default frosted label on .dark surfaces.
--overlay-hint-default-dark-shadowCSS shadowvar(--overlay-shadow)Default frosted shadow on .dark surfaces.
--overlay-hint-default-dark-blurCSS lengthvar(--overlay-blur)Default frosted blur on .dark surfaces.
--overlay-hint-muted-bgCSS colorvar(--muted)Muted variant fill.
--overlay-hint-muted-borderCSS colorvar(--border)Muted variant border.
--overlay-hint-muted-fgCSS colorvar(--muted-foreground)Muted variant label.
--overlay-hint-muted-shadowCSS shadownoneMuted variant shadow.
--overlay-hint-muted-blurCSS length0pxMuted variant blur.
--overlay-hint-marquee-durationCSS time18sOne full marquee loop duration.
--overlay-hint-marquee-widthCSS length12remVisible marquee viewport width.
--overlay-hint-marquee-bgCSS colorcolor-mix(in oklch, white 88%, transparent)Marquee fill on light surfaces.
--overlay-hint-marquee-dark-bgCSS colorvar(--overlay-bg)Marquee fill on dark surfaces.
--overlay-hint-marquee-gapCSS lengthcalc(4 * var(--spacing-unit))Gap between repeated marquee label segments.
--overlay-hint-marquee-fadeCSS length0.75remSoft edge fade depth for the scrolling label, on both sides.