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

Tabs

CSSHTMLUIIntermediate

Tabbed interfaces with underline and pill styles, interactive JavaScript switching, and keyboard navigation.

Underline Tabs

Material-style underline tabs with animated indicator that slides between active items.

underline-tabs
Live
untitled.html
HTML
1<div class="wrapper">
2 <div class="tabs">
3 <button class="tab active" data-tab="tab1">
4 Profile
5 </button>
6 <button class="tab" data-tab="tab2">
7 Security
8 </button>
9 <button class="tab" data-tab="tab3">
10 Billing
11 </button>
12 <button class="tab" data-tab="tab4">
13 Team
14 </button>
15 <div class="indicator">
16 </div>
17 </div>
18 <div class="panel active" id="tab1">
19 <div class="panel-icon">
20 <svg viewBox="0 0 24 24" fill="none" stroke="#00FF41" stroke-width="2" width="24" height="24">
21 <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
22 <circle cx="12" cy="7" r="4"/>
23 </svg>
24 </div>
25 <h3 class="panel-title">
26 Profile Settings
27 </h3>
28 <p class="panel-desc">
29 Manage your personal information, profile picture, and public profile settings.
30 </p>
31 </div>
32 <div class="panel" id="tab2">
33 <div class="panel-icon">
34 <svg viewBox="0 0 24 24" fill="none" stroke="#00FF41" stroke-width="2" width="24" height="24">
35 <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
36 <path d="M7 11V7a5 5 0 0 1 10 0v4"/>
37 </svg>
38 </div>
39 <h3 class="panel-title">
40 Security
41 </h3>
42 <p class="panel-desc">
43 Configure password, two-factor authentication, and security preferences.
44 </p>
45 </div>
46 <div class="panel" id="tab3">
47 <div class="panel-icon">
48 <svg viewBox="0 0 24 24" fill="none" stroke="#00FF41" stroke-width="2" width="24" height="24">
49 <rect x="1" y="4" width="22" height="16" rx="2" ry="2"/>
50 <line x1="1" y1="10" x2="23" y2="10"/>
51 </svg>
52 </div>
53 <h3 class="panel-title">
54 Billing
55 </h3>
56 <p class="panel-desc">
57 View invoices, update payment method, and manage subscription plan.
58 </p>
59 </div>
60 <div class="panel" id="tab4">
61 <div class="panel-icon">
62 <svg viewBox="0 0 24 24" fill="none" stroke="#00FF41" stroke-width="2" width="24" height="24">
63 <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
64 <circle cx="9" cy="7" r="4"/>
65 <path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
66 <path d="M16 3.13a4 4 0 0 1 0 7.75"/>
67 </svg>
68 </div>
69 <h3 class="panel-title">
70 Team
71 </h3>
72 <p class="panel-desc">
73 Invite team members, manage roles, and configure permissions.
74 </p>
75 </div>
76</div>
preview
Pill Tabs

Pill-style segmented tabs with icon support — great for settings pages and filters.

pill-tabs
Live
untitled.html
HTML
1<div class="wrapper">
2 <div class="pill-nav">
3 <button class="pill active" data-id="preview">
4 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14">
5 <rect x="3" y="3" width="7" height="7"/>
6 <rect x="14" y="3" width="7" height="7"/>
7 <rect x="14" y="14" width="7" height="7"/>
8 <rect x="3" y="14" width="7" height="7"/>
9 </svg>
10 Preview
11 </button>
12 <button class="pill" data-id="code">
13 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14">
14 <polyline points="16 18 22 12 16 6"/>
15 <polyline points="8 6 2 12 8 18"/>
16 </svg>
17 Code
18 </button>
19 <button class="pill" data-id="settings">
20 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14">
21 <circle cx="12" cy="12" r="3"/>
22 <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"/>
23 </svg>
24 Settings
25 </button>
26 </div>
27 <div class="content">
28 <div class="content-panel active" id="preview-view">
29 <div class="preview-box">
30 <div class="preview-circle">
31 </div>
32 <div class="preview-lines">
33 <div class="preview-line" style="width:60%">
34 </div>
35 <div class="preview-line" style="width:80%">
36 </div>
37 <div class="preview-line" style="width:40%">
38 </div>
39 </div>
40 </div>
41 </div>
42 <div class="content-panel" id="code-view">
43 <pre class="code-sample">
44 <span class="code-comment">
45 // main.js
46 </span>
47 <span class="code-line">
48 <span class="code-kw">
49 const
50 </span>
51 app =
52 <span class="code-fn">
53 initialize
54 </span>
55 ()
56 </span>
57 <span class="code-line">
58 app.
59 <span class="code-fn">
60 run
61 </span>
62 ({ mode:
63 <span class="code-str">
64 'dev'
65 </span>
66 })
67 </span>
68 </pre>
69 </div>
70 <div class="content-panel" id="settings-view">
71 <div class="settings-list">
72 <label class="setting">
73 <span>
74 Dark Mode
75 </span>
76 <input type="checkbox" checked/>
77 </label>
78 <label class="setting">
79 <span>
80 Auto-save
81 </span>
82 <input type="checkbox"/>
83 </label>
84 <label class="setting">
85 <span>
86 Notifications
87 </span>
88 <input type="checkbox" checked/>
89 </label>
90 </div>
91 </div>
92 </div>
93</div>
preview
Vertical Tabs

Sidebar-style vertical tabs for settings panels and complex navigation layouts.

vertical-tabs
Live
untitled.html
HTML
1<div class="wrapper">
2 <div class="v-nav">
3 <button class="v-tab active" data-v="general">
4 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">
5 <path d="M12 20h9"/>
6 <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/>
7 </svg>
8 General
9 </button>
10 <button class="v-tab" data-v="appearance">
11 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">
12 <circle cx="12" cy="12" r="3"/>
13 <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"/>
14 </svg>
15 Appearance
16 </button>
17 <button class="v-tab" data-v="advanced">
18 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">
19 <circle cx="12" cy="12" r="3"/>
20 <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>
21 </svg>
22 Advanced
23 </button>
24 </div>
25 <div class="v-panels">
26 <div class="v-panel active" id="v-general">
27 <h3>
28 General Settings
29 </h3>
30 <label class="v-field">
31 <span>
32 Site Name
33 </span>
34 <input type="text" value="My App"/>
35 </label>
36 <label class="v-field">
37 <span>
38 Language
39 </span>
40 <select>
41 <option>
42 English
43 </option>
44 <option>
45 Spanish
46 </option>
47 </select>
48 </label>
49 </div>
50 <div class="v-panel" id="v-appearance">
51 <h3>
52 Appearance
53 </h3>
54 <label class="v-field">
55 <span>
56 Theme
57 </span>
58 <select>
59 <option>
60 Dark
61 </option>
62 <option>
63 Light
64 </option>
65 <option>
66 System
67 </option>
68 </select>
69 </label>
70 </div>
71 <div class="v-panel" id="v-advanced">
72 <h3>
73 Advanced
74 </h3>
75 <p class="v-desc">
76 Advanced configuration options for power users.
77 </p>
78 </div>
79 </div>
80</div>
preview