Skip to content

Shine Border

A sheen that travels around an element's border, to point at the one thing on a screen you most want chosen. CSS only, painted on the border ring, so the content is untouched.

On this page
Used for
  • Selected plan card
  • Agent working on a card
  • Focus on a prompt box
  • Featured item

Examples

Upgrade card

Mode
Width
Colours

Installation

npx knowns-ui@latest add shine-border
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

mode
"continuous" | "hover" | "once"
Default"hover"
Loop; run while the host is hovered or holds focus; or one lap on mount, then fade to rest.
width
1 | 2 | 3
Default1
Ring width in px.
duration
number
Default6 / 1.6
Seconds per lap (1.6 for once).
colors
string[]
DefaultSHINE_ACCENT
1 to 3 CSS colours. SHINE_ACCENT is our indigo (override with --kn-shine); SHINE_AGENTS uses three agent colours.
arc / intensity
number / number
Default100 / 1
Length of the sheen in degrees, and its strength from 0 to 1.
rest
number
Default0
Opacity kept at rest in hover mode and after a once lap. 0 leaves only the host's own border.
hostBorder
number
Default1
The host's border width, which the ring sits on. Use 0 when the host has overflow hidden, so the ring is drawn just inside.
replayKey / paused
string | number / boolean
Change replayKey to run a once lap again; paused holds the sheen still.

Put it inside an element with position relative: it takes that element's corner radius. It pauses offscreen and in background tabs. With reduced motion, or in browsers without @property, it is a still gradient border. It is decorative and hidden from screen readers, so say the reason in text too, like "Recommended".

What it handles

  1. 01Sends a band of light around the edge of its host in one of three modes: hover, continuous or once.
  2. 02Runs in `hover` mode only while the host is hovered or focused, and in `once` mode makes one lap on mount and then fades.
  3. 03Sets the ring thickness with `width` of 1, 2 or 3px and the lap time with `duration` in seconds.
  4. 04Colours the band with `colors`, either SHINE_ACCENT, SHINE_AGENTS or one to three of your own, with `arc` for its length and `intensity` for its strength.
  5. 05Keeps a faint ring at rest with `rest`, replays a once lap when `replayKey` changes, and stops with `paused`.
  6. 06Pauses while it is off screen, and falls back to a still ring where the browser cannot animate a registered custom property.

States

First render
Hover and continuous paint the ring; once starts its lap
none
Hover or focus on the host
The ring fades in to full strength
180ms, ease out
Lap
The band travels around the border
none
Pointer leaves
The ring fades back to its rest opacity
180ms, ease out
Reduced motion
A still ring replaces the moving band
0ms

Works with

When to use

When to use

  • The one option you most want chosen: the featured plan, the recommended model, an upgrade card.
  • A brief nod after something changes, with mode once: a lap, then it settles.

When not to use

  • Every card on a page: keep it to one emphasis per view.
  • Showing a state such as running or failed: use Status Dot.
  • Focus rings: keyboard focus needs a steady, high-contrast outline.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Shine Border to my app and wire it to my own data.
  • I need the one option you most want chosen: the featured plan, the recommended model, an upgrade card. Set that up with the Knowns UI Shine Border.
  • Which Shine Border props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "shine-border" }) and search_docs({ query: "shine border" }).

Need help?

Stuck on Shine Border, or found something off? We read every message.