Expand description
The DOM widget catalog (CSS-styled controls, select popover, chat blocks).
The DOM widget catalog: ready-made El trees for the common controls and chat
building blocks, styled by KIT_CSS (every look is a CSS rule an app may override
by appending its own sheet, see sheet_with).
| widget | builder | element / classes | hit ids |
|---|---|---|---|
| button | button | button.k-btn (.primary, .ghost) | id |
| switch | switch | button.k-switch + Control::Switch (:checked) | id |
| checkbox | checkbox | div.k-check > span.k-box + Control::Checkbox | id |
| text input | input | div.k-input + Control::Input (:focus) | id |
| spinner | spinner | span.k-spinner + Control::Spinner | — |
| select trigger | select_trigger | select.k-select (.open) | id |
| select popover | select_popover | fixed div.k-pop > div.k-opt (.sel, .dis) > label + div.k-sub | {id}:opt:{i} (enabled rows only) |
| message bubble | bubble | div.k-msg.me / .them > div.k-who, div.k-body (runs), div.k-time | id |
| hover action row | action_row | div.k-actions > button.k-act | {id}:{key} |
| collapsible card | card | div.k-card (.open) > div.k-card-head + div.k-card-body | id (the head) |
| chip / filter | chip | button.k-chip (.on) | id |
| banner | banner | div.k-banner.info / .warn / .error | {id}:act, {id}:close |
| side panel | side_panel | fixed div.k-side > div.k-side-head + div.k-side-body | {id}:close |
Inline markdown for bubbles is inline_md; long lists render only their visible
rows with VirtualList. Kit widgets from uzor-framework go inside a DOM tree
through an embed slot (El::slot + Dom::slots); a
DOM tree goes inside a kit panel by laying it out in the panel’s rect.
Modules§
- icons
- Icon bodies used by the catalog.
Structs§
- List
View - What part of a long option list a popover shows. The select’s own model (keyboard, wheel, type-to-filter) keeps it; the popover only draws it.
- Select
Opt - One option of a select.
- Virtual
List - A virtualized list: only the rows in (or near) the viewport are built and laid out;
spacers stand for the rest. Row heights start at an estimate and are learned from
laid-out rows (
VirtualList::measure), so long chats stay cheap. - Window
- The rows a
VirtualListshows and the space around them.
Constants§
- KIT_CSS
- The catalog’s default look (dark, 13px Inter). Variables on
:roottheme it:--k-accent,--k-bg,--k-fg,--k-muted,--k-line,--k-panel.
Functions§
- action_
row - A hover action row (reply, react, copy, more…):
(key, icon body, name)per button, hits{id}:{key}. - banner
- A banner (
kind:info,warn,error) with an optional action button ({id}:act) and a close button ({id}:close). - bubble
- A chat message bubble: optional sender line, markdown body (
inline_md), time. - button
- A push button.
- card
- A collapsible card: the head (hit
id) togglesopen; the body shows when open. - checkbox
- A checkbox with its label; the row is the hit.
- chip
- A filter chip.
- icon
- A 24×24 stroke icon (
currentColor) from its path markup. - inline_
md - Inline markdown to DOM runs:
**bold**,*italic*/_italic_,***both***,`code`(verbatim), http(s) links (a.link, hiturl:…) and@nickmentions (a.mention, hitnick:…). Unclosed markers stay literal;_only opens at a word start and closes at a word end (snake_casestays as is). - input
- A single-line text input showing
edit. - picked_
opt - The option index a select popover hit id names (
{id}:opt:{i}). - popover_
at - Where a popover
htall goes for a trigger atanchorinviewport: below it, or above when it does not fit below and fits better above; at least the trigger’s width. - select_
list select_popoverfor a windowed, searchable list: rowsview.top ..ofopts(the already filtered options; hits keep their index inopts), the highlighted row, a search line and a scroll thumb. “No matches” whenoptsis empty. The popover isposition: fixedatat, soatis in the coordinates of the viewport given tolay_out_in(the window, origin 0,0). Its rows’--k-accent(the chosen row’s tick) can be set inline on the returned element.- select_
popover - The open select’s list as a
position: fixedpopover atat(seepopover_at): it paints above the page and does not scroll with it. Enabled rows are hits{id}:opt:{i};chosenis marked.sel(with a tick). - select_
trigger - The closed select: the chosen label and a chevron.
- sheet
KIT_CSSparsed.- sheet_
with KIT_CSSfollowed by the app’s own rules (later rules of equal specificity win).- side_
panel - A side panel docked right (
position: fixed: it stays while the page scrolls), with a title row and a close button ({id}:close). - slot
- An embed slot box (
div.k-slot) namedkey,w×h: a kit widget or canvas goes in its content box (seeDom::slots). - spinner
- A busy spinner at time
tseconds. - switch
- A switch (
role="switch"): the track is the button’s box, the knob its control. - switch_
at - A switch whose knob is at
pos(0 … 1) while it slides.