Border highlight
A travelling attention beam adapted into a local, token-aware interaction surface.
Live preview
Adjust a setting to update the preview and usage code together.
Usage & source
import type { CSSProperties } from "react";
import { BorderHighlight } from "./components/stepkit/BorderHighlight";
import "./components/stepkit/styles.css";
const themeStyle = {"--stepkit-bg":"#f7f7f8","--stepkit-surface":"#ffffff","--stepkit-surface-muted":"#f0f0f3","--stepkit-fg":"#17181c","--stepkit-muted":"#626572","--stepkit-border":"#e3e4e9","--stepkit-border-strong":"#c8cad3","--stepkit-code":"#f1f1f4","--stepkit-shadow":"0 20px 60px rgba(31, 26, 64, .10)","--stepkit-accent":"#6950df","--stepkit-accent-strong":"#5137c7","--stepkit-accent-soft":"#eeeafd","--stepkit-accent-on-soft":"#5137c7","--stepkit-accent-text":"#ffffff","--stepkit-error":"#b43145","--stepkit-placeholder":"#626572","--stepkit-radius":"16px","--stepkit-space":"16px","--stepkit-control-height":"44px","--stepkit-font-sans":"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif"} as CSSProperties;
export default function Example() {
return (
<div className="stepkit-theme" data-stepkit-preset="modern" style={themeStyle}>
<BorderHighlight
title={"Follow the signal"}
intensity={"subtle"}
paused={false}
/>
</div>
);
}Dependencies
[email protected] [email protected]
/*
* Stepkit 0.2.0
* Copyright (c) 2026 Vladislav Stepanov
*
* Original Stepkit portions in this release are licensed under the MIT License. Adapted portions identify their upstream licence and copyright in the copied source and in `NOTICE-MAGICUI.md` where applicable.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
* # Magic UI MIT licence snapshot
*
* Source: https://github.com/magicuidesign/magicui/blob/main/LICENSE.md
* Repository snapshot reviewed at commit: `bca54ab2730216c91e3a732f2af08e49c7ddebd4`
* Retrieved through Firecrawl: 2026-09-19
*
* MIT License
*
* Copyright (c) Magic UI
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
import type { AnchorHTMLAttributes, CSSProperties } from "react";
import "./styles.css";
/**
* Adapted interaction reference: Magic UI Border Beam, MIT License.
* Copyright (c) Magic UI. Source and licence evidence: provenance/.
* Stepkit uses a local implementation with scoped tokens and no motion dependency.
*/
export type BorderHighlightIntensity = "subtle" | "strong";
export interface BorderHighlightProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "title"> {
title?: string;
intensity?: BorderHighlightIntensity;
paused?: boolean;
size?: number;
duration?: number;
delay?: number;
colorFrom?: string;
colorTo?: string;
reverse?: boolean;
initialOffset?: number;
borderWidth?: number;
}
type BorderHighlightStyle = CSSProperties & Record<`--stepkit-${string}`, string | number>;
function finiteNumber(value: number | undefined, fallback: number, min: number, max: number) {
return Number.isFinite(value) ? Math.min(max, Math.max(min, value as number)) : fallback;
}
export function BorderHighlight({
title = "Move through the interface",
intensity = "subtle",
paused = false,
size = 52,
duration = 6,
delay = 0,
colorFrom = "var(--stepkit-accent, #6950df)",
colorTo = "var(--stepkit-accent-strong, #5137c7)",
reverse = false,
initialOffset = 0,
borderWidth = 1,
className = "",
href = "#highlight",
style,
...props
}: BorderHighlightProps) {
const beamStyle: BorderHighlightStyle = {
"--stepkit-beam-size": `${finiteNumber(size, 52, 12, 180)}px`,
"--stepkit-beam-duration": `${finiteNumber(duration, 6, 1, 30)}`,
"--stepkit-beam-delay": `${finiteNumber(delay, 0, 0, 30)}`,
"--stepkit-beam-start": `${finiteNumber(initialOffset, 0, 0, 100)}%`,
"--stepkit-beam-from": colorFrom,
"--stepkit-beam-to": colorTo,
"--stepkit-beam-width": `${finiteNumber(borderWidth, 1, 1, 4)}px`,
...style,
};
return (
<a
className={`stepkit stepkit-border-highlight${className ? ` ${className}` : ""}`}
data-intensity={intensity}
data-paused={paused}
data-reverse={reverse}
href={href}
style={beamStyle}
{...props}
>
<span className="stepkit-border-highlight__beam" aria-hidden="true" />
<span className="stepkit-border-highlight__title">{title}</span>
<span className="stepkit-border-highlight__hint">focus or hover to follow the beam</span>
</a>
);
}
export default BorderHighlight;
components/BorderHighlight.tsxcomponents/styles.cssInstall
Use the released registry entry or download the complete archive.
npx [email protected] add https://vstepanov.com/stepkit/r/border-highlight.jsonIntegration prompt
Install Stepkit Border highlight 0.2.0 from the registry and preserve the included MIT notice. npx [email protected] add https://vstepanov.com/stepkit/v0.2.0/r/border-highlight.json Install the tested runtime dependencies exactly: npm install [email protected] [email protected] Keep the component source, shared styles, NOTICE.md, and provenance files together. Apply the theme tokens on a wrapper rather than passing theme keys as component props. Usage: ```tsx import type { CSSProperties } from "react"; import { BorderHighlight } from "./components/stepkit/BorderHighlight"; import "./components/stepkit/styles.css"; const themeStyle = {"--stepkit-bg":"#f7f7f8","--stepkit-surface":"#ffffff","--stepkit-surface-muted":"#f0f0f3","--stepkit-fg":"#17181c","--stepkit-muted":"#626572","--stepkit-border":"#e3e4e9","--stepkit-border-strong":"#c8cad3","--stepkit-code":"#f1f1f4","--stepkit-shadow":"0 20px 60px rgba(31, 26, 64, .10)","--stepkit-accent":"#6950df","--stepkit-accent-strong":"#5137c7","--stepkit-accent-soft":"#eeeafd","--stepkit-accent-on-soft":"#5137c7","--stepkit-accent-text":"#ffffff","--stepkit-error":"#b43145","--stepkit-placeholder":"#626572","--stepkit-radius":"16px","--stepkit-space":"16px","--stepkit-control-height":"44px","--stepkit-font-sans":"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif"} as CSSProperties; export default function Example() { return ( <div className="stepkit-theme" data-stepkit-preset="modern" style={themeStyle}> <BorderHighlight title={"Follow the signal"} intensity={"subtle"} paused={false} /> </div> ); } ``` Selected bounded settings: {"title":"Follow the signal","intensity":"subtle","paused":false}. Selected theme: {"mode":"light","accent":"violet","radius":"soft","density":"comfortable","preset":"modern"}.
Props
| Name | Type | Default | Description |
|---|---|---|---|
size | number | 52 | Beam diameter in pixels. |
duration | number | 6 | Travel duration in seconds. |
paused | boolean | false | Freezes the beam. |
href | string | "#highlight" | Anchor destination. |
Accessibility & limits
- Uses a native anchor and visible focus state.
- Paused and reduced-motion states stop the travelling beam.
Limitations
- The visual effect is decorative and does not communicate state alone.
Provenance
Adapted source under the MIT licence.
Upstream: Magic UI Border Beam
Required notices: NOTICE.md, PROVENANCE-stepkit-border-highlight.md, NOTICE-MAGICUI.md
- 2 source files in the release
- Version 0.2.0