UI SDK Modules

Review the complete public export surface of @downcity/ui

This page lists the full public module surface of @downcity/ui.

Shortcuts

The shortcut module provides cross-platform matching, registration, and a React provider. Mod means Command on macOS and Ctrl on Windows/Linux.

import { ShortcutProvider, use_register_shortcuts } from "@downcity/ui";

function AppShortcuts() {
  use_register_shortcuts(() => [{
    id: "editor.bold",
    title: "Bold",
    keys: ["Mod+B"],
    scope: "editor",
    run: () => { document.execCommand("bold"); return true; },
  }], []);
  return null;
}

It supports combinations such as Mod+B, Mod+L, Mod+I, and Mod+,. Host applications provide the actions; the UI SDK does not impose business behavior.

Utilities and Types

cn

  • Purpose: merge Tailwind classes and resolve conflicts safely

DowncityButtonVariant

  • Values: default, outline, secondary, ghost, destructive, link

DowncityButtonSize

  • Values: default, xs, sm, lg, icon, icon-xs, icon-sm, icon-lg

DowncityCardSize

  • Values: default, sm

DowncityDropdownMenuItemVariant

  • Values: default, destructive

DowncityContextMenuItemVariant

  • Values: default, destructive

DowncityItemVariant, DowncityItemSize

  • Item variants: default, outline, muted
  • Item sizes: default, sm

DowncitySpinnerSize

  • Values: sm, default, lg

DowncityToasterTheme

  • Values: light, dark, system

Style Modules

@downcity/ui/source.css

  • Role: declare the Tailwind scanning source

@downcity/ui/styles.css

  • Role: provide design tokens and the base layer

Actions and State Modules

Button

  • Exports: Button, buttonVariants

ButtonGroup

  • Exports: ButtonGroup
  • Exported types: DowncityButtonGroupProps, DowncityButtonGroupOrientation

Badge

  • Exports: Badge, badgeVariants

Toggle

  • Exports: Toggle, toggleVariants

ToggleGroup

  • Exports: ToggleGroup, ToggleGroupItem

Spinner

  • Exports: Spinner
  • Purpose: loading feedback in buttons, items, and asynchronous regions

Kbd

  • Exports: Kbd, KbdGroup
  • Purpose: display shortcuts and key combinations

CodeBlock

  • Exports: CodeBlock
  • Exported type: DowncityCodeBlockProps

Typography

  • Exports: H1–H6, Paragraph, Lead, Small, Muted, Strong, Emphasis, InlineCode, Blockquote, UnorderedList, OrderedList, ListItem, TaskListItem, DefinitionList, DefinitionTerm, DefinitionDescription, FootnoteReference, Footnotes, FootnoteItem, Anchor, Hr, Annotation
  • Exported types: DowncityAnnotationProps, DowncityAnnotationTone, and Typography prop types
  • Purpose: render headings, prose, quotes, lists, links, inline code, and semantic annotations
  • Purpose: render plain source or build-time highlighted code with copy behavior

Form Modules

Input

  • Exports: Input

Textarea

  • Exports: Textarea
  • Exported type: TextareaProps

Checkbox

  • Exports: Checkbox

Label

  • Exports: Label

Select

  • Exports: Select, SelectTrigger, SelectValue, SelectContent, SelectGroup, SelectLabel, SelectItem, SelectSeparator
  • Purpose: single-value selection with grouped options

Slider

  • Exports: Slider
  • Purpose: scalar or range value selection

Switch

  • Exports: Switch
  • Purpose: toggle one boolean setting

Containers and Display Modules

ChatPanel, AgentChatMessage, AgentWorkMessage, UserMessage, ChatInput

  • Exports: ChatPanel, AgentChatMessage, AgentWorkMessage, UserMessage, ChatInput, MarkdownView, AgentMessageContent, UserMessageContent, connect_chat_session.
  • ChatPanel consumes a runtime connected to the official Session actor, or controlled messages and callbacks.
  • Messages provide Markdown, tool activity, approvals/questions, errors, and user bubbles. ChatInput provides the shared structured rich editor.
  • Hosts own Agent/Session access, drafts, transport, Power renderers, and workspace resources.
Loading preview…
Loading preview…

See Agent chat for the full-stack example, lifecycle, host callbacks, and styles.

Card

  • Exports:
    • Card
    • CardHeader
    • CardTitle
    • CardDescription
    • CardAction
    • CardContent
    • CardFooter

Separator

  • Exports: Separator

Skeleton

  • Exports: Skeleton

Tabs

  • Exports:
    • Tabs
    • TabsList
    • TabsTrigger
    • TabsContent
    • tabsListVariants

Settings

  • Exports: SettingsContainer, SettingSection, SettingGroup, SettingItem, InfoRow
  • Purpose: compact settings screens and grouped detail rows

Item

  • Exports: Item, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, ItemGroup, item_variants
  • Purpose: compose resource lists, search results, and settings entries

Empty

  • Exports: Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent
  • Purpose: first-use, no-data, and no-results states

Workboard

  • Exports: Workboard
  • Exported types:
    • DowncityWorkboardProps
    • DowncityWorkboardBoardSnapshot
    • DowncityWorkboardAgentItem
    • DowncityWorkboardActivityItem
  • Purpose: render a pixel-style game world across multiple agents with a fixed 40 x 24 tile world canvas, full-ratio normal view, cover-scaled fullscreen view, a Smallville-style downcity atlas, open state buildings, tiled interior room maps, a portal rail, keyboard map control, sprite patrols, quest paths, in-room wall boards, blueprint tables, a codex log, and focused inspection

buildWorkboardGameMapConfig

  • Exports: buildWorkboardGameMapConfig
  • Exported types:
    • DowncityWorkboardGameMapConfig
    • DowncityWorkboardGameZone
    • DowncityWorkboardGameActor
    • DowncityWorkboardGameRoute
    • DowncityWorkboardGamePointOfInterest
    • DowncityWorkboardGameAreaLabel
    • DowncityWorkboardGameAtlasProps
    • DowncityWorkboardGameRoomProps
    • DowncityWorkboardGameInspectorProps
    • DowncityWorkboardGameHudProps
  • Purpose: map the public workboard snapshot into a full game-map configuration that custom hosts can reuse for zones, actors, routes, gates, stations, props, and area labels

Overlays and Feedback Modules

Dialog

  • Exports:
    • Dialog
    • DialogTrigger
    • DialogPortal
    • DialogClose
    • DialogOverlay
    • DialogContent
    • DialogHeader
    • DialogFooter
    • DialogTitle
    • DialogDescription

Sheet

  • Exports:
    • Sheet
    • SheetTrigger
    • SheetClose
    • SheetPortal
    • SheetOverlay
    • SheetContent
    • SheetHeader
    • SheetFooter
    • SheetTitle
    • SheetDescription
  • Exports:
    • DropdownMenu
    • DropdownMenuTrigger
    • DropdownMenuPortal
    • DropdownMenuContent
    • DropdownMenuGroup
    • DropdownMenuLabel
    • DropdownMenuItem
    • DropdownMenuCheckboxItem
    • DropdownMenuRadioGroup
    • DropdownMenuRadioItem
    • DropdownMenuSeparator
    • DropdownMenuShortcut
    • DropdownMenuSub
    • DropdownMenuSubTrigger
    • DropdownMenuSubContent

ContextMenu

  • Exports: ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuGroup, ContextMenuLabel, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubTrigger, ContextMenuSubContent
  • Purpose: provide right-click actions for a target region

Command

  • Exports: Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandShortcut
  • Purpose: command palettes, resource search, and quick navigation

Popover

  • Exports:
    • Popover
    • PopoverTrigger
    • PopoverContent

Tooltip

  • Exports:
    • Tooltip
    • TooltipTrigger
    • TooltipContent
    • TooltipProvider

Toaster

  • Exports: Toaster
  • Built on: sonner

Model and status components

ModelSelector, ChatModelSelector, ModelOptions, ModelDetails, ReasoningOptions, SelectorSubmenu, LLMModelIcon, ChatApprovalModeSelector, and ModelPricingChart provide catalog-driven configuration. StatusPanel, StatusPanelHeader, MessageQueue, QueuedMessageResources, PendingInteractionArea, AgentInteraction, ApprovalInteractionCard, QuestionInteractionCard, QuestionField, SubSessionList, SubSessionStatusIcon, and PillSwitcher provide composable session state surfaces. Their prop types and model formatting helpers are exported from the root package. Load @downcity/ui/status-panel.css for status and interaction layouts.