CSS only
Basics
Fourteen small parts that need no JavaScript: buttons, badges, alerts, cards and more.
Buttons
HTML
<button class="pw-btn">Default</button>
<button class="pw-btn pw-btn--primary">Primary</button>
<button class="pw-btn pw-btn--soft">Soft</button>
<button class="pw-btn pw-btn--ghost">Ghost</button>
<button class="pw-btn pw-btn--danger">Danger</button>
<button class="pw-btn" disabled>Disabled</button>
<button class="pw-btn pw-btn--primary is-loading" aria-label="Saving">Saving</button>
<button class="pw-btn pw-btn--sm">Small</button>
<button class="pw-btn pw-btn--lg">Large</button>
<span class="pw-btn-group" role="group" aria-label="View">
<button class="pw-btn" aria-pressed="true">Day</button><button class="pw-btn" aria-pressed="false">Week</button><button class="pw-btn" aria-pressed="false">Month</button>
</span>Badges and chips
Draft
Active
Pending
Failed
New
Pro
design
HTML
<span class="pw-badge">Draft</span>
<span class="pw-badge pw-badge--ok pw-badge--dot">Active</span>
<span class="pw-badge pw-badge--warn">Pending</span>
<span class="pw-badge pw-badge--bad">Failed</span>
<span class="pw-badge pw-badge--info">New</span>
<span class="pw-badge pw-badge--accent">Pro</span>
<span class="pw-chip"><span>design</span><button aria-label="Remove design"></button></span>Alerts
Heads up. Maintenance is planned for Sunday at 02:00.
Payment received. A receipt is on its way to your inbox.
Your trial ends in 3 days. Add a card to keep your projects.
We could not save. Check your connection and try again.
HTML
<div class="pw-alert pw-alert--info" role="status"><div><b>Heads up.</b> Maintenance is planned for Sunday at 02:00.</div></div><br>
<div class="pw-alert pw-alert--ok" role="status"><div><b>Payment received.</b> A receipt is on its way to your inbox.</div></div><br>
<div class="pw-alert pw-alert--warn" role="status"><div><b>Your trial ends in 3 days.</b> Add a card to keep your projects.</div></div><br>
<div class="pw-alert pw-alert--bad" role="alert"><div><b>We could not save.</b> Check your connection and try again.</div></div>Card, avatars and a stat
Orders this week
1,284
12% more than last week
LFOHPN
HTML
<div class="pw-card" style="width:260px">
<div class="pw-card-body">
<div class="pw-stat">
<span class="pw-stat-label">Orders this week</span>
<span class="pw-stat-value">1,284</span>
<span class="pw-stat-note is-up">12% more than last week</span>
</div>
</div>
<div class="pw-card-foot">
<span class="pw-avatars">
<span class="pw-avatar pw-avatar--sm">LF</span><span class="pw-avatar pw-avatar--sm">OH</span><span class="pw-avatar pw-avatar--sm">PN</span>
</span>
</div>
</div>
<span class="pw-avatar pw-avatar--lg">KM</span>
<span class="pw-avatar">TB</span>Progress, spinner and skeleton
HTML
<progress class="pw-progress" value="64" max="100" aria-label="Upload"></progress><br>
<span class="pw-spinner" role="status" aria-label="Loading"></span><br><br>
<span class="pw-skeleton" style="width:70%"></span><br>
<span class="pw-skeleton" style="width:45%"></span>Table
| Invoice | Customer | Status | Amount |
|---|---|---|---|
| INV-1042 | Northwind Ltd | Paid | $1,200.00 |
| INV-1043 | Blue Harbor | Due | $340.00 |
| INV-1044 | Juniper Studio | Draft | $89.50 |
HTML
<div class="pw-table-wrap">
<table class="pw-table">
<thead><tr><th>Invoice</th><th>Customer</th><th>Status</th><th>Amount</th></tr></thead>
<tbody>
<tr><td>INV-1042</td><td>Northwind Ltd</td><td><span class="pw-badge pw-badge--ok">Paid</span></td><td>$1,200.00</td></tr>
<tr><td>INV-1043</td><td>Blue Harbor</td><td><span class="pw-badge pw-badge--warn">Due</span></td><td>$340.00</td></tr>
<tr><td>INV-1044</td><td>Juniper Studio</td><td><span class="pw-badge">Draft</span></td><td>$89.50</td></tr>
</tbody>
</table>
</div>Breadcrumb, timeline, empty state, keys
- Order placed
- Packed
- Delivered
No invoices yetCreate your first invoice to see it here.
Press Ctrl K to search.
or
HTML
<ol class="pw-breadcrumb" aria-label="You are here">
<li><a href="#main">Home</a></li><li><a href="#main">Projects</a></li><li><span aria-current="page">Website</span></li>
</ol><br>
<ol class="pw-timeline">
<li class="is-done"><time>Monday</time><b>Order placed</b></li>
<li class="is-done"><time>Tuesday</time><b>Packed</b></li>
<li><time>Expected Thursday</time><b>Delivered</b></li>
</ol><br>
<div class="pw-empty"><b>No invoices yet</b>Create your first invoice to see it here.</div><br>
<p>Press <kbd class="pw-kbd">Ctrl</kbd> <kbd class="pw-kbd">K</kbd> to search.</p>
<div class="pw-divider">or</div>Classes
| Class | What it does |
|---|---|
pw-btn | Button. Variants: --primary, --soft, --ghost, --danger. Sizes: --sm, --lg. Also --icon, --block, is-loading, pw-btn-group. |
pw-badge | Small label. Variants: --ok, --warn, --bad, --info, --accent, --dot. |
pw-chip | A tag with a remove button. |
pw-alert | Message box. Variants: --ok, --warn, --bad, --info. |
pw-card | Box with pw-card-body and pw-card-foot. |
pw-avatar | Round picture or initials. Sizes --sm, --lg. Overlap them in pw-avatars. |
pw-progress | On a <progress> element. |
pw-spinner | Loading circle. |
pw-skeleton | Grey bar while content loads. |
pw-table | Table, inside pw-table-wrap so it can scroll sideways. Variant --striped. |
pw-breadcrumb | On an <ol>. |
pw-timeline | On an <ol>; is-done fills the dot. |
pw-stat | A number with a label and a note. |
pw-empty, pw-kbd, pw-divider | Empty state, keyboard key, line with text. |
Good to know
- A loading button needs a name for screen readers, because its text is hidden: use
aria-label. - A toggle button says whether it is on with
aria-pressed.
Files
Everything is in dist/partwise.css and dist/partwise.js. To load only this component, use src/css/00-base.css and src/js/00-core.js plus: css/01-basics.css.