Skip to content

Components

Button

A button made of glass. Clear glass bends the page behind it; tinted glass takes your background colour.

Markdown
glass-button-clear.tsx

Use it for

  • One action: a call to action, a toolbar button, a link that looks like a button.
  • Clear glass over imagery or colour, where the bend shows.

Not for

  • An async action whose result should show on the button: use GlassActionButton.
  • Choosing between options: use GlassTabs.
  • Every button of a dense form: keep the glass for the action that matters.

Installation

Coming soon
npm install @vitrumui/react
No dependencies

Usage

app.tsx
import { GlassButton } from '@vitrumui/react/button'

<GlassButton>Get started</GlassButton>
<GlassButton material="tinted" className="bg-sky-500 text-white">Save</GlassButton>
<GlassButton asChild>
  <Link href="/docs">Read the docs</Link>
</GlassButton>

Examples

Coming soon

API reference

PropTypeDefault
material

Clear bends the page; tinted uses the background colour.

'clear' | 'tinted''clear'
size

Height 32, 40, 48 or 64 px.

'sm' | 'md' | 'lg' | 'xl''md'
icon

An icon element (e.g. a lucide-react icon).

ReactNode—
iconPosition

Which side the icon sits on.

'start' | 'end''end'
tint

Clear glass only: how much tint covers the backdrop (0–1).

number0.6
asChild

Put the glass on the single child element instead of a <button>.

booleanfalse
…rest

Passed to the element (onClick, disabled, type…).

button attributes—

Accessibility

  • A real <button> (or your own element with asChild): focus, Enter and Space work as usual.
  • The glass canvas is aria-hidden; only your label is announced.
  • Icon-only buttons need an aria-label.