<button class="btn">Button</button>
Usage
You can use one of the btn
classes to style any element as a button:
-
Variants:
btn
orbtn-primary
for primary buttons,btn-secondary
for secondary buttons.btn-destructive
for destructive buttons.btn-outline
for outline buttons.btn-ghost
for ghost buttons.btn-link
for link buttons.btn-icon
for icon buttons. This can be combined with other variants, for examplebtn-icon-destructive
.
-
Sizes:
btn-sm
for small buttons.btn-lg
for large buttons.- You can combine sizes with any variant, for example
btn-lg-destructive
orbtn-sm-icon-outline
.
<button class="btn">Button</button>
Examples
Primary
<button class="btn">Primary</button>
Secondary
<button class="btn-secondary">Button</button>
Destructive
<button class="btn-destructive">Destructive</button>
Outline
<button class="btn-outline">Outline</button>
Ghost
<button class="btn-ghost">Ghost</button>
Link
<button class="btn-link">Link</button>
Icon
<button class="btn-icon-outline">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6" /></svg>
</button>
With Icon
<button class="btn">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z" /><path d="m21.854 2.147-10.94 10.939" /></svg>
Send email
</button>
Loading
<button class="btn-outline" disabled>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="animate-spin"><path d="M12 2v4" /><path d="m16.2 7.8 2.9-2.9" /><path d="M18 12h4" /><path d="m16.2 16.2 2.9 2.9" /><path d="M12 18v4" /><path d="m4.9 19.1 2.9-2.9" /><path d="M2 12h4" /><path d="m4.9 4.9 2.9 2.9" /></svg>
Loading
</button>
Large
<button class="btn-lg">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="21" r="1" /><circle cx="19" cy="21" r="1" /><path d="M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12" /></svg>
Buy
</button>
Small
<button class="btn-sm-icon-destructive">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18" /><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" /><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" /></svg>
</button>