UI SDK Development
Recommended patterns for building pages, forms, overlays, and settings panels with @downcity/ui
UI SDK Development
This page is for developers using @downcity/ui to build real screens.
Integration Rules
@import "tailwindcss";
@import "@downcity/ui/source.css";
@import "@downcity/ui/styles.css";If you import styles.css without source.css, the host app may miss the Tailwind utilities used inside UI SDK components.
Component Selection Guide
Actions
ButtonToggleToggleGroupBadge
Forms
InputTextareaCheckboxLabel
Containers
CardTabsSeparatorSkeleton
Overlays
DialogSheetDropdownMenuPopoverTooltipToaster
Common Screen Patterns
Settings Panel
import { Button, Card, CardContent, CardHeader, CardTitle, Input, Label, Separator } from "@downcity/ui";
export function ModelSettingsPanel() {
return (
<Card className="max-w-2xl">
<CardHeader>
<CardTitle>Model Settings</CardTitle>
</CardHeader>
<CardContent className="flex flex-col gap-4">
<div className="flex flex-col gap-2">
<Label htmlFor="provider">Provider</Label>
<Input id="provider" placeholder="openai" />
</div>
<Separator />
<div className="flex justify-end">
<Button size="sm">Save</Button>
</div>
</CardContent>
</Card>
);
}Toolbar
ButtonToggleTooltipDropdownMenu
Modal Editing
DialogDialogHeaderDialogTitleDialogDescriptionDialogFooter
If the content is larger, prefer Sheet instead of forcing everything into Dialog.
Host App Conventions
If a screen needs to talk to the downcity main package, do not import internal main-package source files from a component. See Host Integration.
className should mostly handle
- width
- layout
- spacing
- local page-level adjustments
Avoid
- rebuilding a second color system at the page layer
- redefining buttons per business screen
- overriding primitive semantics with business-specific wrappers