EdgeGlow
HkEdgeGlow is the library's one edge-glow painter: a feathered gradient band laid along one or more edges of its positioned parent. Scroll surfaces use it to say that content still hides past an edge; anything else that clips — a chart, a carousel, a fixed header — can mount it directly instead of re-authoring the same pseudo-element recipe.
- The band inside a scroll region is normally mounted for you: HkScrollContainer paints it for fade and overflowGlow.
- This is not a scrim: the band hugs an edge and fades inward, it never dims or frosts the whole surface, so an overlay in front of everything is a different component.
- A hairline that separates two blocks rather than dissolving an edge is a rule, not a band — use HkDivider.
Import
;
This page documents the Vue implementation only: packages/components/src ships no Rust edge glow, so every example below is TSX.
Edges
edges takes physical sides — top, bottom, left, right — never logical inline or block ones. That is deliberate: the consumers that need a painter are scroll affordances, and the scroll container already resolves the writing direction itself and maps its sensed inline start and end onto the physical side in the same pass it derives the bands, so a logical edge here would make the component disagree with the geometry it paints.
The default lights the reading flow's two horizontal edges (top and bottom). Bands render in the canonical top, bottom, left, right order whatever order the caller lists, so the DOM is stable across renders. An empty array mounts the inert root with no bands, which is what lets a feature toggle its band without mounting and unmounting the painter.
The root is position: absolute; inset: 0, so the host must be positioned. Mount it as the last child of that positioned ancestor — typically after the scrolling viewport — so it paints above the content.
Size, feather and colour
size is the band's thickness measured from the edge inward and feather is how far the band's two inline ends dissolve; both default to the shared --space-24 token, and feather: "0" restores hard band ends. color is the gradient's ink at the edge — it fades to transparent inward — and defaults to the primary token at 32%, the weight the settings rail ships.
Every knob is a plain string in CSS value space, so the usual form is a consumer's own variable with the library value as its fallback: a host sets var(--my-glow-size, var(--space-24)) and themes the band from anywhere up the tree. The end feather is a mask rather than a second gradient, which keeps the geometry exact on engines without mask composition.
Animating and stacking
animate adds the shared breathe — opacity swinging between 0.62 and 1 and back over 2.6 seconds, an infinite CSS loop. It stays off by default on purpose: a static band is a state hint ("the selected row is beyond this edge"), and a hint that pulses draws attention to the wrong thing; an animated band is ambient chrome ("there is more content past this edge while the strip is scrolling").
The painter is decoration only: it is aria-hidden, pointer-events: none, holds no focusable content and has no layout of its own. Its z-index: 2 keeps it under the overlay scrollbar chrome (10) and the jump-back button (11) that must stay interactive, and the loop is registered with the host's animation bus, so a global animation switch pauses it, as does prefers-reduced-motion: reduce.
API
Vue
Props
| Name | Type | Default | Required |
|---|---|---|---|
| edges | Array as PropType<EdgeGlowEdge[]> | () => ["top", "bottom"] as EdgeGlowEdge[] | — |
| animate | Boolean | false | — |
| size | String | "var(--space-24)" | — |
| feather | String | "var(--space-24)" | — |
| color | String | "rgb(var(--color-primary) / 32%)" | — |
Accessibility
- The painter is aria-hidden="true" in its own markup, so it contributes nothing to the accessibility tree: no name, no role, no announcement. A screen-reader user is never told that content hides past an edge.
- That means the information the glow conveys visually has no accessible twin. If "there is more" matters to a keyboard or screen-reader user, the scroll region's own aria surface is the place to carry it — a named region from HkScrollContainer, or a status line the host renders.
- pointer-events: none keeps the band from swallowing clicks on whatever it overlaps, so an edge band never becomes a dead zone for the content beneath it.
- The breathe loop is disabled under prefers-reduced-motion: reduce and by the host's global animation switch; the static default never moves.
Related components
- HkScrollContainer — mounts this painter for the fade, the selection hint and the overflow glow.
- HkScrollPin — the other edge affordance: content that stays instead of dissolving.
- HkDivider — the hairline rule, for a hard separation.
- HkCard — the bordered surface a clipped frame usually sits in.