Appearance
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-backgroundis behind everything.--uc-cardand--uc-popoverare raised surfaces.--uc-fieldis the background of fields and outline buttons.--uc-secondaryis a faint fill;--uc-hoveris 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-foregroundis the main text colour.--uc-muted-foregroundis secondary text.--uc-dim-foregroundis quiet text.
- Lines:
--uc-borderis for separators and cards.--uc-inputis 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-primaryand--uc-primary-foregroundare the call to action and its text.--uc-brandis the theme's accent hue.--uc-ringis the focus ring colour.
- Status:
--uc-destructive,--uc-successand--uc-warning. Each comes with three variants:--uc-on-*is text on a fill of that colour.--uc-*-foregroundis readable text in that colour on a surface.--uc-*-surfaceis a soft fill.--uc-brand-surfaceand--uc-brand-foregroundexist too.
- Geometry and depth:
--uc-radius(8px) is the control radius. The scale around it is-sm4,-md6,-xl12 and-2xl16.--uc-hairline(drawn on the border, as in T3) and--uc-shadow-xsare the control edge and its shadow.--uc-shadow-popup,--uc-shadow-dialogand--uc-shadow-toastare 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-xsand--uc-iconswitch between the touch and mouse sizes for you.--uc-touchis the 44px minimum hit area.--uc-top-gapis 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-secondaryuc-ghostuc-destructive, the filled final "Delete" in a confirmationuc-destructive-outline, a delete button that sits among other actionsuc-link
Sizes and states:
- Sizes are
uc-xs,uc-smanduc-lg. uc-icon-onlymakes an icon-only button. Give it anaria-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-wraplets a long label wrap instead of running out of the button.aria-busy="true"shows a spinner without changing the width.disabledworks as usual and still shows its tooltip on hover, so say why indata-tooltip, and put the same words beside it witharia-describedbyfor 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-inputworks 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 auc-errorline 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">. Theindeterminatestate 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"andaria-selected. The chosen segment is raised and bold.Pill toggles:
uc-pillsholdsuc-pillbuttons, witharia-pressed. Use them for independent filters. A chosen pill is tinted and ticked.
Cards, lists and status
Cards:
uc-cardis a card;uc-flushremoves its padding so a list can run edge to edge.uc-group-labelis the heading above a group, as on the shell's settings pages. Use a real heading element (<h2 class="uc-group-label">).
Lists:
uc-listholdsuc-rowrows. Each row has these parts:uc-row-content, wrappinguc-row-titleanduc-row-descriptionuc-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-densemakes a compact list;uc-longskips rendering rows that are off screen, for lists in the hundreds.Status:
uc-badgeanduc-dot, with a tone:uc-brand,uc-success,uc-warningoruc-destructive. Badges also takeuc-outline. A dot is colour only, so always put the words beside it (a badge such as "Overdue").Alerts:
uc-alertis an inline, persistent message, with an icon,uc-alert-content(holdinguc-alert-titleanduc-alert-description) and optionaluc-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-skeletonholds the layout while data loads, with T3's stepped pulse.uc-card-shapeanduc-pill-shapechange its corners. Setaria-busy="true"on the region that is loading, and keep onerole="status"line that says what is happening ("Loading bills…", then "12 bills").uc-spinneris for short waits. It's decorative: mark itaria-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-widemakes 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.
Menus
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-numgives tabular numbers.uc-mutedgives muted text.uc-sr-onlyhides text visually but keeps it for screen readers.uc-iconsizes an outline SVG icon with a 1.75 stroke.uc-kbdis a key.uc-separatoris a dividing line.uc-touch-labelis text only a touch screen shows, for where a mouse gets a tooltip.