Every component in grit.css on one page. Browse, copy, and build.
01 — Typography
Semantic HTML — no classes needed. .prose for long-form content.
This is a paragraph of body text. grit.css provides beautiful defaults for semantic HTML — no classes needed. You can include inline links, bold text, italic text, inline code, and highlighted text.
"Simplicity is the ultimate sophistication." — Leonardo da Vinci
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet("world"));
03 — Cards
.card .card-body .card-title .card-actions
Escape to the mountains for a weekend of hiking, fresh air, and stunning views.
Revenue is up 12% this quarter. Customer satisfaction scores hit an all-time high of 94%.
All systems operational. Last incident was 47 days ago. Uptime: 99.98%.
04 — Badges
.badge .badge-primary .badge-success .badge-outline .badge-lg
05 — Alerts
.alert .alert-info .alert-success .alert-warning .alert-error
06 — Tabs
.tabs .tab .tab-active
07 — Toggle Switches
.toggle on <input type="checkbox">
08 — Avatars
.avatar .avatar-sm .avatar-lg .avatar-xl
09 — Dropdown
.dropdown .dropdown-menu on <details>/<summary>
10 — Tooltips
data-tooltip="..." attribute on any element
11 — Progress Bars
.progress .progress-bar .progress-bar-success .progress-bar-warning .progress-bar-error
12 — Modal
.modal .modal-body .modal-title .modal-actions on <dialog>
13 — Dividers
.divider — empty for a line, with text for a labeled break
14 — Skeleton Loading
.skeleton .skeleton-text .skeleton-title .skeleton-avatar
15 — Chips
.chip
18 — Toast Notifications
.toast-container .toast .toast-success .toast-error .toast-out
19 — Accordion
.accordion .accordion-body on <details>/<summary>
<link> tag to your HTML and start writing. That's it.--grit-primary and the entire framework updates. Dark mode works automatically via prefers-color-scheme.21 — Spinner
.spinner .spinner-sm .spinner-lg
22 — Stack
.stack — row on desktop, column on mobile
Row on desktop, column on mobile.
Resize the browser to see.
Uses .stack class.
23 — Prose
.prose — typographic styling for long-form content
CSS frameworks got complicated. Tailwind needs a compiler. Bootstrap ships 160KB and a JavaScript bundle. You need a PhD in config files before you write your first style.
We wanted something simpler. One file. One <link> tag. Your HTML looks good immediately.
grit.css styles semantic HTML out of the box — headings, paragraphs, lists, tables, forms, and blockquotes all look polished without adding a single class.
Simplicity is the ultimate sophistication. — Leonardo da Vinci
<head>That's it. No build step. No JavaScript. No config files. Just HTML and CSS, the way it should be.
24 — Tables
.table .table-striped .table-hover .table-responsive
| Name | Role | Status | Joined | |
|---|---|---|---|---|
| Sarah Chen | sarah@example.com | Admin | Active | Jan 12, 2024 |
| Marcus Johnson | marcus@example.com | Editor | Active | Mar 5, 2024 |
| Emily Rodriguez | emily@example.com | Viewer | Pending | Jun 20, 2024 |
| James Kim | james@example.com | Editor | Suspended | Aug 1, 2024 |
| Olivia Patel | olivia@example.com | Admin | Active | Sep 14, 2024 |
25 — Color Palette
CSS custom properties: --grit-primary --grit-success --grit-error etc.
--grit-primary
#2563eb
--grit-secondary
#7c3aed
--grit-accent
#06b6d4
--grit-neutral
#1f2937
--grit-success
#16a34a
--grit-warning
#eab308
--grit-error
#dc2626
--grit-info
#0ea5e9
--grit-bg
#ffffff
--grit-surface
#f9fafb
--grit-surface-2
#f3f4f6
--grit-muted
#6b7280
26 — Themes
.theme-midnight .dark .light — or create your own by overriding CSS custom properties
Dark blue theme
Every component reads from CSS custom properties
.my-theme {
--grit-primary: #e11d48;
--grit-bg: #0a0a0a;
--grit-surface: #1a1a1a;
--grit-text: #f5f5f5;
--grit-border: #333;
}
27 — Composition
Combining components: .card + .badge + .avatar + .row/.col
New deployment started
2 minutes agoBuild #346 completed
1 hour agoDisk usage at 85%
3 hours agoAlex Rivera
Engineering
Maya Johnson
Design
Sam Park
Marketing
28 — Forms
<input> <select> <textarea> .input-group .input-group-text <fieldset>
29 — Layout
.grid .grid-2 .grid-3 .grid-4 .grid-auto .row .col .between .center
30 — Utilities
.text-sm .text-lg .text-muted .font-bold .font-mono .truncate .shadow .rounded
text-sm — Small text for captions and fine print
Default — Regular body text size
text-lg — Slightly larger for emphasis
text-xl — Section headings and callouts
text-2xl — Large display text
text-left — Aligned to the left
text-center — Centered text
text-right — Aligned to the right
font-bold — Bold weight text
font-mono — Monospaced text for code
This is a very long line of text that will be truncated with an ellipsis when it exceeds the container width.