Border Glow

Card chrome with a pointer-directed border, optional soft bloom, and a hairline trace mode.

Installation

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

Add border-glow (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add border-glow

Default

Dark card with kit defaults, including bloom true: edgeSensitivity 0, glowRadius 15, glowIntensity 0.8, coneSpread 5, animated false, background neutral-920.

Hover near the edges

Dark card (neutral-920) with bloom and a directional mesh. Move close to the border to see it follow the pointer.

Light

variant light: soft white face with a tinted mesh glow. Remains subtle white under a dark preview surface.

Light card

Soft white face with a tinted edge glow. Stays a subtle white when the preview is dark; the colored glow still tracks the pointer.

Hairline trace

trace: single-ink or spectrum hairline outside the card, no bloom. Expands from the pointer on hover and follows it around the ring.

Hairline trace

Hidden until hover. The hairline expands from the pointer and follows it around the ring.

Configured

Props written out to match the default configuration, including bloom true (border radius omitted; uses the theme radius token).

Explicit defaults

Same values as the kit defaults, passed as props for reference.

Properties

Card chrome with a pointer-directed border. Use bloom for the soft mesh glow, or trace for the outer hairline.

BorderGlow

Shared card chrome and layout.

PropTypeDefaultNotes
childrenReactNode-Content rendered inside the card.
classNamestring-Additional classes on the outer wrapper.
variant"default" | "light""default"default uses the dark face (neutral-920). light uses a soft white face and tinted mesh, and stays subtle white under .dark.
backgroundColorstringvariant tokenCard face fill. Omit to use --df-border-glow-bg or --df-border-glow-light-bg.
strokeColorstringvariant stroke tokenIdle CSS border color. Omit to use --df-border-glow-stroke or --df-border-glow-light-stroke.
borderRadiusnumber-Corner radius in pixels. Omit to use --df-border-glow-radius.
cornerShape"round" | "smooth"-Instance corner curve. Omit to inherit --df-corner-shape from the theme (set at create/init).

Bloom

Soft outer glow and directional mesh. Ignored when trace is true.

PropTypeDefaultNotes
bloombooleantrueSoft outer bloom around the card. Set false to disable bloom (inner wash defaults to 0). Ignored when trace is true.
glowColorstringvar(--df-border-glow-ink-base) or light ink tokenSoft outer glow source when bloom is true. Prefer a CSS color. HSL channels as "H S L" still work. In trace mode, used as the single hairline ink when colors is omitted.
glowRadiusnumbervar(--df-border-glow-glow-radius)How far the soft outer bloom extends beyond the card in pixels. Omit to use --df-border-glow-glow-radius.
glowIntensitynumber0.8Multiplier for bloom opacity (0.1 to 3).
edgeSensitivitynumber0How close the pointer must be to the edge for the glow to appear (0 to 100). Lower values light the edge sooner.
coneSpreadnumber5Width of the directional cone mask as a percentage (5 to 45).
colorsstring[]variant mesh tokensThree colors for the mesh gradient border. Defaults to --df-border-glow-color-* or --df-border-glow-light-color-*.
fillOpacitynumber0.5 when bloom; 0 when bloom is falseStrength of the near-edge mesh fill inside the card (0 to 1).
animatedbooleanfalsePlay an intro cone sweep on mount.

Trace

Hairline-only animation. Forces bloom off and no face wash. The arc expands from zero at the pointer, then follows it.

PropTypeDefaultNotes
tracebooleanfalseEnable hairline trace mode. Paints only the outer hairline (masked to the border, never the face).
glowColorstringvar(--df-neutral-1000)Single hairline ink when colors is omitted.
colorsstring[]glowColor as one stopUp to four colors along the expanding hairline arc. Pass DEFAULT_SPECTRUM_COLORS from SpectrumText for the kit spectrum.
coneSpreadnumber20Max lit arc length. Higher values make a longer hairline segment.
outlineOffsetnumbervar(--df-border-glow-trace-outline-offset)Gap in pixels between the card edge and the outer hairline. Omit in trace mode to use --df-border-glow-trace-outline-offset.
outlineWidthnumbervar(--df-border-glow-outline-width)Thickness in pixels of the outer hairline. Omit to use --df-border-glow-outline-width.
followDurationnumber0.5Seconds for the lit arc to ease toward the pointer. Lower is snappier; higher is smoother.
revealDurationnumber0.7Seconds for the hairline to expand from zero on enter and collapse on leave. Uses a quint ease-out.
arcFadenumber0.75How soft the ends of the lit arc are (0 to 1). Higher fades out earlier and more gradually.

Tokens

Theme defaults live on :root. Override these globally or on a local host.

TokenTypeDefaultNotes
--df-border-glow-bgCSS colorvar(--df-neutral-920)Default (dark) card face.
--df-border-glow-strokeCSS colorcolor-mix(in oklch, var(--df-neutral-0) 15%, transparent)Idle CSS border color on the default card.
--df-border-glow-radiuslengthvar(--radius-4xl)Default corner radius when borderRadius is omitted.
--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-border-glow-edge-sensitivitynumber0Theme default for edgeSensitivity (0 to 100).
--df-border-glow-glow-radiuslengthcalc(3.75 * var(--spacing-unit))Theme default for glowRadius.
--df-border-glow-outline-offsetlengthcalc(0.5 * var(--spacing-unit))Gap between the card edge and the outer outline when bloom is off.
--df-border-glow-trace-outline-offsetlengthcalc(3 * var(--spacing-unit))Gap between the card edge and the outer hairline in trace mode.
--df-border-glow-outline-widthlengthvar(--border-width-hairline)Thickness of the outer hairline in trace mode.
--df-border-glow-trace-follownumber0.5Theme default for followDuration in seconds.
--df-border-glow-trace-revealnumber0.7Theme default for revealDuration in seconds.
--df-border-glow-trace-fadenumber0.75Theme default for arcFade (0 to 1).
--df-border-glow-cone-spreadnumber5Theme default for coneSpread in bloom modes.
--df-border-glow-glow-intensitynumber0.8Theme default for glowIntensity.
--df-border-glow-fill-opacitynumber0.5Theme default for fillOpacity on the default variant.
--df-border-glow-ink-baseCSS colorvar(--df-neutral-100)Default soft outer glow source color.
--df-border-glow-color-1CSS colorvar(--df-orange-80)Default mesh stop 1.
--df-border-glow-color-2CSS colorvar(--df-orange-180)Default mesh stop 2.
--df-border-glow-color-3CSS colorvar(--df-blue-320)Default mesh stop 3.
--df-border-glow-light-bgCSS colorvar(--df-neutral-0)Light variant face. Soft white under .dark (neutral-50).
--df-border-glow-light-strokeCSS colorcolor-mix(in oklch, var(--df-neutral-1000) 8%, transparent)Idle CSS border color on the light variant.
--df-border-glow-light-ink-baseCSS colorvar(--df-orange-340)Light variant soft outer glow source color.
--df-border-glow-light-color-1CSS colorvar(--df-orange-80)Light variant mesh stop 1.
--df-border-glow-light-color-2CSS colorvar(--df-orange-420)Light variant mesh stop 2.
--df-border-glow-light-color-3CSS colorvar(--code-dark-keyword)Light variant mesh stop 3.