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
- Selected plan card
- Agent working on a card
- Focus on a prompt box
- Featured item
Examples
Recommended model
Upgrade card
Installation
npx knowns-ui@latest add shine-borderPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Shine Border from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/shine-border
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add shine-border
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/illustrations/illust-utils.ts
- components/ui/knowns/illustrations/use-in-view.ts
- components/ui/knowns/shine-border.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/shine-border, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "shine-border" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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- Default
1 - Ring width in px.
- duration
number- Default
6 / 1.6 - Seconds per lap (1.6 for once).
- colors
string[]- Default
SHINE_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- Default
100 / 1 - Length of the sheen in degrees, and its strength from 0 to 1.
- rest
number- Default
0 - Opacity kept at rest in hover mode and after a once lap. 0 leaves only the host's own border.
- hostBorder
number- Default
1 - 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| mode | "continuous" | "hover" | "once" | "hover" | Loop; run while the host is hovered or holds focus; or one lap on mount, then fade to rest. |
| width | 1 | 2 | 3 | 1 | Ring width in px. |
| duration | number | 6 / 1.6 | Seconds per lap (1.6 for once). |
| colors | string[] | SHINE_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 | 100 / 1 | Length of the sheen in degrees, and its strength from 0 to 1. |
| rest | number | 0 | Opacity kept at rest in hover mode and after a once lap. 0 leaves only the host's own border. |
| hostBorder | number | 1 | 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
- 01Sends a band of light around the edge of its host in one of three modes: hover, continuous or once.
- 02Runs in `hover` mode only while the host is hovered or focused, and in `once` mode makes one lap on mount and then fades.
- 03Sets the ring thickness with `width` of 1, 2 or 3px and the lap time with `duration` in seconds.
- 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.
- 05Keeps a faint ring at rest with `rest`, replays a once lap when `replayKey` changes, and stops with `paused`.
- 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
| State | What moves | Timing |
|---|---|---|
| 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" }).