RecursiveAI.OneApp.Kit (namespace OneApp.Kit) is a set of markup components whose look follows shadcn/ui's published design: the same sizes, radii, spacing,
states and colour tokens. It depends only on RecursiveAI.OneUI, so it runs natively and in the browser.
Every component is a normal OneUI component: a template, a stylesheet and a class. Parameters are typed; callbacks are Action or Action<T> parameters.
Using it
Wrap the page in a Theme. It declares the tokens, paints the background and sets the base text style.
<Theme Dark="{Dark}"> <Card> <CardHeader><CardTitle>Sign in</CardTitle><CardDescription>Use your work address.</CardDescription></CardHeader> <CardContent> <Label For="mail">Email</Label> <Input Id="mail" Type="email" Value="{Email}" OnValueChange="{v => Email = v}" /> </CardContent> <CardFooter><Button OnClick="{Submit}">Continue</Button></CardFooter> </Card> </Theme>
A project that uses the kit references OneApp.Kit; the markup compiler reads its components from the referenced assembly.
Tokens
Taken from the theming page of ui.shadcn.com, <https://ui.shadcn.com/docs/theming> ("Default Theme CSS", neutral base colour), on 2026-11-29. The names and values are the
published ones; --radius-sm to --radius-4xl are the scale the page derives from --radius. Theme.css declares them on .theme (light) and .theme.dark.
--font-sans and --font-mono are the kit's own: Geist first, then the system fonts. The kit does not ship font files.
An app themes by overriding tokens on an element inside the Theme; custom properties inherit:
.my-app { --primary: oklch(0.55 0.2 260); --primary-foreground: oklch(0.985 0 0); --radius: 0.5rem; }| Token | Light | Dark |
|---|---|---|
--radius | 0.625rem | (same) |
--background | oklch(1 0 0) | oklch(0.145 0 0) |
--foreground | oklch(0.145 0 0) | oklch(0.985 0 0) |
--card | oklch(1 0 0) | oklch(0.205 0 0) |
--card-foreground | oklch(0.145 0 0) | oklch(0.985 0 0) |
--popover | oklch(1 0 0) | oklch(0.205 0 0) |
--popover-foreground | oklch(0.145 0 0) | oklch(0.985 0 0) |
--primary | oklch(0.205 0 0) | oklch(0.922 0 0) |
--primary-foreground | oklch(0.985 0 0) | oklch(0.205 0 0) |
--secondary | oklch(0.97 0 0) | oklch(0.269 0 0) |
--secondary-foreground | oklch(0.205 0 0) | oklch(0.985 0 0) |
--muted | oklch(0.97 0 0) | oklch(0.269 0 0) |
--muted-foreground | oklch(0.556 0 0) | oklch(0.708 0 0) |
--accent | oklch(0.97 0 0) | oklch(0.269 0 0) |
--accent-foreground | oklch(0.205 0 0) | oklch(0.985 0 0) |
--destructive | oklch(0.577 0.245 27.325) | oklch(0.704 0.191 22.216) |
--border | oklch(0.922 0 0) | oklch(1 0 0 / 10%) |
--input | oklch(0.922 0 0) | oklch(1 0 0 / 15%) |
--ring | oklch(0.708 0 0) | oklch(0.556 0 0) |
--chart-1 | oklch(0.646 0.222 41.116) | oklch(0.488 0.243 264.376) |
--chart-2 | oklch(0.6 0.118 184.704) | oklch(0.696 0.17 162.48) |
--chart-3 | oklch(0.398 0.07 227.392) | oklch(0.769 0.188 70.08) |
--chart-4 | oklch(0.828 0.189 84.429) | oklch(0.627 0.265 303.9) |
--chart-5 | oklch(0.769 0.188 70.08) | oklch(0.645 0.246 16.439) |
--sidebar | oklch(0.985 0 0) | oklch(0.205 0 0) |
--sidebar-foreground | oklch(0.145 0 0) | oklch(0.985 0 0) |
--sidebar-primary | oklch(0.205 0 0) | oklch(0.488 0.243 264.376) |
--sidebar-primary-foreground | oklch(0.985 0 0) | oklch(0.985 0 0) |
--sidebar-accent | oklch(0.97 0 0) | oklch(0.269 0 0) |
--sidebar-accent-foreground | oklch(0.205 0 0) | oklch(0.985 0 0) |
--sidebar-border | oklch(0.922 0 0) | oklch(1 0 0 / 10%) |
--sidebar-ring | oklch(0.708 0 0) | oklch(0.556 0 0) |
The live ui.shadcn.com site shows pure black for light --foreground, --card-foreground, --popover-foreground and --primary (its own site theme), where the page above publishes
oklch(0.145 0 0) and oklch(0.205 0 0). The kit follows the published values.
Components
All members are for the UI thread. Form controls take Id, so a Label with For activates them, and Disabled, which dims the control to 50 %, blocks its events and takes it out of
the Tab order. Focus is a 3 px ring of --ring at 50 % (:focus-visible). An invalid control gets the destructive border and a 20 % ring (40 % in dark).
| Component | Parameters | Notes |
|---|---|---|
Theme | Dark | Root of a themed subtree. |
Button | Variant (Default, Secondary, Destructive, Outline, Ghost, Link), Size (Default, Xs, Sm, Lg, Icon, IconXs, IconSm, IconLg), Disabled, Type, Id, AriaLabel, OnClick | The content is the label. An icon size needs AriaLabel. |
Input | Value, Type, Placeholder, Id, Name, AriaLabel, Disabled, ReadOnly, Required, Invalid, OnValueChange | Two-way: pass Value and OnValueChange. |
Textarea | as Input, without Type | At least 64 px high. |
Label | For | A label element. |
Checkbox | Checked, Disabled, Invalid, Id, AriaLabel, OnCheckedChange | A button with role="checkbox"; click and Space request the opposite value. With OnCheckedChange set it is controlled (shows only Checked, so a parent can refuse); without one it keeps its own state. |
Switch | Checked, Disabled, Size (Default, Sm), Id, AriaLabel, OnCheckedChange | A button with role="switch"; controlled like Checkbox. |
Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter | Card.Size (Default, Sm), CardFooter.Vertical | The footer runs to the card's edge. |
Badge | Variant (Default, Secondary, Destructive, Outline, Ghost, Link) | |
Separator | Orientation, Decorative | role="separator" with aria-orientation, or role="none" when decorative. |
Avatar | Src, Alt, Fallback, Size (Default, Sm, Lg) | The initials sit behind the picture and stay if it fails to load. |
Tabs, TabsList, TabsTrigger, TabsContent | every part takes Model (a TabsModel); TabsTrigger and TabsContent take Value; TabsTrigger takes Disabled and Line; TabsList takes Variant (Default, Line) | The app owns the TabsModel, may set Model.Value, and hears changes on ValueChanged. |
Keyboard follows the WAI-ARIA Authoring Practices. Buttons, checkboxes and switches are button elements, so Enter and Space activate them the way the engine activates any button.
Tabs: the selected trigger has tabindex="0" and aria-selected="true", the others tabindex="-1". Left and Right (Up and Down for a vertical model) move to the next or previous
enabled tab and wrap; Home and End go to the first and last; the selection follows the key. Panels are role="tabpanel" and exist only for the selected tab.
Overlays
Overlays are components drawn inside the page: positioned layers with z-index: 50, a backdrop for modals, anchored to their trigger by CSS. They are not
separate windows (AppHost.ShowMenu and OpenWindow remain the app's choice for OS menus). Each takes its trigger in the trigger slot and its content in the default slot:
<Dialog Open="{Open}" OnOpenChange="{v => Open = v}" Id="edit"> <template slot="trigger"><Button Variant="{ButtonVariant.Outline}">Edit profile</Button></template> <DialogHeader> <DialogTitle DialogId="edit">Edit profile</DialogTitle> <DialogDescription DialogId="edit">Make changes here.</DialogDescription> </DialogHeader> <Input Value="{Name}" OnValueChange="{v => Name = v}" /> <DialogFooter><Button OnClick="{() => Open = false}">Save</Button></DialogFooter> </Dialog>
| Component | Parameters | Notes |
|---|---|---|
Dialog | Open, OnOpenChange, Id, AriaLabel, Role, ShowCloseButton, CloseOnOutsideClick, MaxWidth, InitialFocus (an ElementRef) | Modal. Parts: DialogHeader, DialogTitle and DialogDescription (both take DialogId, the dialog's Id, which names and describes the dialog), DialogFooter. Keeps its own state when the parent passes none. |
AlertDialog | Open, OnOpenChange, Id, InitialFocus | A Dialog with role="alertdialog", no close button and no dismissal by the backdrop; uses the Dialog parts. Put the least destructive button in InitialFocus. |
Popover | Open, OnOpenChange, Id, AriaLabel, Side, Align, SideOffset, Width, InitialFocus | Any content. Panel is role="dialog", non-modal. |
DropdownMenu | Model (MenuModel), Id, AriaLabel, Side, Align, SideOffset, Width | Items: DropdownMenuItem (Model, OnSelect, Destructive, Inset, Disabled, TextValue, CloseOnSelect), DropdownMenuCheckboxItem (Checked, OnCheckedChange), DropdownMenuRadioItem (Checked, OnSelect); DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut. The app owns the MenuModel, may open it from code and hears OpenChanged. |
Tooltip | Text, Id, Side, Align, DelayMs, Open | The default slot is the element it describes. |
Toaster, Toast, ToastModel | Toaster.Model, AriaLabel; Toast.Show(title, description, variant, duration, actionLabel, onAction), Toast.Success, Toast.Error, Toast.Dismiss | Place one Toaster in the page. Toast writes to ToastModel.Default; give the Toaster its own ToastModel for a separate stack. Variants: default, success, info, warning, error. At most MaxVisible (3) messages show. |
SelectBox, SelectItem, SelectGroup, SelectLabel, SelectSeparator, SelectModel | SelectBox: Model, Placeholder, Id, AriaLabel, TriggerId, Width, Disabled, Invalid, Size, Position; SelectItem: Model, Value, Text, Disabled | SelectModel holds Value and Open. Position.ItemAligned (default) puts the chosen option over the trigger as shadcn/ui does; Below opens under it. Named SelectBox because Select is a Visual Basic keyword (CA1716). |
Side is OverlaySide.Bottom, Top, Left or Right; Align is OverlayAlign.Start, Center or End. The models (MenuModel, SelectModel, ToastModel) are not state of the
page that owns them: bind a trigger's AriaExpanded to a model's Open by bumping a [State] counter from the model's Changed, as samples/KitGallery/OverlayGallery.cs does.
Behaviour follows the WAI-ARIA Authoring Practices.
- Dialog and alert dialog (modal dialog, alert dialog): focus moves into the dialog when it opens, to
InitialFocusor else to the first control Tab reaches (the close button comes last), falling back to the dialog itself. Tab and Shift+Tab wrap from the last control to the first and back, using the document's tab order, so disabled, hidden and inert controls are skipped. Escape closes; a click on the backdrop closes a dialog but not an alert dialog. Closing returns focus to the control in the trigger that had it.role="dialog"or"alertdialog",aria-modal="true",aria-labelledby/aria-describedbyfrom the parts. - Popover: click toggles; opening focuses the first control in the panel (or the panel); Escape closes and returns focus; a click outside closes. Set
AriaHasPopup,AriaExpandedandAriaControlson the triggerButton. - Dropdown menu (menu button): click or Enter or Space opens (Enter and Space on the first item, a click on the menu itself); Down Arrow opens on the first item, Up Arrow on the last. Inside, Up and Down wrap,
Home and End jump, a letter jumps to the next item whose
TextValuestarts with it (typing again within a second extends the prefix), Enter or Space runs the item, Escape and Tab close. Items aretabindex="-1"and take focus as the keys and the pointer move; closing returns focus to the trigger. Checkbox and radio items havearia-checked; a disabled item hasaria-disabledand is skipped. - Select (select-only combobox): the trigger is
role="combobox"witharia-expanded,aria-controlsandaria-activedescendantand keeps focus; the list isrole="listbox"ofrole="option"witharia-selected. Arrow keys, Enter and Space open it on the chosen option; Up, Down, Home and End move the current option (the ends stop); letters jump; Enter and Space choose; Tab chooses and moves on; Escape closes. Typing a letter on the closed control chooses the matching option. - Tooltip: hover (after
DelayMs) and focus show it; the pointer leaving, focus leaving and Escape hide it.role="tooltip"; set the described element'sAriaDescribedByto the tooltip'sId. - Toasts: the toaster is
role="region"witharia-live="polite"; each message isrole="status".
Timers. The tooltip delay and the toast duration run on the host's clock (UiContext.Scheduler): the native host posts timer expiry to its loop, which sleeps until then, and the browser bridge uses setTimeout. A
Toaster tells its ToastModel the clock of the context it mounts in. KitTimers.Scheduler remains as a fallback for a host that sets none (KitTimers.UseSystemTimers(post) builds one); the context's clock wins when both exist.
With neither, a tooltip shows at once and a toast stays until it is dismissed.
Placement. The layer sits where its Side and Align say, by CSS. Once it is on screen the popover, dropdown menu and tooltip measure it and its anchor (GetBoundingClientRect) and the viewport and run Placement.Resolve:
a flip to the opposite side when the preferred side lacks room and the other has more, then a shift along the edge. A moved layer gets data-side, the class placed and left/top offsets from the anchor (a tooltip's arrow follows the
side it ended on). SelectBox slides its item-aligned list up or down to stay inside the window, and flips a list that opens below the trigger above it when that has more room (with a 5 px margin). Placement runs when the layer
opens, not again if the window is resized while it is open, and only on a host that answers layout queries (the reference document answers from boxes a test sets).
Data
Table and ScrollArea are the data components. They add no data-grid behaviour (sorting, paging, virtual rows, column resizing); the app owns the data and says which rows are selected.
<Table> <TableCaption>A list of your recent invoices.</TableCaption> <TableHeader> <TableRow><TableHead Width="100px">Invoice</TableHead><TableHead>Status</TableHead><TableHead Align="{CellAlign.End}">Amount</TableHead></TableRow> </TableHeader> <TableBody> <template each="{Invoices}" item="inv" key="{inv.Id}"> <TableRow Selected="{inv.Id == Picked}"> <TableCell Medium="true">{inv.Id}</TableCell><TableCell>{inv.Status}</TableCell><TableCell Align="{CellAlign.End}">{inv.Amount}</TableCell> </TableRow> </template> </TableBody> <TableFooter><TableRow><TableCell ColSpan="2">Total</TableCell><TableCell Align="{CellAlign.End}">{Total}</TableCell></TableRow></TableFooter> </Table> <ScrollArea Width="12rem" Height="18rem" Bordered="true" AriaLabel="Release tags">...long content...</ScrollArea>
| Component | Parameters | Notes |
|---|---|---|
Table | AriaLabel, AriaDescribedBy | A div that scrolls sideways around a table. The parts are the HTML table elements one to one, so row and column semantics are the platform's. |
TableHeader, TableBody, TableFooter | none | thead, tbody, tfoot. The last body row and the last footer row have no rule under them; the footer is a 50 % --muted band with a rule above it and medium text. |
TableRow | Selected | tr with a --border rule under it. The pointer tints it --muted at 50 %; a selected row is --muted (also under the pointer) with data-state="selected" and aria-selected="true". An unselected row carries neither attribute. |
TableHead | Align (CellAlign.Start, Center, End), Scope (TableScope.Col, Row), Width, ColSpan | th, 40 px high, medium weight, one line. Scope is col unless set. Width is a CSS length that includes the 8 px side padding. |
TableCell | Align, Medium, ColSpan | td, 8 px padding, one line. |
TableCaption | none | caption, muted, 16 px below the rows; it names the table. |
ScrollArea | Direction (ScrollDirection.Vertical, Horizontal, Both), Width, Height, Bordered, AriaLabel | A box that scrolls its content. Width and Height are CSS lengths; a vertical area needs a height (its own or its container's) to have anything to scroll. Bordered adds the 1 px --border and the --radius-md corners. |
Scrolling is the platform's: the wheel, touch, Page Up and Down, Home and End and the arrow keys act on the viewport as they do on any scrolling surface. The viewport is focusable (tabindex="0"), so a keyboard user can reach it; focus shows the 3 px --ring ring at 50 %. With AriaLabel it is a region of that name; without one it has no role. A scrollable area that holds focusable controls adds one Tab stop in front of them.
The table container (overflow-x: auto) scrolls a table that is wider than its space; as in shadcn/ui, cells do not wrap.
Differences from shadcn/ui
- Checkboxes and the icon buttons of the core components still use drawn marks and glyphs; the overlay icons (close, check, chevron, status icons) are inline SVG with
currentColor. Textareahas no resize control:resizeis not a property the renderer supports.- The tabs' arrow keys move the selection but do not yet move focus to the new tab.
- An invalid input keeps its normal text colour; the docs example colours it through the surrounding field.
- Overlays are drawn inside the page, so an ancestor with
overflow: hiddenclips them; shadcn/ui draws them in a portal at the end of the document. - A layer is placed when it opens and not again when the window is resized while it is open. A tooltip's arrow stays centred on the bubble when the bubble is shifted along the edge; shadcn/ui moves it to keep pointing at the trigger.
- Tab is trapped in a dialog only on a host that answers layout and focus queries (the native host and the browser bridge do).
- The page behind a modal is covered by the backdrop, which takes its clicks, and Tab is trapped inside; it is not marked
inert, so assistive technology can still reach it by browsing. - Dropdown menus have no submenus. Nothing animates.
- A toast is a plain card: no swipe to dismiss, no stacking animation, no pause on hover.
SelectBoxis the shadcn/uiSelect(Selectis a Visual Basic keyword). Its list is built with the page and hidden, so the trigger can show the chosen text. A list taller than 24 rem scrolls but is not scrolled to the chosen option, and opens below the trigger.- A
Tooltip,PopoverandDropdownMenucannot setaria-expanded,aria-controlsoraria-describedbyon the trigger you pass, because the kit does not own that element: set them on the triggerButton(AriaHasPopup,AriaExpanded,AriaControls,AriaDescribedBy). ScrollArea's scrollbar is the platform's thin one. shadcn/ui hides the platform scrollbar and draws an overlay thumb (7 px,--border, fully rounded) that takes no room. The kit setsscrollbar-width: thinandscrollbar-color: var(--border) transparent, so the thumb has shadcn/ui's colour and a similar width, drawn the same way natively (OneRender) and in Chrome, but the bar takes 10 px of the content (a classic bar, with its small arrows), so content is 10 px narrower than in shadcn/ui. A component cannot readscrollTopor the sizes to draw its own thumb.ScrollArea's viewport isoverflow: autoon the scrolling axes only and clips the other; shadcn/ui's isoverflow: scrollon both with the native scrollbar hidden.- The comparison images show shadcn/ui's thumb (a pale bar at the right of the vertical example) and, in the horizontal example, real photographs where the gallery draws a grey placeholder; boxes and scroll sizes are equal.
- In the comparison the text of rows that hold an icon
Buttonsits within 1 px of where it is in shadcn/ui (the boxes are equal); every other table capture is pixel-identical in both themes. - Row hover and selection change colour at once; shadcn/ui eases the background over 150 ms.
- A
TableRowis not interactive: it has no click or keyboard handler and takes no focus. Put aButton,Checkboxor link in a cell for that.aria-selectedon a row only means something to assistive technology in a selectable grid, so setSelectedonly in tables that select. - There are no sortable headings, no pagination, no row virtualisation and no column resizing; the data-table recipe on the shadcn/ui site is built from these parts and the app's own state.