Pesquisar no MotionVideo

Pesquisar vídeos, criadores, ferramentas, criativos…

Button

A shadcn button whose variants all share one size, with a gradient variant for the call to action that matters most.

Previewbutton

Installation

pnpm dlx shadcn@latest add https://motionvideo.xyz/r/button.json

It installs as components/ui/button.tsx, so it replaces shadcn's button if you have one; the CLI asks first. The API is the same (Base UI underneath), so existing buttons keep working. The CLI also adds the colors the gradient variant uses to your CSS.

Usage

import { Button, buttonVariants } from "@/components/ui/button";

<Button variant="gradient" size="xl">
  Get Pro
</Button>

// A link that looks like a button
<a href="/pricing" className={buttonVariants({ variant: "outline" })}>
  See plans
</a>

Variants

VariantFor
defaultThe usual primary action
gradientThe call to action that matters most, such as checkout. Use it sparingly
secondarySecondary actions beside a primary one
outlineActions on busy backgrounds, drawn with a soft outline shadow instead of a border
ghostToolbar and menu actions
subtleGhost with muted text at rest, for secondary chrome like footers
destructiveDeleting or removing
linkAn action that reads as a link

Every variant keeps a 1px transparent border and fills the border box, so switching variants never changes a button's size.

Sizes

xs, sm, default, lg and xl, and square icon buttons icon-xs, icon-sm, icon, icon-lg and icon-xl. An icon marked data-icon="inline-start" or data-icon="inline-end" gets tighter padding on its side.

Theming

The gradient variant reads three CSS variables. Change them to make it yours:

:root {
  --cta-from: #ffdd73;
  --cta-to: #ffbe25;
  --cta-foreground: oklch(0.145 0 0);
}

--cta-shadow draws its inset ring, and --surface-outline the outline variant's shadow. Set both again under .dark to tune them for dark mode.