Specular Button
Pairs an obsidian pill interior with a razor-sharp radial rim illumination that glides along the border perimeter as the cursor passes across.
#button#rim-light#glass#bevel
Sweep cursor across border to glide rim light
Customize
#FF9FFC
120px
Installation
$pnpm dlx yourbrand@latest add @yourbrand/SpecularButton-TS-TWUsage (synced with live props)
<SpecularButton
label="Generate Token"
rimColor="#FF9FFC"
glowSize={120}
/>Source Code
SpecularButton.tsx"use client";
import React from "react";
export interface SpecularButtonProps {
label?: string;
rimColor?: string;
glowSize?: number;
}
export function SpecularButton({
label = "Generate Token",
rimColor = "#FF9FFC",
glowSize = 120,
}: SpecularButtonProps) {
return (
<button
type="button"
className="relative rounded-[13px] p-[1px] text-sm font-medium text-white"
style={{ background: `radial-gradient(${glowSize}px circle at 50% 0%, ${rimColor}, rgba(255,255,255,0.12) 65%)` }}
>
<span className="block rounded-[12px] bg-[#1B1722] px-6 py-3">{label}</span>
</button>
);
}
Props API
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | "Generate Token" | Button copy. |
| rimColor | string (hex) | "#FF9FFC" | Specular border hue. |
| glowSize | number | 120 | Width of border specular light. |