Skip to content
BreachPilot

UI Primitives (components/ui/*)

Vendored shadcn/ui pattern (Radix + class-variance-authority + cn() from lib/utils.ts:4 = twMerge(clsx)). Not a barrel npm component library — edit in place or regenerate from shadcn. All primitives verified under webui/src/components/ui/*.tsx (17 files enumerated glob:*).

Inventory

FileUnderlyingExportsKey props / notes
button.tsx:6Radix Slot + cvaButton, buttonVariants`variant default
badge.tsx:5cva divBadge, badgeVariants`variant default
card.tsx:4divCard, CardHeader, CardTitle, CardDescription, CardContent, CardFooterCard hover:shadow-md hover:-translate-y-0.5 (card.tsx:8), default padding p-4, header space-y-1.5
dialog.tsxRadix DialogDialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooterused for Help/Permission/Skill add/delete, Home notice. DialogContent sm:max-w-*
input.tsxnative inputInputh-9 border-input bg-background
label.tsxRadix LabelLabeltext-sm font-medium
textarea.tsxnative textareaTextareamin-h-[80px] for ManualToolPanel JSON
tabs.tsxRadix TabsTabs, TabsList, TabsTrigger, TabsContentRunPage TabsTrigger h-6 px-2 text-xs, Artifacts/Run tabs
select.tsxRadix SelectSelect, SelectTrigger, SelectValue, SelectContent, SelectItemRunList sort, Skills page sort
checkbox.tsxRadix CheckboxCheckboxToggleRow, GraphFilters, RunWizard skip-confirm
switch.tsxRadix SwitchSwitchSkills Configuration master + feature switches
popover.tsxRadix PopoverPopover, PopoverTrigger, PopoverContentSkillRowActions, skill tag filter
tooltip.tsxRadix TooltipTooltipProvider, Tooltip, TooltipTrigger, TooltipContentStats page metric help, icon hints (delayDuration 120)
toast.tsxRadix ToastToast, ToastProvider, ToastViewport + hooks/use-toast.ts storeToaster (components/Toaster.tsx) viewport for useToast
scroll-area.tsxRadix ScrollAreaScrollArea, ScrollBarRunPage tab list (type scroll), Artifacts tabs
separator.tsxRadix SeparatorSeparatorvertical/horizontal dividers
skeleton.tsxdivSkeletonskeleton shimmer bg index.css:150 + h-4 w-* placeholders (components/Loading.tsx re-exports shaped rows)

Also present via glob: components.json (shadcn config), tailwind.config.ts Radix-animate wiring.

Custom wrappers (non-ui)

These are app components, not primitives, but are shared "mini-primitives":

ComponentFilePurpose
StatusBadgecomponents/StatusBadge.tsxRunState → colored Badge (draft/awaiting/queued/running/... variants)
CopyButtoncomponents/CopyButton.tsxclipboard copy value + icon/label, `size sm
Loadingcomponents/Loading.tsxSpinner, SkeletonRows(count), SkeletonCards(count), Skeleton, ErrorState(message,onRetry), EmptyState(message)
Toastercomponents/Toaster.tsxRadix Toast viewport + useToast consumer
ErrorBoundarycomponents/ErrorBoundary.tsxclass component wrapping App (main.tsx:10)

Patterns

  • buttonVariants / badgeVariants are cva so cn(buttonVariants({variant,size,className})) merges correctly with overrides (Badge in risk filters passes activeCls).
  • Card hover translate is subtle (-translate-y-0.5) but visible on GoalCard, Skill rows, ModuleRow. Disable via extra className when blocked (GoalsPage).
  • Dialogs: every destructive action confirms via Dialog (RunList delete, Skills delete, Cancel run). Props mirror Radix — open/onOpenChange, DialogHeader/Title/Description/Footer.
  • Inputs: filter fields use h-8 text-xs (RunList, Artifacts), skills search h-9 pl-8, dialog inputs h-9 font-mono.
  • TabsList in RunPage is h-7 bg-transparent p-0.5 with TabsTrigger h-6 text-xs, plus a separator |.
  • Accessibility: all icons have aria-hidden, interactive elements expose aria-label, aria-pressed, tables have sr-only caption.

Styling hooks

Colors via CSS vars (card.tsx:8 border bg-card text-card-foreground etc.) from index.css. Utilities cn resolves conflicts (e.g. border-primary vs border-border precedence). See docs/webui/build.md for Tailwind config.

source: repo docs (build sync)Edit this page on GitHub →