Slab

What's new

Slab 0.1.3

Nine new components, from Menubar to Color Picker, and ranges of days in Calendar.

0.1.3 is Slab's biggest release since the first. It fills in most of what was left of the APG's patterns, with nine new components and a range attribute for Calendar. Each is headless, as ever: the keyboard, focus, ARIA and forms are done, and the look is yours. Every example below is live, and styled the way this site styles them.

0.1.3 isn't on npm yet. This is what's in it, from main, ahead of the release.

A row of Menus, such as File, Edit and View, as in a desktop app. Tab reaches it once, and Left and Right move between the Menus, open or not. Each Menu is a plain slab-menu, unchanged.

New job Duplicate job Archive job Schedule a pour Order a mix Export report Print report
Usage
HTML
<script type="module">
  import 'slab-elements/menubar.js';
</script>

<slab-menubar label="Editor">
  <slab-menu label="File">
    <button slot="anchor">File</button>

    <slab-menu-item>New</slab-menu-item>
    <slab-menu-item>Open…</slab-menu-item>
  </slab-menu>

  <slab-menu label="Edit">
    <button slot="anchor">Edit</button>

    <slab-menu-item>Undo</slab-menu-item>
    <slab-menu-item>Redo</slab-menu-item>
  </slab-menu>
</slab-menubar>
Read the Menubar docs

Context Menu

Menu Items in place of the browser's own menu, opened at the pointer on a right-click, where it was pressed on a long-press, and from the keyboard with Shift+F10 or the Menu key.

Right-click or long-press the pour
Schedule a pour Duplicate job Export report Call the inspector
Usage
HTML
<script type="module">
  import 'slab-elements/context-menu.js';
  import 'slab-elements/menu.item.js';
</script>

<slab-context-menu label="File">
  <div slot="target" tabindex="0">Right-click me</div>

  <slab-menu-item>Rename</slab-menu-item>
  <slab-menu-item>Duplicate</slab-menu-item>
  <slab-menu-item disabled>Delete</slab-menu-item>
</slab-context-menu>
Read the Context Menu docs

Slides in a CSS scroll snap container, so swiping and scrolling are the browser's own. Previous, Next and the markers are real buttons, so they work and look the same in every browser, and slides out of view are inert.

Forms

Set and braced by 6 a.m. Check the grade stakes before the truck backs in.

Pour

38 cubic yards of 4,000 psi, placed from the northeast corner.

Finish

Bull float, edge, then a broom finish across the slope.

Cure

Keep it wet for seven days before it takes a load.

Usage
HTML
<script type="module">
  import 'slab-elements/carousel.js';
</script>

<slab-carousel label="Featured">
  <figure>…</figure>
  <figure>…</figure>
  <figure>…</figure>
</slab-carousel>
Read the Carousel docs

Color Picker

A saturation and brightness area, hue and alpha sliders, a hex field and swatches, all from the keyboard as well as the pointer. The form gets a "#rrggbb", or "#rrggbbaa" with alpha.

Acid stain reacts with the lime in the slab, so the cured color varies.
Usage
HTML
<script type="module">
  import 'slab-elements/color-picker.js';
</script>

<slab-color-picker label="Fill" name="fill" value="#3399ff" swatches="#ff0000 #00ff00 #0000ff" alpha></slab-color-picker>
Read the Color Picker docs

Rating

Native radios, one per star, that preview the value under the pointer. With step="0.5", each star is two radios, so the value can be a half.

How smooth the slab came out of the trowel.
Usage
HTML
<script type="module">
  import 'slab-elements/rating.js';
</script>

<slab-rating label="Rating" name="rating" value="3"></slab-rating>
Read the Rating docs

Pin Input

A PIN or one-time code as a row of inputs that submits as one value. A pasted or autofilled code is spread across them, with separators like "-" left out.

Sent to the foreman's phone. Try pasting "482-913".
Usage
HTML
<script type="module">
  import 'slab-elements/pin-input.js';
</script>

<slab-pin-input label="Verification code" name="code" autocomplete="one-time-code" required></slab-pin-input>
Read the Pin Input docs

Splitter

Two panes and a separator between them that resizes them. Drag it, move it with the arrow keys, or press Enter to collapse the first pane and restore it.

Mixes

Footing, slab, wall.

Slab

4,000 psi, a 4-inch slump, broom finish. Cure for seven days before it takes a load.

Usage
HTML
<script type="module">
  import 'slab-elements/splitter.js';
</script>

<slab-splitter label="Sidebar" min="15" max="50" value="25">
  <nav slot="primary">…</nav>
  <main slot="secondary">…</main>
</slab-splitter>
Read the Splitter docs

Range Slider

Two thumbs on one track for a range, such as a price from and to. They can meet but not pass, and the form gets both values.

Inches. Most slabs pour between 3 and 5.
Usage
HTML
<script type="module">
  import 'slab-elements/range-slider.js';
</script>

<slab-range-slider label="Price" name="price" min="0" max="500" start-value="100" end-value="300"></slab-range-slider>
Read the Range Slider docs

Time Field

A native time input with the same API as Date Field. Its value is a 24-hour "hh:mm" whatever clock the browser shows, and a max earlier than min is a range across midnight.

Trucks leave the plant on the quarter hour.
Usage
HTML
<script type="module">
  import 'slab-elements/time-field.js';
</script>

<slab-time-field label="Start time" name="start" min="09:00" max="17:00" required></slab-time-field>
Read the Time Field docs

Calendar ranges

Calendar takes range, to pick a range of days rather than one. The first day picked starts it and the second ends it, and value is an ISO 8601 interval, "yyyy-mm-dd/yyyy-mm-dd".

Usage
HTML
<script type="module">
  import 'slab-elements/calendar.js';
</script>

<slab-calendar range value="2026-03-09/2026-03-13"></slab-calendar>
Read the Calendar docs

Upgrade

It's a patch release, with nothing to change in what you have.

Install
pnpm add slab-elements@0.1.3