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. ChatPanelconsumes a runtime connected to the official Session actor, or controlled messages and callbacks.- Messages provide Markdown, tool activity, approvals/questions, errors, and user bubbles.
ChatInputprovides the shared structured rich editor. - Hosts own Agent/Session access, drafts, transport, Power renderers, and workspace resources.
See Agent chat for the full-stack example, lifecycle, host callbacks, and styles.
Card
- Exports:
CardCardHeaderCardTitleCardDescriptionCardActionCardContentCardFooter
Separator
- Exports:
Separator
Skeleton
- Exports:
Skeleton
Tabs
- Exports:
TabsTabsListTabsTriggerTabsContenttabsListVariants
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:
DowncityWorkboardPropsDowncityWorkboardBoardSnapshotDowncityWorkboardAgentItemDowncityWorkboardActivityItem
- 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:
DowncityWorkboardGameMapConfigDowncityWorkboardGameZoneDowncityWorkboardGameActorDowncityWorkboardGameRouteDowncityWorkboardGamePointOfInterestDowncityWorkboardGameAreaLabelDowncityWorkboardGameAtlasPropsDowncityWorkboardGameRoomPropsDowncityWorkboardGameInspectorPropsDowncityWorkboardGameHudProps
- Purpose: map the public
workboardsnapshot 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:
DialogDialogTriggerDialogPortalDialogCloseDialogOverlayDialogContentDialogHeaderDialogFooterDialogTitleDialogDescription
Sheet
- Exports:
SheetSheetTriggerSheetCloseSheetPortalSheetOverlaySheetContentSheetHeaderSheetFooterSheetTitleSheetDescription
DropdownMenu
- Exports:
DropdownMenuDropdownMenuTriggerDropdownMenuPortalDropdownMenuContentDropdownMenuGroupDropdownMenuLabelDropdownMenuItemDropdownMenuCheckboxItemDropdownMenuRadioGroupDropdownMenuRadioItemDropdownMenuSeparatorDropdownMenuShortcutDropdownMenuSubDropdownMenuSubTriggerDropdownMenuSubContent
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:
PopoverPopoverTriggerPopoverContent
Tooltip
- Exports:
TooltipTooltipTriggerTooltipContentTooltipProvider
Toaster
- Exports:
Toaster - Built on:
sonner
Recommended Reading
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.