kitchen-ui
The shared UI of the neuro-kitchen apps, for desktop apps built on GPUI through gpui-kit:
- Design tokens:
- spacing on an 8 px grid;
- a type scale on a 15 px base;
- radii by size and gaps between panes;
- plain grey neutrals for light and dark themes, plus status colours.
- Accents:
- each app supplies a default palette (
Palette::LIME,Palette::EOSIN, or its own); - the user can pick any colour instead.
Palette::from_rgbkeeps its hue and changes only its lightness until text, fills and marks pass WCAG contrast in both themes (in the dark theme it also makes the colour less saturated).
- each app supplies a default palette (
- Widgets: accent picker, titled section, labelled row (the control drops under its label when the panel is narrow), slider, dropdown, stepper, dragged number, colour swatch, empty state, icon button.
- Parameter editor: edits any op that serialises to a JSON object. Numbers become inputs, choices become menus and switches become checkboxes.
- Icons:
AppAssetsships gpui-kit's icons plus the ones an app adds;assert_icons_bundledis a test helper that scans an app's sources for every icon name it uses (aliases included) and fails if any of them is not shipped.
Usage
use ;
use ;
application.with_assets.run;
// In a view's render:
new.child;
Gallery
cargo run -p kitchen-ui --example gallery (in the repository) opens a window showing every
widget and token:
- the labelled rows in a wide pane and a narrow one;
- a boxed section and icon buttons;
- the parameter editor on a demo band filter;
- an empty state;
- every colour token with its hex value, the type scale and the spacing scale.
Its header switches dark and light, the app palette, the accent (suggested swatches or any colour) and the text size. A headless test draws the gallery in every look.
Licence
MIT OR Apache-2.0, at your option: LICENSE-MIT, LICENSE-APACHE.