|$ curl https://forge-ai.dev/api/markdown?path=docs/components/buttons
$cat docs/buttons.md
updated Recently·12 min read·published

Buttons

CSSHTMLUIIntermediate

10+ button styles covering variants, sizes, shapes, icons, groups, loading, and animations.

Variants

Primary, secondary, outline, ghost, and danger — five variants covering every use case.

variants
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn btn-primary">
3 Primary
4 </button>
5 <button class="btn btn-secondary">
6 Secondary
7 </button>
8 <button class="btn btn-outline">
9 Outline
10 </button>
11 <button class="btn btn-ghost">
12 Ghost
13 </button>
14 <button class="btn btn-danger">
15 Delete
16 </button>
17</div>
preview
Sizes

From tiny to massive — choose the right size for your layout.

sizes
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn sm">
3 Small
4 </button>
5 <button class="btn md">
6 Default
7 </button>
8 <button class="btn lg">
9 Large
10 </button>
11 <button class="btn xl">
12 X-Large
13 </button>
14</div>
preview
Pill & Shape

Rounded pill buttons and square icon buttons for visual variety.

shapes
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn primary pill">
3 Rounded
4 </button>
5 <button class="btn secondary pill">
6 Pill
7 </button>
8 <button class="btn outline pill">
9 Button
10 </button>
11 <button class="btn primary square">
12 S
13 </button>
14 <button class="btn secondary square">
15 M
16 </button>
17 <button class="btn danger square">
18 X
19 </button>
20</div>
preview
Block Width

Full-width buttons for forms, CTAs, and action bars.

block
Live
untitled.html
HTML
1<div class="wrapper">
2 <button class="btn primary block">
3 Full Width Primary
4 </button>
5 <button class="btn secondary block">
6 Full Width Secondary
7 </button>
8 <button class="btn outline block">
9 Full Width Outline
10 </button>
11</div>
preview
With Icons

Icon + label buttons and compact icon-only buttons.

icons
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn primary">
3 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="16" height="16">
4 <path d="M5 12h14M12 5l7 7-7 7"/>
5 </svg>
6 Send
7 </button>
8 <button class="btn secondary">
9 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="16" height="16">
10 <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
11 <polyline points="7 10 12 15 17 10"/>
12 <line x1="12" y1="15" x2="12" y2="3"/>
13 </svg>
14 Download
15 </button>
16 <button class="btn secondary">
17 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="16" height="16">
18 <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
19 <circle cx="12" cy="12" r="3"/>
20 </svg>
21 12
22 </button>
23 <button class="icon-btn" aria-label="Settings">
24 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18">
25 <circle cx="12" cy="12" r="3"/>
26 <path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>
27 </svg>
28 </button>
29</div>
preview
Button Group

Segmented control style button groups for toggling between options.

group
Live
untitled.html
HTML
1<div class="wrapper">
2 <div class="btn-group">
3 <button class="active">
4 Day
5 </button>
6 <button>
7 Week
8 </button>
9 <button>
10 Month
11 </button>
12 <button>
13 Year
14 </button>
15 </div>
16 <div class="btn-group outline">
17 <button class="active">
18 All
19 </button>
20 <button>
21 Active
22 </button>
23 <button>
24 Draft
25 </button>
26 <button>
27 Archived
28 </button>
29 </div>
30</div>
preview
Loading State

Spinner indicators during async operations, with disabled state to prevent double-submission.

loading
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn primary" id="load-btn">
3 <span class="spinner" style="display:none">
4 </span>
5 <span class="label">
6 Save Changes
7 </span>
8 </button>
9 <button class="btn secondary">
10 <span>
11 Click me
12 </span>
13 </button>
14 <button class="btn ghost">
15 <span>
16 Click me
17 </span>
18 </button>
19</div>
preview
Animated

Buttons with hover animations — pulse glow, border slide, and scale bounce.

animated
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn pulse">
3 Pulse Glow
4 </button>
5 <button class="btn slide">
6 Slide Border
7 </button>
8 <button class="btn bounce">
9 Bounce
10 </button>
11</div>
preview
Social & Action

Brand-colored social login buttons and action buttons (like, bookmark, share).

social
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn github">
3 <svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
4 <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/>
5 </svg>
6 GitHub
7 </button>
8 <button class="btn twitter">
9 <svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
10 <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
11 </svg>
12 X
13 </button>
14 <button class="btn google">
15 <svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
16 <path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"/>
17 <path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/>
18 <path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/>
19 <path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/>
20 </svg>
21 Google
22 </button>
23</div>
preview