Skip to content

    Browse components

    Button

    shadcn-style button with six variants, a tactile press, icon slots and a loading spinner that slides the label aside.

    Open
    Customize

    default
    secondary
    outline
    ghost
    destructive
    link
    sm
    md
    lg
    icon

    Installation

    npx shadcn@latest add @glint-ui/button

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/button.json

    Usage

    import { Button } from "@/components/ui/button";
    
    <Button variant="default" startIcon={<Rocket />} loading={saving}>Deploy now</Button>
    
    <Button variant="outline" render={(p) => <Link href="/docs" {...p} />}>Read docs</Button>

    Props

    PropTypeDefaultDescription
    childrenstring"Deploy now"Label.
    variant"default" | "secondary" | "outline" | "ghost" | "destructive" | "link""default"Visual style.
    size"sm" | "md" | "lg" | "icon""md"Height and padding.
    loadingbooleanfalseSpinner, aria-busy and disabled.
    disabledbooleanfalseDisable the button.
    startIconReactNode—Icon before the label.
    endIconReactNode—Icon after the label.
    renderReactNode—Render another element, e.g. (p) => <Link href="/" {...p} />.
    classNamestring—Extra classes for the root element.