Skip to main content
PimentCSS v1.0.1, what's new
Home

Toolbar + modal

Toolbar with status alert, button group, and modal task flow.

A list or dashboard screen: status at the top, a toolbar for view mode and actions, and a modal for a focused task. Wire data-button-group-live and data-modal-open as on the component pages.

When to use it

  • Admin tables, project lists, or settings where users switch view and run batch actions.
  • The modal holds a short form or confirmation without leaving the page.
  • Use Alerts for inline status; reserve Modals for multi-field or blocking tasks.

Recipe

  1. Place an .alert under the page title for context (counts, warnings).
  2. Add a horizontal row: .btn-group for view toggles + primary/secondary .btn actions.
  3. Render list/table content below the toolbar.
  4. Keep the .modal root in the DOM with hidden; open via data-modal-open.
  5. Call wireAllButtonGroups() and wireAllModals() after load (see reference scripts below).

Live demo

3 drafts pending review

Export or archive items from the toolbar. Changes sync when you refresh.

Table or card list goes here. This recipe focuses on the feedback + action row above the content.

Copy markup

<section class="page-panel" aria-labelledby="panel-title">
  <h1 id="panel-title" class="heading-h3">Projects</h1>
  <div class="alert alert--information alert--with-icon" role="status">
    <span class="alert__icon" aria-hidden="true">…</span>
    <div class="alert__content">
      <p class="alert__title">3 drafts pending review</p>
      <p class="alert__body">Export or archive from the toolbar.</p>
    </div>
  </div>
  <div class="toolbar-row">
    <div class="btn-group" role="group" aria-label="View" data-button-group-live=""><button type="button" class="btn-group__item btn-group__item--selected" aria-pressed="true">List</button><button type="button" class="btn-group__item" aria-pressed="false">Grid</button></div>
    <button type="button" class="btn btn--primary" data-modal-open="export-modal">Export</button>
  </div>
  <div class="modal" id="export-modal" data-modal-live="" hidden="">…</div>
</section>

Behavior (reference)

// See docs-site/src/lib/button-group-behavior.ts (single-select, radiogroup, optional multi-toggle).