Glass Button for React
A glass button for React is a button that lifts on hover and presses down on tap, with a sweep of light across the filled variants, animated with Motion and kept still under reduced motion.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.jsonVariants
import { Button } from "@/components/sheenui/button/button";
// Package build (after the first npm release, or a packed tarball): import { Button } from "@sheenui/theme";
export function Example() {
return (
<>
<Button>Primary</Button>
<Button variant="glass">Glass</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="link">Link</Button>
<Button variant="danger">Delete</Button>
</>
);
}Files to copy
6 folders · 9 files · 4 packages
- From
theme/src/ components/button/components/spinner/hooks/{use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}motion/{gate.ts, tokens.ts}lib/{cn.ts, form.ts, state-light.tsx}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.jsonRegistry item: button. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Sizes and icons
import { Button } from "@/components/sheenui/button/button";
// Package build (after the first npm release, or a packed tarball): import { Button } from "@sheenui/theme";
import { ArrowRight as Arrow } from "lucide-react";
export function Example() {
return (
<>
<Button size="sm">Small</Button>
<Button size="md" trailing={<Arrow />}>Continue</Button>
<Button size="lg">Large</Button>
<Button size="icon" variant="glass" aria-label="Next"><Arrow /></Button>
</>
);
}Loading and disabled
Loading shows a spinner, disables the button and sets aria-busy.
import { useState } from "react";
import { Button } from "@/components/sheenui/button/button";
// Package build (after the first npm release, or a packed tarball): import { Button } from "@sheenui/theme";
export function Example() {
const [loading, setLoading] = useState(false);
return (
<>
<Button loading={loading} onClick={() => { setLoading(true); setTimeout(() => setLoading(false), 1500); }}>
Save changes
</Button>
<Button disabled>Disabled</Button>
</>
);
}Props
Keyboard
Accessibility
- A native <button type="button"> by default; with render it becomes a link or your router's Link with the same look.
- While loading, the button stays focusable (aria-disabled, aria-busy) and ignores clicks, so focus is never lost.
- An icon-only button (size="icon") needs an aria-label.
- Touch targets are at least 44 x 44 px; forced colors keep a ButtonText border.
When to use Button
- Use Button as a glassy, animated button in React for the main call to action on a landing page, with the primary variant for the one action you want taken and glass or ghost for secondary choices beside it.
- Use the loading prop on a Save or Pay button so the click is ignored while a request runs, the spinner shows, and focus stays on the button.
- Use the render prop to make a router link look and behave like a button, for example a See pricing link, without nesting an anchor inside a button element.
- Skip it when the control chooses a value or a view, not an action. Use Toggle for a pressed state, SegmentedControl for one of a few options, and Tabs for switching panels.
- Pair it with Dialog and Popover triggers through the render prop, Spinner or BorderBeam as children, and Tooltip to name an icon-only button with the icon size.
Frequently asked questions
Related pages
Guides that cover it
- Install SheenUI Glass Components in Next.js and Vite
- Glassmorphism in React: A Step-by-Step Tutorial
- Apple Liquid Glass in CSS and React
- Accessible Glassmorphism
- Glassmorphism vs Liquid Glass vs Neumorphism
- Framer Motion Examples: 12 Animated React Patterns
- Base UI vs Radix UI for React in 2026
- shadcn Glassmorphism: Three Ways to Get a Glass UI
- Glassmorphism UI Prompts for AI Coding Agents
67 components pages in all: browse them on All components.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .