Recursive AI

The kit

All oneapp docs

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.

HTML
<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:

CSS
.my-app { --primary: oklch(0.55 0.2 260); --primary-foreground: oklch(0.985 0 0); --radius: 0.5rem; }
TokenLightDark
--radius0.625rem(same)
--backgroundoklch(1 0 0)oklch(0.145 0 0)
--foregroundoklch(0.145 0 0)oklch(0.985 0 0)
--cardoklch(1 0 0)oklch(0.205 0 0)
--card-foregroundoklch(0.145 0 0)oklch(0.985 0 0)
--popoveroklch(1 0 0)oklch(0.205 0 0)
--popover-foregroundoklch(0.145 0 0)oklch(0.985 0 0)
--primaryoklch(0.205 0 0)oklch(0.922 0 0)
--primary-foregroundoklch(0.985 0 0)oklch(0.205 0 0)
--secondaryoklch(0.97 0 0)oklch(0.269 0 0)
--secondary-foregroundoklch(0.205 0 0)oklch(0.985 0 0)
--mutedoklch(0.97 0 0)oklch(0.269 0 0)
--muted-foregroundoklch(0.556 0 0)oklch(0.708 0 0)
--accentoklch(0.97 0 0)oklch(0.269 0 0)
--accent-foregroundoklch(0.205 0 0)oklch(0.985 0 0)
--destructiveoklch(0.577 0.245 27.325)oklch(0.704 0.191 22.216)
--borderoklch(0.922 0 0)oklch(1 0 0 / 10%)
--inputoklch(0.922 0 0)oklch(1 0 0 / 15%)
--ringoklch(0.708 0 0)oklch(0.556 0 0)
--chart-1oklch(0.646 0.222 41.116)oklch(0.488 0.243 264.376)
--chart-2oklch(0.6 0.118 184.704)oklch(0.696 0.17 162.48)
--chart-3oklch(0.398 0.07 227.392)oklch(0.769 0.188 70.08)
--chart-4oklch(0.828 0.189 84.429)oklch(0.627 0.265 303.9)
--chart-5oklch(0.769 0.188 70.08)oklch(0.645 0.246 16.439)
--sidebaroklch(0.985 0 0)oklch(0.205 0 0)
--sidebar-foregroundoklch(0.145 0 0)oklch(0.985 0 0)
--sidebar-primaryoklch(0.205 0 0)oklch(0.488 0.243 264.376)
--sidebar-primary-foregroundoklch(0.985 0 0)oklch(0.985 0 0)
--sidebar-accentoklch(0.97 0 0)oklch(0.269 0 0)
--sidebar-accent-foregroundoklch(0.205 0 0)oklch(0.985 0 0)
--sidebar-borderoklch(0.922 0 0)oklch(1 0 0 / 10%)
--sidebar-ringoklch(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).

ComponentParametersNotes
ThemeDarkRoot of a themed subtree.
ButtonVariant (Default, Secondary, Destructive, Outline, Ghost, Link), Size (Default, Xs, Sm, Lg, Icon, IconXs, IconSm, IconLg), Disabled, Type, Id, AriaLabel, OnClickThe content is the label. An icon size needs AriaLabel.
InputValue, Type, Placeholder, Id, Name, AriaLabel, Disabled, ReadOnly, Required, Invalid, OnValueChangeTwo-way: pass Value and OnValueChange.
Textareaas Input, without TypeAt least 64 px high.
LabelForA label element.
CheckboxChecked, Disabled, Invalid, Id, AriaLabel, OnCheckedChangeA 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.
SwitchChecked, Disabled, Size (Default, Sm), Id, AriaLabel, OnCheckedChangeA button with role="switch"; controlled like Checkbox.
Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooterCard.Size (Default, Sm), CardFooter.VerticalThe footer runs to the card's edge.
BadgeVariant (Default, Secondary, Destructive, Outline, Ghost, Link)
SeparatorOrientation, Decorativerole="separator" with aria-orientation, or role="none" when decorative.
AvatarSrc, Alt, Fallback, Size (Default, Sm, Lg)The initials sit behind the picture and stay if it fails to load.
Tabs, TabsList, TabsTrigger, TabsContentevery 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:

HTML
<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>
ComponentParametersNotes
DialogOpen, 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.
AlertDialogOpen, OnOpenChange, Id, InitialFocusA Dialog with role="alertdialog", no close button and no dismissal by the backdrop; uses the Dialog parts. Put the least destructive button in InitialFocus.
PopoverOpen, OnOpenChange, Id, AriaLabel, Side, Align, SideOffset, Width, InitialFocusAny content. Panel is role="dialog", non-modal.
DropdownMenuModel (MenuModel), Id, AriaLabel, Side, Align, SideOffset, WidthItems: 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.
TooltipText, Id, Side, Align, DelayMs, OpenThe default slot is the element it describes.
Toaster, Toast, ToastModelToaster.Model, AriaLabel; Toast.Show(title, description, variant, duration, actionLabel, onAction), Toast.Success, Toast.Error, Toast.DismissPlace 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, SelectModelSelectBox: Model, Placeholder, Id, AriaLabel, TriggerId, Width, Disabled, Invalid, Size, Position; SelectItem: Model, Value, Text, DisabledSelectModel 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 InitialFocus or 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-describedby from 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, AriaExpanded and AriaControls on the trigger Button.
  • 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 TextValue starts with it (typing again within a second extends the prefix), Enter or Space runs the item, Escape and Tab close. Items are tabindex="-1" and take focus as the keys and the pointer move; closing returns focus to the trigger. Checkbox and radio items have aria-checked; a disabled item has aria-disabled and is skipped.
  • Select (select-only combobox): the trigger is role="combobox" with aria-expanded, aria-controls and aria-activedescendant and keeps focus; the list is role="listbox" of role="option" with aria-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's AriaDescribedBy to the tooltip's Id.
  • Toasts: the toaster is role="region" with aria-live="polite"; each message is role="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.

HTML
<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>
ComponentParametersNotes
TableAriaLabel, AriaDescribedByA 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, TableFooternonethead, 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.
TableRowSelectedtr 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.
TableHeadAlign (CellAlign.Start, Center, End), Scope (TableScope.Col, Row), Width, ColSpanth, 40 px high, medium weight, one line. Scope is col unless set. Width is a CSS length that includes the 8 px side padding.
TableCellAlign, Medium, ColSpantd, 8 px padding, one line.
TableCaptionnonecaption, muted, 16 px below the rows; it names the table.
ScrollAreaDirection (ScrollDirection.Vertical, Horizontal, Both), Width, Height, Bordered, AriaLabelA 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.
  • Textarea has no resize control: resize is 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: hidden clips 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.
  • SelectBox is the shadcn/ui Select (Select is 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, Popover and DropdownMenu cannot set aria-expanded, aria-controls or aria-describedby on the trigger you pass, because the kit does not own that element: set them on the trigger Button (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 sets scrollbar-width: thin and scrollbar-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 read scrollTop or the sizes to draw its own thumb.
  • ScrollArea's viewport is overflow: auto on the scrolling axes only and clips the other; shadcn/ui's is overflow: scroll on 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 Button sits 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 TableRow is not interactive: it has no click or keyboard handler and takes no focus. Put a Button, Checkbox or link in a cell for that. aria-selected on a row only means something to assistive technology in a selectable grid, so set Selected only 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.