Yeti with UI SDK

UI SDK brings the behavior: the keyboard, the focus, the state. The elements stay yours, out in the open where Yeti can style them. This page takes one form apart to show the seam, then shows two things you can only do with open parts.

Who does what

Part of the page Yeti UI SDK The bridge
Layout and spacing between things Yes
Text, headings, links, tables Yes
Your own fields, buttons and cards Yes
An input or button inside a ui- tag Yes
What it does: keys, focus, state Yes
Its tracks, thumbs, stars and popups Yes
The color, corners, height and type of those Yes

The fourth row is the one to remember. A ui- tag has no shadow root, so a button inside one is an ordinary button on your page. Compare it with Web Awesome, where what the tag builds for itself is sealed, and only what you slot into it is yours.

What to load

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ui-sdk/[email protected]/browser/web.css">
<link rel="stylesheet" href="yeti.css">
<link rel="stylesheet" href="bridge.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@ui-sdk/[email protected]/browser/web.js"></script>
<script type="module" src="yeti.js"></script>

The script is a small loader. It fetches a component the first time its tag appears, so you pay for what you use.

The first stylesheet is optional. It is UI SDK's default look, in one cascade layer. Link it before Yeti, so that Yeti's layers outrank it. It styles its own parts and a few bare elements, and two of those get past Yeti, which never set the property: it frames every kbd and fills every hr. The bridge puts both back. Leave it out and you draw every part yourself, which the toolbar below does.

The frames on this page also load this site's own theme, which is why they are teal. You do not need it.

One form, taken apart

A search for a room. Yeti has the text field, the button and a plain select. It has no field that filters a list as you type, no slider with two handles and no star rating.

Step 1: Yeti alone

View Code
<form class="stack" data-gap="md">
  <div class="field">
    <label for="guest">Name</label>
    <input id="guest" value="Ines Moreau">
  </div>
  <div class="field">
    <label for="city">City</label>
    <select id="city">
      <option>Choose a city</option>
      <option>Bergen</option>
      <option>Granada</option>
      <option>Lisbon</option>
      <option>Trieste</option>
      <option>Utrecht</option>
    </select>
  </div>
  <!-- a price range and a rating go here -->
  <p><button class="button" type="button">Search</button></p>
</form>

Step 2: the library added

The select becomes a combobox, and a price range and a rating join it. They work. The slider is black, or white if your screen is dark, its handles are square, and its own labels are small.

Look closely at the combobox. Its corners and its type are already Yeti's, and it is nobody's bridge that did it: the input is yours, so Yeti's base styles reached it. Its height is not Yeti's, because UI SDK's default look sets that.

View Code
<form class="stack" data-gap="md">
  <div class="field">
    <label for="guest">Name</label>
    <input id="guest" value="Ines Moreau">
  </div>
  <ui-combobox>
    <ui-combobox-label>City</ui-combobox-label>
    <ui-combobox-input><input placeholder="Type to search"></ui-combobox-input>
    <ui-combobox-content hidden>
      <ui-combobox-empty>No city by that name.</ui-combobox-empty>
      <ui-combobox-list>
        <ui-combobox-item value="bergen">Bergen</ui-combobox-item>
        <ui-combobox-item value="granada">Granada</ui-combobox-item>
        <ui-combobox-item value="lisbon">Lisbon</ui-combobox-item>
        <ui-combobox-item value="trieste">Trieste</ui-combobox-item>
        <ui-combobox-item value="utrecht">Utrecht</ui-combobox-item>
      </ui-combobox-list>
    </ui-combobox-content>
  </ui-combobox>
  <div class="stack" data-gap="sm">
    <strong>Price a night</strong>
    <ui-slider aria-label="Price a night" default-value="60/180" min="0" max="300">
      <ui-slider-value></ui-slider-value>
      <ui-slider-control><ui-slider-track><ui-slider-indicator></ui-slider-indicator><ui-slider-thumb aria-label="Lowest price"></ui-slider-thumb><ui-slider-thumb aria-label="Highest price"></ui-slider-thumb></ui-slider-track></ui-slider-control>
    </ui-slider>
  </div>
  <ui-field>
    <ui-field-label>At least this good</ui-field-label>
    <ui-rating default-value="4"></ui-rating>
  </ui-field>
  <p><button class="button" type="button">Search</button></p>
</form>

Step 3: the bridge added

One stylesheet, and one class: the combobox now has Yeti's field. That class styles the input inside it and sets the gap under its label, the same as in any Yeti field, so the two controls match in height, corners, line, fill and type. The bridge colors the parts that are not plain elements: the track, the handles, the stars and the list.

Dark needs no second switch. Every value the bridge passes over is a Yeti token that already knows about both.

View Code
<form class="stack" data-gap="md">
  <div class="field">
    <label for="guest">Name</label>
    <input id="guest" value="Ines Moreau">
  </div>
  <ui-combobox class="field">
    <ui-combobox-label>City</ui-combobox-label>
    <ui-combobox-input><input placeholder="Type to search"></ui-combobox-input>
    <ui-combobox-content hidden>
      <ui-combobox-empty>No city by that name.</ui-combobox-empty>
      <ui-combobox-list>
        <ui-combobox-item value="bergen">Bergen</ui-combobox-item>
        <ui-combobox-item value="granada">Granada</ui-combobox-item>
        <ui-combobox-item value="lisbon">Lisbon</ui-combobox-item>
        <ui-combobox-item value="trieste">Trieste</ui-combobox-item>
        <ui-combobox-item value="utrecht">Utrecht</ui-combobox-item>
      </ui-combobox-list>
    </ui-combobox-content>
  </ui-combobox>
  <div class="stack" data-gap="sm">
    <strong>Price a night</strong>
    <ui-slider aria-label="Price a night" default-value="60/180" min="0" max="300">
      <ui-slider-value></ui-slider-value>
      <ui-slider-control><ui-slider-track><ui-slider-indicator></ui-slider-indicator><ui-slider-thumb aria-label="Lowest price"></ui-slider-thumb><ui-slider-thumb aria-label="Highest price"></ui-slider-thumb></ui-slider-track></ui-slider-control>
    </ui-slider>
  </div>
  <ui-field>
    <ui-field-label>At least this good</ui-field-label>
    <ui-rating default-value="4"></ui-rating>
  </ui-field>
  <p><button class="button" type="button">Search</button></p>
</form>

Step 4: who owns what

Solid lines are Yeti. Dashed lines are UI SDK. The combobox has both: their component around it, your input in it.

What crosses the bridge: line color, corner radius, control height, type size, focus color, primary color.

Things to take from it:

  • You can put Yeti's classes on their tags. field, stack and cluster all work on a ui- tag, because it is only an element.
  • Their label is tied to their input. Do not add a Yeti label as well.
  • A range is the exception. Their field label would name the first handle as well as the group, and hide the handle's own name. So the heading is yours, the slider has an aria-label, and each handle keeps its own.
  • The slider and the rating are UI SDK's all the way through. There is no plain element in them for Yeti to style, so they are drawn by its default look and colored by the bridge.

A toolbar of Yeti buttons

This one loads no UI SDK stylesheet and no bridge. Every button is button class="button". UI SDK wraps them, makes the row a single tab stop, and moves between them with the arrow keys.

Press Bold and it looks pressed. Nothing on this page draws that. UI SDK sets aria-pressed on your button, and Yeti has always styled a button that says it is pressed. Two projects agreed because both follow the platform.

View Code
<div class="stack" data-gap="md">
  <ui-toolbar aria-label="Text style" class="cluster" data-gap="xs">
    <ui-toggle id="bold"><button class="button" data-emphasis="medium">Bold</button></ui-toggle>
    <ui-toggle id="italic"><button class="button" data-emphasis="medium">Italic</button></ui-toggle>
    <ui-toggle id="underline"><button class="button" data-emphasis="medium">Underline</button></ui-toggle>
    <ui-toolbar-button><button class="button" data-emphasis="low" id="clear">Clear</button></ui-toolbar-button>
  </ui-toolbar>

  <ui-color-picker aria-label="Text color" default-value="#2f7d6b" class="stack" data-gap="sm">
    <ui-color-picker-area><ui-color-picker-area-thumb></ui-color-picker-area-thumb></ui-color-picker-area>
    <ui-color-picker-slider channel="hue"><ui-color-picker-slider-thumb></ui-color-picker-slider-thumb></ui-color-picker-slider>
  </ui-color-picker>

  <p id="sample">The quick brown fox jumps over the lazy dog.</p>
</div>
/* Only the color picker. Yeti draws the buttons. */
ui-color-picker-area { display: block; block-size: 8rem; background: var(--color-area-background); border-radius: var(--yeti-radius-sm); }
ui-color-picker-slider { display: block; block-size: 1rem; background: var(--color-slider-background); border-radius: var(--yeti-radius-full); }
ui-color-picker-area-thumb, ui-color-picker-slider-thumb {
  inline-size: 1.25rem; block-size: 1.25rem; translate: -50% -50%;
  background: var(--color-picker-color); border: 3px solid white; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--yeti-color-border-strong);
}
ui-color-picker-slider-thumb { inset-block-start: 50%; }
:is(ui-color-picker-area-thumb, ui-color-picker-slider-thumb):focus-visible { outline: 3px solid var(--yeti-color-focus); outline-offset: 2px; }
<script type="module">
const sample = document.querySelector('#sample').style;
const on = (id, set) => document.querySelector(id).addEventListener('pressedchange', (event) => set(event.detail.value));
on('#bold', (yes) => { sample.fontWeight = yes ? '700' : ''; });
on('#italic', (yes) => { sample.fontStyle = yes ? 'italic' : ''; });
on('#underline', (yes) => { sample.textDecoration = yes ? 'underline' : ''; });
document.querySelector('ui-color-picker').addEventListener('valuechange', (event) => { sample.color = event.detail.value; });
document.querySelector('#clear').addEventListener('click', () => {
  document.querySelectorAll('ui-toggle').forEach((toggle) => { toggle.pressed = false; });
  sample.cssText = '';
});
</script>

The color picker is the other side of the bargain. With no stylesheet of theirs, its area, its slider and its thumbs arrive with no look at all. The CSS in the code above is all of it, and it is drawn with Yeti tokens.

A command list in a Yeti dialog

The dialog is Yeti's: a native dialog, opened by a button, with no script of yours. Inside it is UI SDK's command list. Type to filter, arrow to move, press Enter to run. The shortcuts shown at the end of a row run their command too.

UI SDK has a dialog too. You do not need it here. The browser already keeps focus inside and closes on Escape, and Yeti's own script sends focus back to the button.

One thing to watch. UI SDK switches its shortcuts off while its own dialog is shut. It does not know about yours, so they listen all the time, and the script ignores them until the dialog is open.

View Code
<button class="button" type="button" id="open-palette" commandfor="palette" command="show-modal">Run a command</button>

<dialog class="dialog" id="palette" aria-labelledby="palette-title">
  <h2 id="palette-title">Run a command</h2>
  <ui-command>
    <ui-command-input><input aria-label="Search commands" placeholder="Type a command" autofocus></ui-command-input>
    <ui-command-empty>Nothing by that name.</ui-command-empty>
    <ui-command-list>
      <ui-command-item value="invite" shortcut="mod+i"><span>Invite a person</span><ui-command-shortcut></ui-command-shortcut></ui-command-item>
      <ui-command-item value="export" shortcut="mod+e"><span>Export as a spreadsheet</span><ui-command-shortcut></ui-command-shortcut></ui-command-item>
      <ui-command-item value="archive"><span>Archive this project</span></ui-command-item>
    </ui-command-list>
  </ui-command>
  <footer>
    <form method="dialog"><button class="button" type="submit" data-emphasis="medium">Close</button></form>
  </footer>
</dialog>

<ui-toast-region></ui-toast-region>
<script type="module">
import { toast } from 'https://cdn.jsdelivr.net/npm/@ui-sdk/[email protected]/browser/web/toast.js';

const dialog = document.querySelector('#palette');
const said = { invite: 'Invite sent', export: 'Export started', archive: 'Project archived' };
document.querySelector('ui-command').addEventListener('action', (event) => {
  // Its shortcuts listen to the whole page, so a shut dialog has to say no.
  if (!dialog.open) return;
  dialog.close();
  toast(said[event.detail.value]);
});
</script>

Running a command closes the dialog and shows a toast, which is theirs. Yeti has none.

Where both have it

UI SDK has its own version of many Yeti parts. Pick one for each kind of thing, and use it all the way through.

Use Yeti's for:

  • buttons, badges, cards, dividers: UI SDK has no look to add
  • text fields, checkboxes, switches, plain selects, a slider with one handle: native controls, with the browser's own keyboard, validation and phone keyboards
  • a row of choices: Yeti's buttons around radio inputs
  • dialogs, tabs, accordions, dropdowns, tooltips: little or no script, and the same markup as the rest of your page

Use UI SDK's for:

  • comboboxes, command lists, ratings, color pickers, trees, token inputs, toasts: Yeti has none
  • a toolbar with one tab stop, and buttons that stay pressed
  • a slider with two handles

In React

The zero-build page is how Yeti ships. It is not a rule about your project. UI SDK has an adapter for React, and the class names are the same ones.

This is the form from step 3, without the rating. It was built with Vite and run with React 19.

import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList } from '@ui-sdk/react/combobox';
import { Slider, SliderControl, SliderIndicator, SliderThumb, SliderTrack, SliderValue } from '@ui-sdk/react/slider';

const cities = ['Bergen', 'Granada', 'Lisbon', 'Trieste', 'Utrecht'];

export function Search() {
  return (
    <form className="stack" data-gap="md">
      <div className="field">
        <label htmlFor="guest">Name</label>
        <input id="guest" defaultValue="Ines Moreau" />
      </div>
      <div className="field">
        <Combobox>
          <ComboboxLabel>City</ComboboxLabel>
          <ComboboxInput placeholder="Type to search" />
          <ComboboxContent>
            <ComboboxEmpty>No city by that name.</ComboboxEmpty>
            <ComboboxList>
              {cities.map((city) => (
                <ComboboxItem key={city} value={city} label={city}>{city}</ComboboxItem>
              ))}
            </ComboboxList>
          </ComboboxContent>
        </Combobox>
      </div>
      <div className="stack" data-gap="sm">
        <strong>Price a night</strong>
        <Slider aria-label="Price a night" defaultValue={[60, 180]} min={0} max={300}>
          <SliderValue />
          <SliderControl>
            <SliderTrack>
              <SliderIndicator />
              <SliderThumb index={0} aria-label="Lowest price" />
              <SliderThumb index={1} aria-label="Highest price" />
            </SliderTrack>
          </SliderControl>
        </Slider>
      </div>
      <p><button className="button" type="button">Search</button></p>
    </form>
  );
}

Import the three stylesheets once, in the same order as on a plain page:

import '@ui-sdk/core/web.css';
import './yeti.css';
import './bridge.css';

The bridge is the one below, unchanged. Its last rule is written against data-slot, which UI SDK puts on its parts in both forms. One difference: React renders no ui-combobox element, so field goes on a div around it.

The bridge

All of it. Copy it into your own stylesheet, after both.

/* UI SDK follows Yeti. Load after both stylesheets. */
:root {
  /* Surfaces and text */
  --ui-background: var(--yeti-color-surface);
  --ui-foreground: var(--yeti-color-text);
  --ui-muted: var(--yeti-color-neutral-soft);
  --ui-muted-foreground: var(--yeti-color-text-muted);

  /* Lines, corners and focus */
  --ui-border: var(--yeti-color-border);
  --ui-input: var(--yeti-control-border);
  --ui-radius: var(--yeti-radius-sm);
  --ui-ring: var(--yeti-color-primary-soft);
  --ui-ring-border: var(--yeti-color-focus);

  /* Action and error */
  --ui-primary: var(--yeti-color-primary);
  --ui-primary-foreground: var(--yeti-on-primary);
  --ui-destructive: var(--yeti-color-alert);

  /* Popups */
  --ui-overlay: var(--yeti-color-scrim);
  --ui-shadow: var(--yeti-shadow-md);

  /* Type and size. Its controls are eight spacing units tall. */
  --ui-font-mono: var(--yeti-font-mono);
  --ui-font-size: var(--yeti-text-md);
  --ui-line-height: var(--yeti-leading-md);
  --ui-spacing: calc(var(--yeti-control-size) / 8);
}

/* Its stylesheet frames every kbd and fills every hr. Yeti's stay Yeti's. */
kbd { border: 0; }
hr { background: none; }

/* Its labels are a size smaller and lighter than Yeti's. */
:is([data-slot="combobox-label"], [data-slot="field-label"]) {
  font-size: var(--yeti-text-md);
  font-weight: var(--yeti-weight-strong);
}
  • Surfaces and text. Yeti's surface and text tokens, straight across. The muted fill is Yeti's soft neutral, which shows as a track in both light and dark.
  • Lines, corners and focus. The line around a control and the line between things are different tokens in both systems.
  • Action and error. Yeti's alert is their destructive.
  • Type and size. UI SDK measures everything in one spacing unit, and its controls are eight of them tall. An eighth of Yeti's control size makes them the same height, and everything else follows.
  • The two bare elements. Yeti's kbd has no frame and its hr has no fill. These keep it so.
  • The last rule. Their labels have no variable for size or weight, so it is set on the part.

Limits

  • It is a beta. See the note at the top.
  • Without its stylesheet, popups such as the combobox's list keep the browser's plain border and background until you style them.
  • The date picker's header came out broken in an earlier run, with or without Yeti, so it is not shown here. Cally is a calendar that works.
  • Before the script loads, or if it never does, the input inside a combobox is a plain text field and the buttons in a toolbar are plain buttons. A slider or a rating shows nothing.
  • Vue, Svelte and Solid have adapters too. They were not run.
  • Screen readers were not tested.

Run on 24 November 2026 with UI SDK 0.1.0-beta.17 (Apache-2.0) and Yeti's current alpha, in Chromium, Firefox and WebKit, in light and dark, at 320 pixels, by keyboard, and with the network copy of UI SDK blocked.