Button

Shadcn compatible React button on Base UI with eight variants, nine sizes including icon sizes, a pressed state and render prop support for links.

src/registry/ui/button.tsx/r/button.json

Default

Outline

Destructive

Sizes

Installation#

bash
npx shadcn@latest add @minidev/button

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/button.json

Usage#

tsx
import { Button } from "@/components/ui/button"

export function Example() {
  return (
    <Button className="w-full">Continue</Button>
  )
}

API reference#

Button props
PropTypeDefault
variant"default" | "accent" | "outline" | "secondary" | "ghost" | "soft" | "destructive" | "link""default"
size"xs" | "sm" | "default" | "lg" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg""default"

Also accepts every prop of ButtonPrimitive props, passed through to the root element.

Dependencies#

npm

@base-ui/reactclass-variance-authority

Built from

No other MiniDev files

Examples#

All button components

Learn more