Skip to Content
Charlotte UI

Button

Button with a Liquid Glass press lens and a loading state.

Installation

bun add @charlotte-ui/button framer-motion radix-ui lucide-react

Set up the theme first.

Usage

import { Button } from "@charlotte-ui/button"

Variants

Sizes

Give icon-only buttons an aria-label. The icon sizes are icon-xs, icon-sm, icon and icon-lg.

Loading

animateWidth animates the change in width as the loading state toggles.

Press feedback

Pressing a button blooms a glass lens past its edges. Holding and dragging leans the lens toward the pointer, and releasing outside cancels the click. link buttons and asChild skip the lens, and prefers-reduced-motion turns it off.

Props

Button also accepts the props of a native <button>.

PropTypeDefault
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""default"
size"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg""default"
fullWidthboolean
asChildbooleanfalse
loadingbooleanfalse
loadingTextReactNode
animateWidthbooleanfalse

On this page