Skip to content

UI kit ​

The runtime serves a stylesheet that gives your panel the platform's look and feel without rebuilding it by hand.

html
<head>
  <link rel="stylesheet" href="/sdk/plugin-ui.css">
  <script src="/sdk/plugin-frontend.js"></script>
</head>

It comes from two tested design systems, so your plugin looks and behaves like the app around it:

  • The UnCorded shell's colours. Every kit token is built from the --uncorded-* theme the SDK pushes into your iframe (Theming). It follows the user's theme, light or dark, and their accent.
  • T3 Code's components. This is the system the shell's own Select and tooltips are adapted from:
    • 36px controls with 16px text on touch, and 32px with 14px text with a mouse
    • a hairline edge on every control
    • a press that scales to 0.97
    • a focus ring drawn inside the border
    • 0.64 opacity when disabled
    • glass dialogs that rise in over 200ms and become bottom sheets on narrow screens

It's plain CSS with no build step and no framework. Nothing on your page changes until you use a uc-* class. The element defaults it sets (body font, focus ring, box sizing) have zero specificity, so any rule you write wins. Your own :root { --uc-… } overrides win in the light theme too.

The kit is a floor, not a ceiling. Use it for the parts every plugin needs, and give the parts that make your plugin yours their own look on the same tokens.

The SDK script (/sdk/plugin-frontend.js) wires the behaviour the kit's markup promises: data-open, data-close and backdrop clicks for dialogs, and placement and arrow keys for menus. You write no JS for these. Opt out with <html data-uncorded-kit-behaviors="off">.

The kit honours the user's settings: reduced motion, prefers-contrast: more, and Windows Contrast themes, where checkboxes and switches fall back to native controls and the chosen option uses the system's selection colours.

Tokens ​

The names follow the shadcn vocabulary the shell and T3 both use:

  • Surfaces:
    • --uc-background is behind everything.
    • --uc-card and --uc-popover are raised surfaces.
    • --uc-field is the background of fields and outline buttons.
    • --uc-secondary is a faint fill; --uc-hover is the fill under a hovered row, menu item or ghost button.
    • The user's accent colour is --uc-brand, not an "accent" token.
  • Text:
    • --uc-foreground is the main text colour.
    • --uc-muted-foreground is secondary text.
    • --uc-dim-foreground is quiet text.
  • Lines:
    • --uc-border is for separators and cards.
    • --uc-input is a stronger edge, used on buttons and pills.
    • --uc-field-edge (a field's border) and --uc-control-edge (an unticked checkbox or radio) are stronger again in light, so they can be found.
  • Actions:
    • --uc-primary and --uc-primary-foreground are the call to action and its text.
    • --uc-brand is the theme's accent hue.
    • --uc-ring is the focus ring colour.
  • Status: --uc-destructive, --uc-success and --uc-warning. Each comes with three variants:
    • --uc-on-* is text on a fill of that colour.
    • --uc-*-foreground is readable text in that colour on a surface.
    • --uc-*-surface is a soft fill. --uc-brand-surface and --uc-brand-foreground exist too.
  • Geometry and depth:
    • --uc-radius (8px) is the control radius. The scale around it is -sm 4, -md 6, -xl 12 and -2xl 16.
    • --uc-hairline (drawn on the border, as in T3) and --uc-shadow-xs are the control edge and its shadow.
    • --uc-shadow-popup, --uc-shadow-dialog and --uc-shadow-toast are overlay shadows.
  • Motion: --uc-ease, --uc-ease-out, --uc-duration (150ms) and --uc-duration-enter (200ms).
  • Density:
    • --uc-text, --uc-h, --uc-h-sm, --uc-h-lg, --uc-h-xs and --uc-icon switch between the touch and mouse sizes for you.
    • --uc-touch is the 44px minimum hit area.
    • --uc-top-gap is the room to leave at the top of a touch panel, where the shell's panel toolbar floats.
css
.my-tile { background: var(--uc-card); border: 1px solid var(--uc-border); border-radius: var(--uc-radius-xl); }
.my-tile[aria-selected="true"] { background: var(--uc-brand-surface); }

Buttons ​

html
<button class="uc-btn uc-primary">Save</button>
<button class="uc-btn">Cancel</button>

Variants. A plain uc-btn is the outline button for everyday actions. Use uc-primary for the one main action on a screen. The other variants are:

  • uc-secondary
  • uc-ghost
  • uc-destructive, the filled final "Delete" in a confirmation
  • uc-destructive-outline, a delete button that sits among other actions
  • uc-link

Sizes and states:

  • Sizes are uc-xs, uc-sm and uc-lg.
  • uc-icon-only makes an icon-only button. Give it an aria-label: that names it for screen readers and becomes its tooltip. Tooltips never open on touch, so add <span class="uc-touch-label">Add</span> where the words matter: only a touch screen shows it.
  • uc-wrap lets a long label wrap instead of running out of the button.
  • aria-busy="true" shows a spinner without changing the width.
  • disabled works as usual and still shows its tooltip on hover, so say why in data-tooltip, and put the same words beside it with aria-describedby for touch and screen readers. aria-disabled="true" keeps the button focusable but ignores the pointer.

Fields ​

html
<div class="uc-field">
  <label class="uc-label" for="amount">Amount</label>
  <input class="uc-input" id="amount" inputmode="decimal" aria-describedby="amount-help amount-error">
  <p class="uc-description" id="amount-help">Before tax.</p>
  <p class="uc-error" id="amount-error" role="alert"></p>
</div>

The aria-describedby link reads the help and the error after the field's name. An empty uc-error is hidden; fill it to show a problem, and screen readers announce it.

Fields:

  • uc-input works on <input> and <textarea>. A textarea grows with its content, up to 256px.
  • For a <select>, wrap it in <span class="uc-select"> to get the chevron. Without the wrapper it keeps the browser's own arrow.
  • aria-invalid="true" plus a uc-error line shows a problem.
  • Fields use 16px text on touch, so iOS never zooms in.

Checkboxes, radios and switches:

  • Checkboxes are <input type="checkbox" class="uc-checkbox">. The indeterminate state works too.
  • Radios are <input type="radio" class="uc-radio">.
  • Switches are <input type="checkbox" role="switch" class="uc-switch">.
  • Wrap any of them in <label class="uc-choice"> with its text, so the whole row is the hit target.

Choices ​

  • Segmented control: for one choice out of a few, use native radios. Arrow keys, "1 of 3" and the group's name come free:

    html
    <div class="uc-segmented" role="radiogroup" aria-label="Range">
      <label><input type="radio" name="range" class="uc-sr-only" checked> Week</label>
      <label><input type="radio" name="range" class="uc-sr-only"> Month</label>
    </div>

    For tabs, use buttons with role="tab" and aria-selected. The chosen segment is raised and bold.

  • Pill toggles: uc-pills holds uc-pill buttons, with aria-pressed. Use them for independent filters. A chosen pill is tinted and ticked.

Cards, lists and status ​

  • Cards:

    • uc-card is a card; uc-flush removes its padding so a list can run edge to edge.
    • uc-group-label is the heading above a group, as on the shell's settings pages. Use a real heading element (<h2 class="uc-group-label">).
  • Lists: uc-list holds uc-row rows. Each row has these parts:

    • uc-row-content, wrapping uc-row-title and uc-row-description
    • uc-row-end

    Make a row a <button> or <a> when it opens something; only then does it get hover and press states. A title wraps to two lines before it is cut. uc-dense makes a compact list; uc-long skips rendering rows that are off screen, for lists in the hundreds.

  • Status: uc-badge and uc-dot, with a tone: uc-brand, uc-success, uc-warning or uc-destructive. Badges also take uc-outline. A dot is colour only, so always put the words beside it (a badge such as "Overdue").

  • Alerts: uc-alert is an inline, persistent message, with an icon, uc-alert-content (holding uc-alert-title and uc-alert-description) and optional uc-alert-actions.

Empty and loading ​

html
<div class="uc-empty">
  <div class="uc-empty-media"><svg class="uc-icon">…</svg></div>
  <h3 class="uc-empty-title">No bills yet</h3>
  <p class="uc-empty-description">Add the ones that come every month and we'll line them up against your paydays.</p>
  <button class="uc-btn uc-primary">Add a bill</button>
</div>

An empty state teaches: what goes here, and the one action that starts it.

  • uc-skeleton holds the layout while data loads, with T3's stepped pulse. uc-card-shape and uc-pill-shape change its corners. Set aria-busy="true" on the region that is loading, and keep one role="status" line that says what is happening ("Loading bills…", then "12 bills").
  • uc-spinner is for short waits. It's decorative: mark it aria-hidden="true" and say it in the status line.

Dialogs and sheets ​

uc-dialog and uc-sheet style a native <dialog>. The browser gives you the top layer, Escape to close, focus moved inside and back again, and an inert page behind. The SDK script does the rest: data-open="id" opens it, data-close closes it, and so does a click on the backdrop (add data-static to allow only the buttons).

html
<button class="uc-btn uc-primary" data-open="add-bill">Add a bill</button>

<dialog class="uc-dialog" id="add-bill" aria-labelledby="add-bill-title">
  <form method="dialog">
    <header class="uc-dialog-header">
      <h2 class="uc-dialog-title" id="add-bill-title">Add a bill</h2>
      <p class="uc-dialog-description">Due dates show on the calendar.</p>
    </header>
    <div class="uc-dialog-panel">…fields…</div>
    <footer class="uc-dialog-footer">
      <button class="uc-btn" type="button" data-close>Cancel</button>
      <button class="uc-btn uc-primary" value="save">Save bill</button>
    </footer>
  </form>
  <button class="uc-btn uc-ghost uc-icon-only uc-dialog-close" aria-label="Close" data-close>…</button>
</dialog>

The <form method="dialog"> is optional: Enter submits, and the dialog's returnValue is the pressed button's value. It stays out of the layout, so the panel still scrolls and the footer stays pinned.

Dialog:

  • A glass panel 512px wide (uc-wide makes it 640px) that rises in over 200ms.
  • On a touch screen under 640px wide it attaches to the bottom edge as a sheet, with the footer's buttons stacked, primary first. A narrow panel on a desktop keeps a real dialog with its buttons in a row.

Sheet: an opaque panel from the right edge, sliding 32px as it fades. Use uc-left or uc-bottom for the other edges. It takes the same header, panel and footer parts.

Which to use. Both are drawn inside your iframe, so they cover your panel only. Use them for quick tasks that belong to your panel. For a confirmation, or a task that needs the whole window, use the shell's modal surfaces and confirm.

uc-menu is the glass surface for an in-panel menu, opened with the popover attribute. The SDK script places it under its button (above it, or right-aligned, when there's no room) and gives role="menu" its keys: the arrows, Home and End, type-ahead, and Tab to leave. Picking a menuitemradio checks it and unchecks the rest of its group.

html
<button class="uc-btn" popovertarget="sort" aria-haspopup="menu">Sort</button>
<div class="uc-menu" id="sort" popover role="menu" aria-label="Sort">
  <div role="group" aria-labelledby="sort-by">
    <div class="uc-menu-label" id="sort-by">Sort by</div>
    <button class="uc-menu-item" role="menuitemradio" aria-checked="true">Due date</button>
    <button class="uc-menu-item" role="menuitemradio" aria-checked="false">Amount</button>
  </div>
  <hr class="uc-menu-separator">
  <button class="uc-menu-item uc-destructive" role="menuitem">Delete all paid</button>
</div>

uc-menu-shortcut shows a key at the end of an item. Add data-keep-open to a menu that should stay open after a pick.

Toasts inside your panel ​

uc-toast-region with role="status" holds uc-toast cards in the top-right corner, sliding in from the edge. Use them for feedback about something the user just did in your panel, especially with an Undo. Keep the region in the page from the start, so the first toast is announced. Give a toast at least 6 seconds (15 on touch), and stop its clock while it's hovered or focused, so the Undo can be reached:

html
<div class="uc-toast-region" role="status" aria-live="polite">
  <div class="uc-toast">
    <div class="uc-toast-content"><div class="uc-toast-title">Electric deleted</div></div>
    <button class="uc-btn uc-primary uc-xs">Undo</button>
  </div>
</div>

For a message that should reach the user wherever they are in the app, use the shell's toast instead. It takes an Undo button too: sdk.platform.toast.show({ message, action: { label: "Undo", onAction } }) (Frontend SDK).

Helpers ​

  • uc-num gives tabular numbers.
  • uc-muted gives muted text.
  • uc-sr-only hides text visually but keeps it for screen readers.
  • uc-icon sizes an outline SVG icon with a 1.75 stroke.
  • uc-kbd is a key.
  • uc-separator is a dividing line.
  • uc-touch-label is text only a touch screen shows, for where a mouse gets a tooltip.