ui_kit library
The UI kit: DOM helpers, form widgets, toasts and modals.
Small, framework-free primitives over package:web — enough to build a real
app without a framework, and shared so that two OmnyGrid web apps look and
behave like one product.
These widgets are styled by CSS classes, not inline styles, so a
consuming app must ship the stylesheet that defines them (.primary,
.field, .banner, .badge, .modal, .toast, …). Install it with:
dart run omnyshell_web:copy_assets
which copies kit.css (tokens, base, widgets, modal, toasts) and
terminal.css (terminal chrome, key bar, fullscreen, keyboard insets) into
your web/. Without them the widgets render unstyled.
Classes
Functions
-
aiSettingsSection(
AiSettingsController ai) → List< HTMLElement> - The AI-agent settings controls, bound to an AiSettingsController.
-
A primary or secondary button. When
loadingit shows a spinner and is disabled. -
checkbox(
String label, {required String id, bool checked = false}) → ({HTMLInputElement box, HTMLElement root}) - A checkbox with a label.
-
clearChildren(
Element parent) → void -
Removes all children of
parent. -
div(
{String? classes, String? text, List< Node> children = const []}) → HTMLElement -
A
<div>with optionalclassesandchildren. -
el(
String tag, {String? classes, String? text, String? id, String? role, String? ariaLabel, Map< String, String> ? attrs, List<Node> children = const [], void onClick(Event event)?}) → HTMLElement -
Ergonomic DOM construction over
package:web. -
emptyState(
String message) → HTMLElement - A centered empty-state message.
-
errorBanner(
AppError error) → HTMLElement -
An error banner rendering
error's message and optional recovery hint. -
field(
String label, HTMLElement input, {String? hint}) → HTMLElement -
A labelled form field wrapping
input, with an optionalhint. -
input(
{required String id, String type = 'text', String? value, String? placeholder, String? autocomplete, String? autocapitalize, void onEnter()?}) → HTMLInputElement -
A text/password/url/number input. Returns the element so callers can read
.value. -
loadingRow(
[String? label]) → HTMLElement - A spinner row with an optional label, for inline loading states.
-
mount(
Element parent, Node child) → void -
Replaces the entire content of
parentwithchild. -
on(
EventTarget target, String event, void handler(Event event)) → void Function() -
Attaches
handlertoeventontarget, returning a disposer that detaches it (handy for components that re-render and must avoid listener leaks). -
radioGroup(
{required String name, required List< ({String label, String value})> options, required String selected, required void onChange(String value), bool inline = false, String? ariaLabel}) → HTMLElement -
A radio-button group. Each option is a
(value, label)pair;selectedis the initially-checked value andonChangefires with the newly-picked value. Setinlineto lay the options out in a row (e.g. a segmented control), andariaLabelto name the group for assistive tech. -
statusBadge(
{required bool online}) → HTMLElement - A small online/offline status pill.
-
textNode(
String value) → Text -
A text node, for mixing raw strings into
childrenlists.