Mục lục tham khảo

Thành phần

Button

Ink-fill, outline, secondary, ghost, link and destructive (✕ icon) buttons; 44px hit targets.

Nội dung tham khảo viết bằng tiếng Anh; mục “Vietnamese” có ví dụ tiếng Việt.

Xem trước

Install

bash

npx shadcn add @eloquent/button

Usage

tsx

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

<Button>Read the edition</Button>
<Button variant="destructive">Delete project</Button>
<a href="/archive" className={buttonVariants({ variant: "outline" })}>Archive</a>

States

StateTreatment
DefaultInk fill, paper text, 1px ink border
Hover / pressInverts to paper fill and ink text; the border stays, so nothing shifts
Outline, ghost hovertint-1 fill
Focus2px ink outline, 2px offset
DisabledHalftone text and border, cursor-not-allowed
DestructiveInk fill, ✕ icon and a confirming label; never red

Keyboard

KeyAction
Tab / Shift+TabMove focus to and from the button (disabled buttons are skipped)
EnterActivate
SpaceActivate

Vietnamese

Ink adaptation

Upstream shadcn's radius, shadow, focus ring glow and red destructive are removed. Sizes xs and the small icon sizes are dropped, because every size keeps a 44px hit target. Built on Base UI Button.