Chrome ButtonPro

Usage

With no children it shows an up arrow, which fits the send button of a chat bar:

Example
import { ChromeButton } from "@/components/ui/chrome-button"

<ChromeButton type="submit" aria-label="Send" disabled={!message.trim()} />

Pass your own icon as children:

Example
import { HugeiconsIcon } from "@hugeicons/react"
import { Mic01Icon } from "@hugeicons/core-free-icons"

<ChromeButton aria-label="Start dictation">
  <HugeiconsIcon icon={Mic01Icon} />
</ChromeButton>

The face turns graphite in dark mode, while the ring keeps its colour.

Colours

Pick the ring's metal with tone:

Example
<ChromeButton tone="fire" />
ToneLooks like
chromePolished silver (the default)
goldWarm gold
roseRose gold
iceCool blue steel
emeraldGreen anodised metal
fireMolten orange that turns faster and flickers
auroraA rainbow sheen

Every tone except chrome also gives the ring a soft glow in its colour.

Stretch the ring

Press and drag the button: the outer ring pulls toward the pointer like a rubber band, and wobbles back when you let go. A drag never counts as a click, so it won't send or submit. Turn it off with stretchable={false}.

Reflection

Light follows the mouse: as it comes near, a glint lights the ring on the mouse's side and a soft glare slides across the face beneath it. Move away and it fades out. Turn it off with reflective={false}.

Props

Takes every <button> prop, plus:

PropTypeDefaultWhat it does
size"sm" | "md" | "lg""md"Diameter: 32px, 44px or 60px.
tone"chrome" | "gold" | "rose" | "ice" | "emerald" | "fire" | "aurora""chrome"The ring's colour.
stretchablebooleantrueLet people press and drag to stretch the outer ring.
reflectivebooleantrueShow a reflection that follows the mouse.
childrenReactNodeup arrowThe icon in the middle. Sized to fit the button.

Accessibility

  • It's a real <button>, so it works with Enter, Space and form submit
  • Icon-only buttons need a name: pass aria-label. With no children and no label it falls back to “Send”
  • Keyboard focus shows a ring outside the chrome edge
  • With reduced motion, the ring stays still and undistorted, and a stretch settles back without wobbling