← All components

Components

Every PoppyUI component, live. Copy the markup; there is no JavaScript to wire up.

Button

.btn with variant, size and state modifiers.

button.html
<button class="btn btn-primary">Primary</button>
<button class="btn btn-outline btn-sm">Small outline</button>
<button class="btn btn-primary btn-loading" aria-busy="true">Saving</button>
<button class="btn" disabled>Disabled</button>

Alert

.alert with a status color; use role="alert" only for urgent messages.

alert.html
<div class="alert alert-info" role="status">
  <div>
    <p class="alert-title">Heads up</p>
    <p>A new version is available.</p>
  </div>
</div>
<div class="alert alert-danger" role="alert">
  <p>Payment failed.</p>
</div>

Heads up

A new version is available.

Avatar

.avatar for initials or images, with size, shape, status and group modifiers.

avatar.html
<span class="avatar avatar-online" role="img" aria-label="Ada, online">AL</span>
<span class="avatar avatar-square avatar-lg" role="img" aria-label="Grace Hopper">GH</span>
<div class="avatar-group">
  <span class="avatar avatar-sm" role="img" aria-label="Ada">A</span>
  <span class="avatar avatar-sm" role="img" aria-label="Bob">B</span>
  <span class="avatar avatar-sm" role="img" aria-label="Cy">C</span>
</div>
ALGH
ABC

Badge

.badge pills in solid, soft and outline styles.

badge.html
<span class="badge">Default</span>
<span class="badge badge-primary">Primary</span>
<span class="badge badge-success badge-soft">Soft</span>
<span class="badge badge-danger badge-outline">Outline</span>
<span class="badge badge-info badge-sm">Small</span>
<span class="badge badge-warning badge-lg">Large</span>
DefaultPrimarySoftOutlineSmallLarge

Card

.card container with body, title and actions.

card.html
<article class="card card-bordered">
  <div class="card-body">
    <h3 class="card-title">Card title</h3>
    <p>Cards group related content and actions.</p>
    <div class="card-actions">
      <button type="button" class="btn btn-primary btn-sm">Open</button>
    </div>
  </div>
</article>

Card title

Cards group related content and actions.

Divider

.divider separates content, with optional centered text.

divider.html
<p>Above</p>
<div class="divider" role="separator">OR</div>
<p>Below</p>
<hr class="divider" />

Above

Below


Kbd

.kbd key caps for shortcuts.

kbd.html
<kbd class="kbd kbd-sm">Ctrl</kbd> + <kbd class="kbd">K</kbd>
<kbd class="kbd kbd-lg">Esc</kbd>
Ctrl + KEsc

Loading

.loading spinners that inherit the text color.

loading.html
<span class="loading" role="status">Loading</span>
<span class="loading loading-dots" role="status">Loading</span>
<span class="loading loading-lg" role="status">Loading</span>
LoadingLoadingLoading

Progress

Native <progress> styled with .progress; no value means indeterminate.

progress.html
<progress class="progress" value="40" max="100" aria-label="Upload"></progress>
<progress class="progress progress-success" value="75" max="100" aria-label="Done"></progress>
<progress class="progress progress-info" aria-label="Loading"></progress>

Skeleton

.skeleton shimmer placeholders, hidden from assistive tech.

skeleton.html
<div aria-busy="true">
  <div class="skeleton skeleton-circle" aria-hidden="true"></div>
  <div class="skeleton skeleton-text" aria-hidden="true"></div>
  <div class="skeleton" aria-hidden="true" style="block-size: 4rem"></div>
</div>

Stat

.stats groups of .stat figures that wrap on narrow screens.

stat.html
<div class="stats">
  <div class="stat">
    <div class="stat-title">Revenue</div>
    <div class="stat-value">$12k</div>
    <div class="stat-desc">+8% this month</div>
  </div>
  <div class="stat">
    <div class="stat-title">Users</div>
    <div class="stat-value">4,210</div>
    <div class="stat-desc">+120 this week</div>
  </div>
</div>
Revenue
$12k
+8% this month
Users
4,210
+120 this week

Table

.table with zebra and hover options, scrollable inside .table-wrap.

table.html
<div class="table-wrap" role="region" aria-label="Users" tabindex="0">
  <table class="table table-zebra table-hover">
    <thead>
      <tr><th scope="col">Name</th><th scope="col">Role</th></tr>
    </thead>
    <tbody>
      <tr><td>Ada</td><td>Engineer</td></tr>
      <tr><td>Grace</td><td>Admiral</td></tr>
      <tr><td>Linus</td><td>Maintainer</td></tr>
    </tbody>
  </table>
</div>
NameRole
AdaEngineer
GraceAdmiral
LinusMaintainer

Tooltip

CSS-only .tooltip from data-tip; also set aria-label on the trigger.

tooltip.html
<span class="tooltip" data-tip="Save changes">
  <button type="button" class="btn" aria-label="Save changes">Save</button>
</span>
<span class="tooltip tooltip-bottom" data-tip="Below">
  <button type="button" class="btn" aria-label="Bottom">Bottom</button>
</span>

Input

.input, .textarea and .select share colors, sizes and a :user-invalid border.

input.html
<input class="input" type="text" aria-label="Name" placeholder="Name">
<input class="input input-primary input-sm" aria-label="Small" placeholder="Small">
<input class="input input-lg" aria-label="Large" placeholder="Large">
<input class="input input-ghost" aria-label="Ghost" placeholder="Ghost">
<input class="input" aria-label="Disabled" value="Disabled" disabled>

<textarea class="textarea" aria-label="Message"></textarea>

<select class="select" aria-label="Fruit">
  <option>Apple</option>
  <option>Banana</option>
</select>

Checkbox

.checkbox on a native checkbox, with an indeterminate state.

checkbox.html
<label class="label-inline">
  <input type="checkbox" class="checkbox" checked> Default
</label>
<label class="label-inline">
  <input type="checkbox" class="checkbox checkbox-success"> Success
</label>
<label class="label-inline">
  <input type="checkbox" class="checkbox checkbox-lg"> Large
</label>
<label class="label-inline">
  <input type="checkbox" class="checkbox" disabled> Disabled
</label>

Radio

.radio on a native radio; arrow keys move between options in a group.

radio.html
<label class="label-inline">
  <input type="radio" name="plan" class="radio" checked> Free
</label>
<label class="label-inline">
  <input type="radio" name="plan" class="radio radio-secondary"> Pro
</label>
<label class="label-inline">
  <input type="radio" name="plan" class="radio" disabled> Team
</label>

Toggle

.toggle is a checkbox with role="switch".

toggle.html
<label class="label-inline">
  <input type="checkbox" role="switch" class="toggle" checked> Wi-Fi
</label>
<label class="label-inline">
  <input type="checkbox" role="switch" class="toggle toggle-success toggle-lg"> Sync
</label>
<label class="label-inline">
  <input type="checkbox" role="switch" class="toggle" disabled> Offline
</label>

Range

.range restyles the native slider track and thumb.

range.html
<input type="range" class="range" aria-label="Volume" value="40">
<input type="range" class="range range-secondary range-sm" aria-label="Brightness" value="70">
<input type="range" class="range range-danger range-lg" aria-label="Heat" value="20">

Field

.field, .fieldset and .label-inline lay out forms; .field-error appears on :user-invalid.

field.html
<form>
  <fieldset class="fieldset">
    <legend class="fieldset-legend">Sign up</legend>

    <div class="field">
      <label class="field-label" for="field-email">Email</label>
      <input class="input" id="field-email" type="email" required
             aria-describedby="field-email-hint field-email-error">
      <p class="field-hint" id="field-email-hint">We never share it.</p>
      <p class="field-error" id="field-email-error">Enter a valid email.</p>
    </div>

    <label class="label-inline">
      <input type="checkbox" class="checkbox" required> I accept the terms
    </label>
  </fieldset>
</form>
Sign up

We never share it.

Enter a valid email.

Accordion

Native <details name>; items sharing a name are exclusive.

accordion.html
<div class="accordion">
  <details class="accordion-item" name="faq" open>
    <summary>What is PoppyUI?</summary>
    <div class="accordion-content">A CSS-first design system.</div>
  </details>
  <details class="accordion-item" name="faq">
    <summary>Does it need JavaScript?</summary>
    <div class="accordion-content">No. The name attribute makes items exclusive.</div>
  </details>
</div>
What is PoppyUI?
A CSS-first design system.
Does it need JavaScript?
No. The name attribute makes items exclusive.

Tabs

Radio inputs and sibling selectors; arrow keys work natively.

tabs.html
<div class="tabs">
  <input type="radio" name="demo-tabs" id="demo-tab1" class="tab-input" checked>
  <label for="demo-tab1" class="tab">One</label>
  <div class="tab-panel">First panel</div>
  <input type="radio" name="demo-tabs" id="demo-tab2" class="tab-input">
  <label for="demo-tab2" class="tab">Two</label>
  <div class="tab-panel">Second panel</div>
</div>
First panel
Second panel

Steps

Numbered progress from CSS counters.

steps.html
<ol class="steps">
  <li class="step step-done">Account</li>
  <li class="step" aria-current="step">Profile</li>
  <li class="step">Finish</li>
</ol>
  1. Account
  2. Profile
  3. Finish

Drawer

A side sheet on <dialog>, opened with Invoker Commands.

drawer.html
<button type="button" class="btn" commandfor="demo-drawer" command="show-modal">Open drawer</button>
<dialog id="demo-drawer" class="drawer" aria-label="Navigation" closedby="any">
  <button type="button" class="btn btn-ghost btn-sm" commandfor="demo-drawer" command="close">Close</button>
  <ul class="menu">
    <li class="menu-title">Navigate</li>
    <li><a href="#drawer" aria-current="page">Home</a></li>
    <li><a href="#drawer">Projects</a></li>
  </ul>
</dialog>

Join

Groups adjacent controls flush with a shared radius.

join.html
<div class="join">
  <button type="button" class="btn">One</button>
  <button type="button" class="btn">Two</button>
  <button type="button" class="btn">Three</button>
</div>

Toast

A fixed stack for alerts; here a popover="manual" toast with a close button.

toast.html
<button type="button" class="btn" popovertarget="demo-toast">Show toast</button>
<div id="demo-toast" class="toast" popover="manual" role="status">
  <div class="alert alert-success">
    Saved
    <button type="button" class="btn btn-ghost btn-sm" popovertarget="demo-toast" popovertargetaction="hide">Close</button>
  </div>
</div>
Saved