@hilum/ui 3.2.14 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/llms.txt CHANGED
@@ -1,12 +1,25 @@
1
- # @hilum/ui — Design System
1
+ # Hilum UI
2
2
 
3
- > Production-ready React design system with 74 components, OKLCH-based per-product theming, and CSS-variable-backed design tokens. Works in client-rendered and prerendered React apps, plus Electron. Tailwind v4 + Radix UI primitives.
3
+ > Hilum UI is a React design system and component catalog published at https://ui.hilum.dev. The docs site ships prerendered HTML and machine-readable indexes for AI systems and developers.
4
+
5
+ ## Key Facts
6
+
7
+ - Package name: `@hilum/ui`
8
+ - Package version: 3.3.0
9
+ - Component modules: 85
10
+ - Atom components: 63
11
+ - Molecule components: 22
12
+ - Docs site: https://ui.hilum.dev
13
+ - GitHub repository: https://github.com/hilum-labs/hilum-ui
14
+ - Machine-readable docs index: https://ui.hilum.dev/catalog.json
15
+ - Machine-readable marketing blocks registry: https://ui.hilum.dev/registry.json
16
+ - Stack: React 19, Tailwind CSS v4, Radix UI primitives, TanStack Start, TanStack Router
4
17
 
5
18
  ## Installation
6
19
 
7
20
  ```bash
8
21
  pnpm add @hilum/ui
9
- # or: npm install @hilum/ui | yarn add @hilum/ui
22
+ # or: npm install @hilum/ui
10
23
  ```
11
24
 
12
25
  Peer dependencies: `react@^19`, `react-dom@^19`, `tailwindcss@^4`
@@ -14,24 +27,18 @@ Peer dependencies: `react@^19`, `react-dom@^19`, `tailwindcss@^4`
14
27
  ## Setup
15
28
 
16
29
  ```css
17
- /* globals.css */
18
30
  @import "tailwindcss";
19
31
  @import "@hilum/ui/tokens.css";
20
32
  @import "@hilum/ui/fonts.css";
21
33
  ```
22
34
 
23
- The token import registers all design tokens as CSS custom properties and Tailwind v4 utilities (`bg-brand-primary`, `text-ground-900`, `shadow-natural`, etc.). The font import loads Hilum's self-hosted Inter and Gabarito font files.
24
-
25
- ---
26
-
27
35
  ## Theming
28
36
 
29
- Every product gets its own primary and secondary brand colors. Pass two hex values — `createTheme` generates a full 11-shade OKLCH palette and returns a CSS override string.
37
+ Hilum UI supports per-product theming with generated OKLCH palettes.
30
38
 
31
39
  ```tsx
32
40
  import { ThemeProvider } from "@hilum/ui/create-theme"
33
41
 
34
- // Wrap your app root — re-applies automatically when props change
35
42
  export function App() {
36
43
  return (
37
44
  <ThemeProvider primary="#0066FF" secondary="#FF9900">
@@ -41,1484 +48,114 @@ export function App() {
41
48
  }
42
49
  ```
43
50
 
44
- ### Theming API
45
-
46
- | Export | Description |
47
- |---|---|
48
- | `createTheme({ primary, secondary })` | Pure function. Returns `{ css, palette }`. Works in Node (build scripts) and browser. |
49
- | `applyTheme({ primary, secondary })` | Injects `<style>` into `document.head`. Returns cleanup fn. Browser/Electron only. |
50
- | `<ThemeProvider primary secondary>` | React component. Calls `applyTheme` in `useEffect`. |
51
-
52
- ### ThemeConfig
53
-
54
- | Prop | Type | Description |
55
- |---|---|---|
56
- | `primary` | `string` | Hex color. Anchored at palette-500; 11 shades generated. |
57
- | `secondary` | `string` | Hex color. Same structure. |
58
-
59
- ### ThemeResult
60
-
61
- | Field | Type | Description |
62
- |---|---|---|
63
- | `css` | `string` | Complete CSS override. Inject via `<style>` or write to a file. |
64
- | `palette.primary` | `Record<string,string>` | `{ "50": "#f2f7ff", …, "950": "#000723" }` |
65
- | `palette.secondary` | `Record<string,string>` | Same for secondary. |
66
-
67
- ### CSS variables overridden
68
-
69
- - `--color-brand-primary` / `--color-brand-secondary` — affects all `bg-brand-*` utilities
70
- - `--primary`, `--primary-foreground`
71
- - `--accent`, `--accent-foreground`
72
- - `--ring`
73
- - `--warning`, `--warning-foreground`
74
- - `--color-primary-{50…950}` / `--color-secondary-{50…950}` — palette vars for product CSS
75
-
76
- ---
77
-
78
- ## Design Tokens
79
-
80
- ### Colors
81
-
82
- **Brand:**
83
- - `bg-brand-primary` → `#C100F1` (vivid purple) — primary buttons, CTAs, focus rings
84
- - `bg-brand-secondary` → `#FFF5BF` (pale lemon) — warning surfaces, secondary CTAs
85
-
86
- **Purple scale** (`bg-purple-{50..950}`): built from `#C100F1` anchor at 500
87
- **Butter scale** (`bg-butter-{50..950}`): built from `#FFF5BF` anchor at 200
88
- **Ground scale** (`bg-ground-{50..950}`): neutral spine for text, borders, structure
89
-
90
- **Semantic CSS vars** (use in custom CSS, never raw hex):
91
- - `--background`, `--foreground` — page bg/text
92
- - `--primary`, `--primary-foreground` — primary interactive color + its text
93
- - `--secondary`, `--secondary-foreground` — secondary surfaces
94
- - `--muted`, `--muted-foreground` — subdued surfaces and text
95
- - `--accent`, `--accent-foreground` — hover tints
96
- - `--border`, `--input` — borders and input backgrounds
97
- - `--ring` — focus ring
98
- - `--destructive`, `--destructive-foreground` — errors
99
- - `--warning`, `--warning-foreground` — warnings
100
-
101
- ### Typography
102
-
103
- Use as Tailwind utilities (e.g. `className="display"`):
104
-
105
- | Class | Font | Size | Weight | Usage |
106
- |---|---|---|---|---|
107
- | `display-xl` | Gabarito | 3rem | 400 | Hero H1 |
108
- | `display` | Gabarito | 2.25rem | 400 | Page H1 |
109
- | `heading-xl` | Gabarito | 1.875rem | 400 | Section headings |
110
- | `heading` | Gabarito | 1.5rem | 400 | Card titles |
111
- | `subheading` | Gabarito | 1.25rem | 400 | Subheadings |
112
- | `body-lg` | Inter | 1rem | 400 | Large body text |
113
- | `body` | Inter | 0.875rem | 400 | Default body |
114
- | `caption` | Inter | 0.75rem | 400 | Metadata, helper text |
115
- | `caption-xs` | Inter | 0.625rem | 400 | Tiny metadata |
116
-
117
- **Eyebrow family** — uppercase, tracked label above headlines / in badges / on section markers. All five names share the same CSS (12px Inter 600, uppercase, 0.1em tracking). Pick the one that reads best in your context; `eyebrow` is canonical.
118
-
119
- | Class | Size | Notes |
120
- |---|---|---|
121
- | `eyebrow` | 0.75rem | Canonical name |
122
- | `eyebrow-sm` | 0.625rem | Compact variant for badges and tiny status pills |
123
- | `overline` | 0.75rem | Alias of eyebrow (Material parlance) |
124
- | `kicker` | 0.75rem | Alias of eyebrow (editorial parlance) |
125
- | `label` | 0.75rem | Alias of eyebrow (kept for backwards compat) |
126
-
127
- ### Shadows
128
-
129
- - `shadow-natural` — cards, default elevation
130
- - `shadow-elevated` — modals, floating panels
131
-
132
- ---
133
-
134
- ## Components
135
-
136
- All components are imported from `@hilum/ui`.
137
-
138
- ---
139
-
140
- ### Button
141
-
142
- Triggers actions. Supports variants, sizes, icons, and disabled/loading states.
143
-
144
- ```tsx
145
- import { Button } from "@hilum/ui"
146
-
147
- // Variants
148
- <Button>Default</Button>
149
- <Button variant="brand">Brand</Button>
150
- <Button variant="outline">Outline</Button>
151
- <Button variant="ghost">Ghost</Button>
152
- <Button variant="secondary">Secondary</Button>
153
- <Button variant="destructive">Destructive</Button>
154
- <Button variant="link">Link</Button>
155
-
156
- // Sizes
157
- <Button size="xs">Extra Small</Button>
158
- <Button size="sm">Small</Button>
159
- <Button size="lg">Large</Button>
160
- <Button size="icon"><Plus /></Button>
161
-
162
- // Pill shape
163
- <Button className="rounded-full">Get started</Button>
164
-
165
- // Loading
166
- <Button><Loader2 className="animate-spin" size={15} /> Saving...</Button>
167
-
168
- // As child (polymorphic)
169
- <Button asChild><a href="/path">Link button</a></Button>
170
- ```
171
-
172
- Props: `variant`, `size`, `asChild`, `disabled`, plus all `<button>` props.
173
-
174
- ---
175
-
176
- ### Badge
177
-
178
- Compact labels for status, categories, and metadata.
179
-
180
- ```tsx
181
- import { Badge } from "@hilum/ui"
182
-
183
- <Badge>Default</Badge>
184
- <Badge variant="secondary">Secondary</Badge>
185
- <Badge variant="outline">Outline</Badge>
186
- <Badge variant="brand">Brand</Badge>
187
- <Badge variant="success">Success</Badge>
188
- <Badge variant="warning">Warning</Badge>
189
- <Badge variant="destructive">Error</Badge>
190
- ```
191
-
192
- Props: `variant`.
193
-
194
- ---
195
-
196
- ### Input
197
-
198
- Text input field. Styled with the ground palette and brand focus ring.
199
-
200
- ```tsx
201
- import { Input } from "@hilum/ui"
202
-
203
- <Input placeholder="Email address" />
204
- <Input type="password" />
205
- <Input disabled value="Read-only" />
206
- ```
207
-
208
- Accepts all `<input>` props.
209
-
210
- ---
211
-
212
- ### Textarea
213
-
214
- Multi-line text input.
215
-
216
- ```tsx
217
- import { Textarea } from "@hilum/ui"
218
-
219
- <Textarea placeholder="Describe your issue..." rows={4} />
220
- ```
221
-
222
- Accepts all `<textarea>` props.
223
-
224
- ---
225
-
226
- ### Label
227
-
228
- Accessible label for form fields. Pairs with any input via `htmlFor`.
229
-
230
- ```tsx
231
- import { Label } from "@hilum/ui"
232
-
233
- <Label htmlFor="email">Email address</Label>
234
- <Input id="email" type="email" />
235
- ```
236
-
237
- ---
238
-
239
- ### Field
240
-
241
- Composed form field: label + input + helper/error text.
242
-
243
- ```tsx
244
- import { Field } from "@hilum/ui"
245
-
246
- <Field label="Email" hint="We'll never share your email.">
247
- <Input placeholder="you@example.com" />
248
- </Field>
249
-
250
- <Field label="Username" error="Username is already taken">
251
- <Input value="john" />
252
- </Field>
253
- ```
254
-
255
- Props: `label`, `hint`, `error`, `required`, `children`.
256
-
257
- ---
258
-
259
- ### Select
260
-
261
- Dropdown selection backed by Radix UI.
262
-
263
- ```tsx
264
- import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from "@hilum/ui"
265
-
266
- <Select>
267
- <SelectTrigger>
268
- <SelectValue placeholder="Pick a fruit" />
269
- </SelectTrigger>
270
- <SelectContent>
271
- <SelectItem value="apple">Apple</SelectItem>
272
- <SelectItem value="banana">Banana</SelectItem>
273
- <SelectItem value="mango">Mango</SelectItem>
274
- </SelectContent>
275
- </Select>
276
- ```
277
-
278
- ---
279
-
280
- ### Combobox
281
-
282
- Searchable select with filterable options.
283
-
284
- ```tsx
285
- import { Combobox } from "@hilum/ui"
286
-
287
- <Combobox
288
- options={[
289
- { value: "react", label: "React" },
290
- { value: "vue", label: "Vue" },
291
- { value: "svelte", label: "Svelte" },
292
- ]}
293
- placeholder="Select framework..."
294
- value={value}
295
- onValueChange={setValue}
296
- />
297
- ```
298
-
299
- Props: `options`, `value`, `onValueChange`, `placeholder`, `disabled`.
300
-
301
- ---
302
-
303
- ### Dialog
304
-
305
- Modal overlay with header, content, and footer.
306
-
307
- ```tsx
308
- import {
309
- Dialog, DialogTrigger, DialogContent,
310
- DialogHeader, DialogTitle, DialogDescription, DialogFooter,
311
- } from "@hilum/ui"
312
-
313
- <Dialog>
314
- <DialogTrigger asChild>
315
- <Button>Open dialog</Button>
316
- </DialogTrigger>
317
- <DialogContent>
318
- <DialogHeader>
319
- <DialogTitle>Confirm deletion</DialogTitle>
320
- <DialogDescription>This action cannot be undone.</DialogDescription>
321
- </DialogHeader>
322
- <DialogFooter>
323
- <Button variant="outline">Cancel</Button>
324
- <Button variant="destructive">Delete</Button>
325
- </DialogFooter>
326
- </DialogContent>
327
- </Dialog>
328
- ```
329
-
330
- ---
331
-
332
- ### Sheet
333
-
334
- Slide-in panel from any edge of the screen.
335
-
336
- ```tsx
337
- import {
338
- Sheet, SheetTrigger, SheetContent,
339
- SheetHeader, SheetTitle, SheetDescription,
340
- } from "@hilum/ui"
341
-
342
- <Sheet>
343
- <SheetTrigger asChild><Button>Open sheet</Button></SheetTrigger>
344
- <SheetContent side="right"> {/* side: "top" | "right" | "bottom" | "left" */}
345
- <SheetHeader>
346
- <SheetTitle>Edit profile</SheetTitle>
347
- <SheetDescription>Make changes to your profile here.</SheetDescription>
348
- </SheetHeader>
349
- {/* content */}
350
- </SheetContent>
351
- </Sheet>
352
- ```
353
-
354
- ---
355
-
356
- ### Drawer
357
-
358
- Bottom drawer for mobile-friendly overlays.
359
-
360
- ```tsx
361
- import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle } from "@hilum/ui"
362
-
363
- <Drawer>
364
- <DrawerTrigger asChild><Button>Open drawer</Button></DrawerTrigger>
365
- <DrawerContent>
366
- <DrawerHeader>
367
- <DrawerTitle>Filters</DrawerTitle>
368
- </DrawerHeader>
369
- {/* content */}
370
- </DrawerContent>
371
- </Drawer>
372
- ```
373
-
374
- ---
375
-
376
- ### Popover
377
-
378
- Floating content anchored to a trigger element.
379
-
380
- ```tsx
381
- import { Popover, PopoverTrigger, PopoverContent } from "@hilum/ui"
382
-
383
- <Popover>
384
- <PopoverTrigger asChild><Button variant="outline">Open</Button></PopoverTrigger>
385
- <PopoverContent>
386
- <p className="body">Popover content here.</p>
387
- </PopoverContent>
388
- </Popover>
389
- ```
390
-
391
- ---
392
-
393
- ### Tooltip
394
-
395
- Short contextual hint on hover/focus.
396
-
397
- ```tsx
398
- import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "@hilum/ui"
399
-
400
- <TooltipProvider>
401
- <Tooltip>
402
- <TooltipTrigger asChild><Button size="icon"><Settings /></Button></TooltipTrigger>
403
- <TooltipContent>Settings</TooltipContent>
404
- </Tooltip>
405
- </TooltipProvider>
406
- ```
407
-
408
- Wrap app root with `<TooltipProvider>` once.
409
-
410
- ---
411
-
412
- ### Dropdown Menu
413
-
414
- Context menu for actions attached to a trigger button.
415
-
416
- ```tsx
417
- import {
418
- DropdownMenu, DropdownMenuTrigger, DropdownMenuContent,
419
- DropdownMenuItem, DropdownMenuSeparator, DropdownMenuLabel,
420
- } from "@hilum/ui"
421
-
422
- <DropdownMenu>
423
- <DropdownMenuTrigger asChild><Button variant="outline">Actions</Button></DropdownMenuTrigger>
424
- <DropdownMenuContent>
425
- <DropdownMenuLabel>My account</DropdownMenuLabel>
426
- <DropdownMenuSeparator />
427
- <DropdownMenuItem>Profile</DropdownMenuItem>
428
- <DropdownMenuItem>Settings</DropdownMenuItem>
429
- <DropdownMenuSeparator />
430
- <DropdownMenuItem className="text-destructive">Sign out</DropdownMenuItem>
431
- </DropdownMenuContent>
432
- </DropdownMenu>
433
- ```
434
-
435
- ---
436
-
437
- ### Context Menu
438
-
439
- Right-click / long-press menu.
440
-
441
- ```tsx
442
- import {
443
- ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem,
444
- } from "@hilum/ui"
445
-
446
- <ContextMenu>
447
- <ContextMenuTrigger>Right-click me</ContextMenuTrigger>
448
- <ContextMenuContent>
449
- <ContextMenuItem>Copy</ContextMenuItem>
450
- <ContextMenuItem>Paste</ContextMenuItem>
451
- <ContextMenuItem className="text-destructive">Delete</ContextMenuItem>
452
- </ContextMenuContent>
453
- </ContextMenu>
454
- ```
455
-
456
- ---
457
-
458
- ### Card
459
-
460
- Versatile surface container.
461
-
462
- ```tsx
463
- import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@hilum/ui"
464
-
465
- <Card>
466
- <CardHeader>
467
- <CardTitle className="subheading">Card title</CardTitle>
468
- <CardDescription className="body">Supporting text.</CardDescription>
469
- </CardHeader>
470
- <CardContent>
471
- <p className="body text-ground-500">Content goes here.</p>
472
- </CardContent>
473
- <CardFooter>
474
- <Button>Action</Button>
475
- </CardFooter>
476
- </Card>
477
- ```
478
-
479
- Variants: `default` (white with natural shadow), `muted` (ground-50).
480
-
481
- ---
482
-
483
- ### Tabs
484
-
485
- Horizontal tab navigation with content panels.
486
-
487
- ```tsx
488
- import { Tabs, TabsList, TabsTrigger, TabsContent } from "@hilum/ui"
489
-
490
- <Tabs defaultValue="overview">
491
- <TabsList>
492
- <TabsTrigger value="overview">Overview</TabsTrigger>
493
- <TabsTrigger value="settings">Settings</TabsTrigger>
494
- <TabsTrigger value="billing">Billing</TabsTrigger>
495
- </TabsList>
496
- <TabsContent value="overview">Overview content</TabsContent>
497
- <TabsContent value="settings">Settings content</TabsContent>
498
- <TabsContent value="billing">Billing content</TabsContent>
499
- </Tabs>
500
- ```
501
-
502
- ---
503
-
504
- ### Accordion
505
-
506
- Collapsible content sections.
507
-
508
- ```tsx
509
- import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@hilum/ui"
510
-
511
- <Accordion type="single" collapsible>
512
- <AccordionItem value="item-1">
513
- <AccordionTrigger>Is it accessible?</AccordionTrigger>
514
- <AccordionContent>Yes. It adheres to WAI-ARIA.</AccordionContent>
515
- </AccordionItem>
516
- <AccordionItem value="item-2">
517
- <AccordionTrigger>Is it styled?</AccordionTrigger>
518
- <AccordionContent>Yes. Comes with default styles.</AccordionContent>
519
- </AccordionItem>
520
- </Accordion>
521
- ```
522
-
523
- `type`: `"single"` | `"multiple"`. `collapsible`: allow closing when single.
524
-
525
- ---
526
-
527
- ### Avatar
528
-
529
- User profile image with fallback initials.
530
-
531
- ```tsx
532
- import { Avatar, AvatarImage, AvatarFallback } from "@hilum/ui"
533
-
534
- <Avatar>
535
- <AvatarImage src="https://example.com/photo.jpg" alt="Jane Doe" />
536
- <AvatarFallback>JD</AvatarFallback>
537
- </Avatar>
538
-
539
- // Sizes: xs, sm, default, lg, xl
540
- <Avatar size="sm"><AvatarFallback>AB</AvatarFallback></Avatar>
541
- ```
542
-
543
- ---
544
-
545
- ### Avatar Stack
546
-
547
- Overlapping row of avatars with overflow count.
548
-
549
- ```tsx
550
- import { AvatarStack, Avatar, AvatarFallback } from "@hilum/ui"
551
-
552
- <AvatarStack>
553
- <Avatar><AvatarFallback>AB</AvatarFallback></Avatar>
554
- <Avatar><AvatarFallback>CD</AvatarFallback></Avatar>
555
- <Avatar><AvatarFallback>EF</AvatarFallback></Avatar>
556
- </AvatarStack>
557
- ```
558
-
559
- ---
560
-
561
- ### Checkbox
562
-
563
- Binary selection with accessible label.
564
-
565
- ```tsx
566
- import { Checkbox } from "@hilum/ui"
567
-
568
- <div className="flex items-center gap-2">
569
- <Checkbox id="terms" checked={checked} onCheckedChange={setChecked} />
570
- <Label htmlFor="terms">Accept terms and conditions</Label>
571
- </div>
572
- ```
573
-
574
- ---
575
-
576
- ### Switch
577
-
578
- Toggle between two states.
579
-
580
- ```tsx
581
- import { Switch } from "@hilum/ui"
582
-
583
- <Switch checked={enabled} onCheckedChange={setEnabled} />
584
- ```
585
-
586
- ---
587
-
588
- ### Slider
589
-
590
- Range input for selecting a numeric value.
591
-
592
- ```tsx
593
- import { Slider } from "@hilum/ui"
594
-
595
- <Slider
596
- min={0}
597
- max={100}
598
- step={1}
599
- value={[volume]}
600
- onValueChange={([v]) => setVolume(v)}
601
- />
602
- ```
603
-
604
- ---
605
-
606
- ### Radio Group
607
-
608
- Single-selection from a group of options.
609
-
610
- ```tsx
611
- import { RadioGroup, RadioGroupItem } from "@hilum/ui"
612
-
613
- <RadioGroup value={plan} onValueChange={setPlan}>
614
- <div className="flex items-center gap-2">
615
- <RadioGroupItem value="starter" id="starter" />
616
- <Label htmlFor="starter">Starter</Label>
617
- </div>
618
- <div className="flex items-center gap-2">
619
- <RadioGroupItem value="pro" id="pro" />
620
- <Label htmlFor="pro">Pro</Label>
621
- </div>
622
- </RadioGroup>
623
- ```
624
-
625
- ---
626
-
627
- ### Progress
628
-
629
- Linear progress indicator.
630
-
631
- ```tsx
632
- import { Progress } from "@hilum/ui"
633
-
634
- <Progress value={72} /> // 0–100
635
- ```
636
-
637
- ---
638
-
639
- ### Skeleton
640
-
641
- Loading placeholder that matches content layout.
642
-
643
- ```tsx
644
- import { Skeleton } from "@hilum/ui"
645
-
646
- <Skeleton className="h-4 w-48 rounded" />
647
- <Skeleton className="h-32 w-full rounded-xl" />
648
- ```
649
-
650
- ---
651
-
652
- ### Spinner
653
-
654
- Animated loading indicator.
655
-
656
- ```tsx
657
- import { Spinner } from "@hilum/ui"
658
-
659
- <Spinner />
660
- <Spinner size="sm" />
661
- <Spinner size="lg" />
662
- ```
663
-
664
- ---
665
-
666
- ### Separator
667
-
668
- Horizontal or vertical divider line.
669
-
670
- ```tsx
671
- import { Separator } from "@hilum/ui"
672
-
673
- <Separator />
674
- <Separator orientation="vertical" className="h-8" />
675
- ```
676
-
677
- ---
678
-
679
- ### Breadcrumb
680
-
681
- Navigation hierarchy indicator.
682
-
683
- ```tsx
684
- import {
685
- Breadcrumb, BreadcrumbList, BreadcrumbItem,
686
- BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator,
687
- } from "@hilum/ui"
688
-
689
- <Breadcrumb>
690
- <BreadcrumbList>
691
- <BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
692
- <BreadcrumbSeparator />
693
- <BreadcrumbItem><BreadcrumbLink href="/docs">Docs</BreadcrumbLink></BreadcrumbItem>
694
- <BreadcrumbSeparator />
695
- <BreadcrumbItem><BreadcrumbPage>Button</BreadcrumbPage></BreadcrumbItem>
696
- </BreadcrumbList>
697
- </Breadcrumb>
698
- ```
699
-
700
- ---
701
-
702
- ### Pagination
703
-
704
- Page navigation for data lists.
705
-
706
- ```tsx
707
- import {
708
- Pagination, PaginationContent, PaginationItem,
709
- PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis,
710
- } from "@hilum/ui"
711
-
712
- <Pagination>
713
- <PaginationContent>
714
- <PaginationItem><PaginationPrevious href="#" /></PaginationItem>
715
- <PaginationItem><PaginationLink href="#">1</PaginationLink></PaginationItem>
716
- <PaginationItem><PaginationEllipsis /></PaginationItem>
717
- <PaginationItem><PaginationLink href="#" isActive>5</PaginationLink></PaginationItem>
718
- <PaginationItem><PaginationNext href="#" /></PaginationItem>
719
- </PaginationContent>
720
- </Pagination>
721
- ```
722
-
723
- ---
724
-
725
- ### Table
726
-
727
- Data table with header, body, and footer.
728
-
729
- ```tsx
730
- import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption } from "@hilum/ui"
731
-
732
- <Table>
733
- <TableHeader>
734
- <TableRow>
735
- <TableHead>Name</TableHead>
736
- <TableHead>Status</TableHead>
737
- <TableHead className="text-right">Amount</TableHead>
738
- </TableRow>
739
- </TableHeader>
740
- <TableBody>
741
- <TableRow>
742
- <TableCell className="font-medium">Alice</TableCell>
743
- <TableCell><Badge variant="success">Active</Badge></TableCell>
744
- <TableCell className="text-right">$250</TableCell>
745
- </TableRow>
746
- </TableBody>
747
- </Table>
748
- ```
749
-
750
- ---
751
-
752
- ### Data Table
753
-
754
- Full-featured table with sorting, filtering, pagination via `@tanstack/react-table`.
755
-
756
- ```tsx
757
- import { DataTable } from "@hilum/ui"
758
- import { ColumnDef } from "@tanstack/react-table"
759
-
760
- const columns: ColumnDef<User>[] = [
761
- { accessorKey: "name", header: "Name" },
762
- { accessorKey: "email", header: "Email" },
763
- { accessorKey: "role", header: "Role" },
764
- ]
765
-
766
- <DataTable columns={columns} data={users} />
767
- ```
768
-
769
- ---
770
-
771
- ### Calendar
772
-
773
- Date picker calendar grid.
774
-
775
- ```tsx
776
- import { Calendar } from "@hilum/ui"
777
-
778
- <Calendar
779
- mode="single"
780
- selected={date}
781
- onSelect={setDate}
782
- />
783
- ```
784
-
785
- Modes: `"single"` | `"multiple"` | `"range"`. Powered by `react-day-picker`.
786
-
787
- ---
788
-
789
- ### Date Picker
790
-
791
- Calendar in a popover triggered by a button.
792
-
793
- ```tsx
794
- import { DatePicker } from "@hilum/ui"
795
-
796
- <DatePicker value={date} onChange={setDate} placeholder="Pick a date" />
797
- ```
798
-
799
- ---
800
-
801
- ### Command
802
-
803
- Command palette / search interface.
804
-
805
- ```tsx
806
- import {
807
- Command, CommandInput, CommandList,
808
- CommandEmpty, CommandGroup, CommandItem, CommandSeparator,
809
- } from "@hilum/ui"
810
-
811
- <Command>
812
- <CommandInput placeholder="Search..." />
813
- <CommandList>
814
- <CommandEmpty>No results found.</CommandEmpty>
815
- <CommandGroup heading="Actions">
816
- <CommandItem>New file</CommandItem>
817
- <CommandItem>New folder</CommandItem>
818
- </CommandGroup>
819
- <CommandSeparator />
820
- <CommandGroup heading="Navigation">
821
- <CommandItem>Dashboard</CommandItem>
822
- </CommandGroup>
823
- </CommandList>
824
- </Command>
825
- ```
826
-
827
- ---
828
-
829
- ### Navigation Menu
830
-
831
- Horizontal nav with mega-menu dropdowns.
832
-
833
- ```tsx
834
- import {
835
- NavigationMenu, NavigationMenuList, NavigationMenuItem,
836
- NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink,
837
- } from "@hilum/ui"
838
-
839
- <NavigationMenu>
840
- <NavigationMenuList>
841
- <NavigationMenuItem>
842
- <NavigationMenuTrigger>Products</NavigationMenuTrigger>
843
- <NavigationMenuContent>
844
- {/* Grid of links */}
845
- </NavigationMenuContent>
846
- </NavigationMenuItem>
847
- <NavigationMenuItem>
848
- <NavigationMenuLink href="/pricing">Pricing</NavigationMenuLink>
849
- </NavigationMenuItem>
850
- </NavigationMenuList>
851
- </NavigationMenu>
852
- ```
853
-
854
- ---
855
-
856
- ### Menubar
857
-
858
- Application-style horizontal menu bar.
859
-
860
- ```tsx
861
- import {
862
- Menubar, MenubarMenu, MenubarTrigger, MenubarContent,
863
- MenubarItem, MenubarSeparator, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem,
864
- } from "@hilum/ui"
865
-
866
- <Menubar>
867
- <MenubarMenu>
868
- <MenubarTrigger>File</MenubarTrigger>
869
- <MenubarContent>
870
- <MenubarItem>New File <MenubarShortcut>⌘N</MenubarShortcut></MenubarItem>
871
- <MenubarSeparator />
872
- <MenubarItem>Save <MenubarShortcut>⌘S</MenubarShortcut></MenubarItem>
873
- </MenubarContent>
874
- </MenubarMenu>
875
- </Menubar>
876
- ```
877
-
878
- ---
879
-
880
- ### Sidebar
881
-
882
- Full application sidebar with navigation groups, collapsible sections, and sticky header/footer.
883
-
884
- ```tsx
885
- import {
886
- SidebarProvider, Sidebar, SidebarHeader, SidebarContent,
887
- SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuItem,
888
- SidebarMenuButton, SidebarFooter,
889
- } from "@hilum/ui"
890
-
891
- <SidebarProvider>
892
- <Sidebar>
893
- <SidebarHeader>Logo / brand</SidebarHeader>
894
- <SidebarContent>
895
- <SidebarGroup>
896
- <SidebarGroupLabel>Navigation</SidebarGroupLabel>
897
- <SidebarMenu>
898
- <SidebarMenuItem>
899
- <SidebarMenuButton asChild>
900
- <a href="/dashboard">Dashboard</a>
901
- </SidebarMenuButton>
902
- </SidebarMenuItem>
903
- </SidebarMenu>
904
- </SidebarGroup>
905
- </SidebarContent>
906
- <SidebarFooter>Footer content</SidebarFooter>
907
- </Sidebar>
908
- <main>{/* page content */}</main>
909
- </SidebarProvider>
910
- ```
911
-
912
- ---
913
-
914
- ### Chart
915
-
916
- Recharts-based data visualizations (line, bar, area, pie, radar, radial).
917
-
918
- ```tsx
919
- import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@hilum/ui"
920
- import { LineChart, Line, XAxis, YAxis, CartesianGrid } from "recharts"
921
-
922
- const config = {
923
- revenue: { label: "Revenue", color: "var(--color-brand-primary)" },
924
- }
925
-
926
- <ChartContainer config={config} className="h-64">
927
- <LineChart data={data}>
928
- <CartesianGrid strokeDasharray="3 3" stroke="var(--color-ground-100)" />
929
- <XAxis dataKey="month" />
930
- <YAxis />
931
- <ChartTooltip content={<ChartTooltipContent />} />
932
- <Line type="monotone" dataKey="revenue" stroke="var(--chart-1)" />
933
- </LineChart>
934
- </ChartContainer>
935
- ```
936
-
937
- ---
938
-
939
- ### Carousel
940
-
941
- Horizontal scrolling carousel.
942
-
943
- ```tsx
944
- import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext } from "@hilum/ui"
945
-
946
- <Carousel>
947
- <CarouselContent>
948
- <CarouselItem><Card>Slide 1</Card></CarouselItem>
949
- <CarouselItem><Card>Slide 2</Card></CarouselItem>
950
- <CarouselItem><Card>Slide 3</Card></CarouselItem>
951
- </CarouselContent>
952
- <CarouselPrevious />
953
- <CarouselNext />
954
- </Carousel>
955
- ```
956
-
957
- ---
958
-
959
- ### Hover Card
960
-
961
- Rich preview card that appears on hover.
962
-
963
- ```tsx
964
- import { HoverCard, HoverCardTrigger, HoverCardContent } from "@hilum/ui"
965
-
966
- <HoverCard>
967
- <HoverCardTrigger asChild>
968
- <a href="#">@hilum_labs</a>
969
- </HoverCardTrigger>
970
- <HoverCardContent>
971
- <p className="body font-medium">Hilum Labs</p>
972
- <p className="caption text-ground-400">Building the future of education.</p>
973
- </HoverCardContent>
974
- </HoverCard>
975
- ```
976
-
977
- ---
978
-
979
- ### Collapsible
980
-
981
- Show/hide any content section.
982
-
983
- ```tsx
984
- import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@hilum/ui"
985
-
986
- <Collapsible open={open} onOpenChange={setOpen}>
987
- <CollapsibleTrigger asChild>
988
- <Button variant="ghost">Advanced options <ChevronDown size={14} /></Button>
989
- </CollapsibleTrigger>
990
- <CollapsibleContent>
991
- {/* hidden content */}
992
- </CollapsibleContent>
993
- </Collapsible>
994
- ```
995
-
996
- ---
997
-
998
- ### Resizable
999
-
1000
- Draggable panels for split layouts.
1001
-
1002
- ```tsx
1003
- import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@hilum/ui"
1004
-
1005
- <ResizablePanelGroup direction="horizontal" className="h-64 rounded-xl border">
1006
- <ResizablePanel defaultSize={30}>Left</ResizablePanel>
1007
- <ResizableHandle />
1008
- <ResizablePanel>Right</ResizablePanel>
1009
- </ResizablePanelGroup>
1010
- ```
1011
-
1012
- ---
1013
-
1014
- ### Scroll Area
1015
-
1016
- Custom scrollbar for overflow containers.
1017
-
1018
- ```tsx
1019
- import { ScrollArea } from "@hilum/ui"
1020
-
1021
- <ScrollArea className="h-48 w-full">
1022
- {/* long content */}
1023
- </ScrollArea>
1024
- ```
1025
-
1026
- ---
1027
-
1028
- ### Kbd
1029
-
1030
- Keyboard shortcut display.
1031
-
1032
- ```tsx
1033
- import { Kbd } from "@hilum/ui"
1034
-
1035
- <p className="body">Press <Kbd>⌘</Kbd> + <Kbd>K</Kbd> to open the command palette.</p>
1036
- ```
1037
-
1038
- ---
1039
-
1040
- ### Alert
1041
-
1042
- Contextual feedback for user actions or system states.
1043
-
1044
- ```tsx
1045
- import { Alert, AlertTitle, AlertDescription } from "@hilum/ui"
1046
- import { Terminal } from "lucide-react"
1047
-
1048
- <Alert>
1049
- <Terminal size={16} />
1050
- <AlertTitle>Heads up!</AlertTitle>
1051
- <AlertDescription>You can add components and dependencies to your app.</AlertDescription>
1052
- </Alert>
1053
-
1054
- <Alert variant="destructive">
1055
- <AlertTitle>Error</AlertTitle>
1056
- <AlertDescription>Something went wrong. Please try again.</AlertDescription>
1057
- </Alert>
1058
- ```
1059
-
1060
- ---
1061
-
1062
- ### Alert Dialog
1063
-
1064
- Modal that requires user confirmation before a destructive action.
1065
-
1066
- ```tsx
1067
- import {
1068
- AlertDialog, AlertDialogTrigger, AlertDialogContent,
1069
- AlertDialogHeader, AlertDialogTitle, AlertDialogDescription,
1070
- AlertDialogFooter, AlertDialogCancel, AlertDialogAction,
1071
- } from "@hilum/ui"
1072
-
1073
- <AlertDialog>
1074
- <AlertDialogTrigger asChild><Button variant="destructive">Delete</Button></AlertDialogTrigger>
1075
- <AlertDialogContent>
1076
- <AlertDialogHeader>
1077
- <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
1078
- <AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
1079
- </AlertDialogHeader>
1080
- <AlertDialogFooter>
1081
- <AlertDialogCancel>Cancel</AlertDialogCancel>
1082
- <AlertDialogAction>Continue</AlertDialogAction>
1083
- </AlertDialogFooter>
1084
- </AlertDialogContent>
1085
- </AlertDialog>
1086
- ```
1087
-
1088
- ---
1089
-
1090
- ### Sonner (Toast)
1091
-
1092
- Non-blocking notification toasts. Requires `<Toaster />` in app root.
1093
-
1094
- ```tsx
1095
- // App.tsx
1096
- import { Toaster } from "@hilum/ui"
1097
- <Toaster />
1098
-
1099
- // Anywhere in the app
1100
- import { toast } from "sonner"
1101
-
1102
- toast("Event has been created")
1103
- toast.success("Profile saved successfully")
1104
- toast.error("Something went wrong")
1105
- toast.loading("Uploading...")
1106
- toast.promise(uploadFn(), {
1107
- loading: "Uploading...",
1108
- success: "Done!",
1109
- error: "Upload failed",
1110
- })
1111
- ```
1112
-
1113
- ---
1114
-
1115
- ### Input OTP
1116
-
1117
- One-time password / PIN code input.
1118
-
1119
- ```tsx
1120
- import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from "@hilum/ui"
1121
-
1122
- <InputOTP maxLength={6} value={otp} onChange={setOtp}>
1123
- <InputOTPGroup>
1124
- <InputOTPSlot index={0} />
1125
- <InputOTPSlot index={1} />
1126
- <InputOTPSlot index={2} />
1127
- </InputOTPGroup>
1128
- <InputOTPSeparator />
1129
- <InputOTPGroup>
1130
- <InputOTPSlot index={3} />
1131
- <InputOTPSlot index={4} />
1132
- <InputOTPSlot index={5} />
1133
- </InputOTPGroup>
1134
- </InputOTP>
1135
- ```
1136
-
1137
- ---
1138
-
1139
- ### Steps
1140
-
1141
- Step indicator for multi-step flows.
1142
-
1143
- ```tsx
1144
- import { Steps, Step } from "@hilum/ui"
1145
-
1146
- <Steps current={1}>
1147
- <Step label="Account" />
1148
- <Step label="Profile" />
1149
- <Step label="Review" />
1150
- </Steps>
1151
- ```
1152
-
1153
- Props: `current` (0-indexed), `orientation` (`"horizontal"` | `"vertical"`).
1154
-
1155
- ---
1156
-
1157
- ### Toggle / Toggle Group
1158
-
1159
- Single or grouped toggle buttons.
1160
-
1161
- ```tsx
1162
- import { Toggle } from "@hilum/ui"
1163
- import { Bold, Italic, Underline } from "lucide-react"
1164
-
1165
- <Toggle pressed={bold} onPressedChange={setBold}><Bold size={14} /></Toggle>
1166
-
1167
- // Group
1168
- import { ToggleGroup, ToggleGroupItem } from "@hilum/ui"
1169
-
1170
- <ToggleGroup type="multiple" value={formatting} onValueChange={setFormatting}>
1171
- <ToggleGroupItem value="bold"><Bold size={14} /></ToggleGroupItem>
1172
- <ToggleGroupItem value="italic"><Italic size={14} /></ToggleGroupItem>
1173
- <ToggleGroupItem value="underline"><Underline size={14} /></ToggleGroupItem>
1174
- </ToggleGroup>
1175
- ```
1176
-
1177
- ---
1178
-
1179
- ### Aspect Ratio
1180
-
1181
- Maintains a fixed aspect ratio for any child.
1182
-
1183
- ```tsx
1184
- import { AspectRatio } from "@hilum/ui"
1185
-
1186
- <AspectRatio ratio={16 / 9} className="bg-ground-100 rounded-xl overflow-hidden">
1187
- <img src="..." className="w-full h-full object-cover" />
1188
- </AspectRatio>
1189
- ```
1190
-
1191
- ---
1192
-
1193
- ### Button Group
1194
-
1195
- Groups buttons into a connected row with shared borders.
1196
-
1197
- ```tsx
1198
- import { ButtonGroup } from "@hilum/ui"
1199
-
1200
- <ButtonGroup>
1201
- <Button variant="outline">Bold</Button>
1202
- <Button variant="outline">Italic</Button>
1203
- <Button variant="outline">Underline</Button>
1204
- </ButtonGroup>
1205
- ```
1206
-
1207
- ---
1208
-
1209
- ### Native Select
1210
-
1211
- Native `<select>` styled to match the design system.
1212
-
1213
- ```tsx
1214
- import { NativeSelect } from "@hilum/ui"
1215
-
1216
- <NativeSelect value={country} onChange={e => setCountry(e.target.value)}>
1217
- <option value="">Select country</option>
1218
- <option value="us">United States</option>
1219
- <option value="uk">United Kingdom</option>
1220
- </NativeSelect>
1221
- ```
1222
-
1223
- ---
1224
-
1225
- ## Molecules
1226
-
1227
- Composed patterns built from atoms.
1228
-
1229
- ---
1230
-
1231
- ### Field
1232
-
1233
- Labeled form field with hint and error support. (See Atoms → Field above.)
1234
-
1235
- ---
1236
-
1237
- ### Input Group
1238
-
1239
- Input with leading/trailing addons (icons, buttons, text).
1240
-
1241
- ```tsx
1242
- import { InputGroup, InputGroupAddon } from "@hilum/ui"
1243
-
1244
- <InputGroup>
1245
- <InputGroupAddon><Mail size={14} className="text-ground-400" /></InputGroupAddon>
1246
- <Input placeholder="Email address" />
1247
- </InputGroup>
1248
-
1249
- <InputGroup>
1250
- <Input placeholder="0.00" />
1251
- <InputGroupAddon>USD</InputGroupAddon>
1252
- </InputGroup>
1253
- ```
1254
-
1255
- ---
1256
-
1257
- ### Stat Card
1258
-
1259
- Metric display with label, value, trend, and optional icon.
1260
-
1261
- ```tsx
1262
- import { StatCard } from "@hilum/ui"
1263
- import { TrendingUp } from "lucide-react"
1264
-
1265
- <StatCard
1266
- label="Total revenue"
1267
- value="$45,231"
1268
- change="+20.1%"
1269
- trend="up"
1270
- icon={TrendingUp}
1271
- />
1272
- ```
1273
-
1274
- Props: `label`, `value`, `change`, `trend` (`"up"` | `"down"` | `"neutral"`), `icon`.
1275
-
1276
- ---
1277
-
1278
- ### Empty State
1279
-
1280
- Zero-state UI for empty lists or no-results states.
1281
-
1282
- ```tsx
1283
- import { EmptyState } from "@hilum/ui"
1284
- import { FileX } from "lucide-react"
1285
-
1286
- <EmptyState
1287
- icon={FileX}
1288
- title="No documents found"
1289
- description="Try adjusting your filters or create a new document."
1290
- action={<Button>New document</Button>}
1291
- />
1292
- ```
1293
-
1294
- ---
1295
-
1296
- ### Section Heading
1297
-
1298
- Labeled section divider with optional action.
1299
-
1300
- ```tsx
1301
- import { SectionHeading } from "@hilum/ui"
1302
-
1303
- <SectionHeading title="Recent activity" />
1304
- <SectionHeading title="Team members" action={<Button size="sm">Invite</Button>} />
1305
- ```
1306
-
1307
- ---
1308
-
1309
- ### Page Heading
1310
-
1311
- Full-width page header with title, description, breadcrumb, and actions.
1312
-
1313
- ```tsx
1314
- import { PageHeading } from "@hilum/ui"
1315
-
1316
- <PageHeading
1317
- title="Projects"
1318
- description="Manage your team's active projects."
1319
- action={<Button>New project</Button>}
1320
- />
1321
- ```
1322
-
1323
- ---
1324
-
1325
- ### Card Heading
1326
-
1327
- Section header inside a card — title, description, and optional right-side action.
1328
-
1329
- ```tsx
1330
- import { CardHeading } from "@hilum/ui"
1331
-
1332
- <CardHeading
1333
- title="Team members"
1334
- description="Invite and manage access."
1335
- action={<Button size="sm" variant="outline">Invite</Button>}
1336
- />
1337
- ```
1338
-
1339
- ---
1340
-
1341
- ### Activity Feed
1342
-
1343
- Vertical timeline of events.
1344
-
1345
- ```tsx
1346
- import { ActivityFeed, ActivityFeedItem } from "@hilum/ui"
1347
- import { GitCommit } from "lucide-react"
1348
-
1349
- <ActivityFeed>
1350
- <ActivityFeedItem
1351
- icon={GitCommit}
1352
- title="Merged pull request #42"
1353
- description="main ← feat/theming"
1354
- timestamp="2 hours ago"
1355
- />
1356
- </ActivityFeed>
1357
- ```
1358
-
1359
- ---
1360
-
1361
- ### Stacked List
1362
-
1363
- Vertical list of items with dividers.
1364
-
1365
- ```tsx
1366
- import { StackedList, StackedListItem } from "@hilum/ui"
1367
-
1368
- <StackedList>
1369
- <StackedListItem
1370
- primary="Alice Johnson"
1371
- secondary="alice@example.com"
1372
- meta="Admin"
1373
- avatar={<Avatar size="sm"><AvatarFallback>AJ</AvatarFallback></Avatar>}
1374
- />
1375
- </StackedList>
1376
- ```
1377
-
1378
- ---
1379
-
1380
- ### Grid List
1381
-
1382
- Responsive card grid.
1383
-
1384
- ```tsx
1385
- import { GridList, GridListItem } from "@hilum/ui"
1386
-
1387
- <GridList>
1388
- {items.map(item => (
1389
- <GridListItem key={item.id} title={item.name} description={item.desc} />
1390
- ))}
1391
- </GridList>
1392
- ```
1393
-
1394
- ---
1395
-
1396
- ### Description List
1397
-
1398
- Key–value pairs, typically for detail/profile views.
1399
-
1400
- ```tsx
1401
- import { DescriptionList, DescriptionListItem } from "@hilum/ui"
1402
-
1403
- <DescriptionList>
1404
- <DescriptionListItem label="Full name" value="Alice Johnson" />
1405
- <DescriptionListItem label="Email" value="alice@example.com" />
1406
- <DescriptionListItem label="Role" value="Administrator" />
1407
- </DescriptionList>
1408
- ```
1409
-
1410
- ---
1411
-
1412
- ### Notification
1413
-
1414
- Single notification item with icon, title, message, and timestamp.
1415
-
1416
- ```tsx
1417
- import { Notification } from "@hilum/ui"
1418
-
1419
- <Notification
1420
- title="New message"
1421
- description="Alice sent you a message in #general"
1422
- timestamp="5 minutes ago"
1423
- unread
1424
- />
1425
- ```
1426
-
1427
- ---
1428
-
1429
- ### Media Object
1430
-
1431
- Horizontal layout: media (image/icon/avatar) + content body.
1432
-
1433
- ```tsx
1434
- import { MediaObject } from "@hilum/ui"
1435
-
1436
- <MediaObject
1437
- media={<Avatar><AvatarFallback>AB</AvatarFallback></Avatar>}
1438
- title="Alice Brown"
1439
- description="Sent you a project update for Q3 2025."
1440
- meta="2h ago"
1441
- />
1442
- ```
1443
-
1444
- ---
1445
-
1446
- ### Radio Card
1447
-
1448
- Selectable card with radio button — used for plan/option selection.
1449
-
1450
- ```tsx
1451
- import { RadioCard, RadioCardGroup } from "@hilum/ui"
1452
-
1453
- <RadioCardGroup value={plan} onValueChange={setPlan}>
1454
- <RadioCard value="starter" title="Starter" description="Up to 5 users" price="$9/mo" />
1455
- <RadioCard value="pro" title="Pro" description="Up to 50 users" price="$49/mo" />
1456
- </RadioCardGroup>
1457
- ```
1458
-
1459
- ---
1460
-
1461
- ### Action Panel
1462
-
1463
- Bordered panel with a title, description, and a call-to-action.
1464
-
1465
- ```tsx
1466
- import { ActionPanel } from "@hilum/ui"
1467
-
1468
- <ActionPanel
1469
- title="Danger zone"
1470
- description="Deleting your account is permanent and cannot be undone."
1471
- action={<Button variant="destructive">Delete account</Button>}
1472
- />
1473
- ```
1474
-
1475
- ---
1476
-
1477
- ### Command Palette
1478
-
1479
- Full-screen search overlay, usually opened by ⌘K.
1480
-
1481
- ```tsx
1482
- import { CommandPalette } from "@hilum/ui"
1483
-
1484
- // Open state controlled externally
1485
- <CommandPalette
1486
- open={open}
1487
- onOpenChange={setOpen}
1488
- items={[
1489
- { id: "dashboard", label: "Go to Dashboard", href: "/dashboard" },
1490
- { id: "settings", label: "Open Settings", href: "/settings" },
1491
- ]}
1492
- />
1493
- ```
1494
-
1495
- ---
1496
-
1497
- ## Utilities
1498
-
1499
- ```tsx
1500
- import { cn } from "@hilum/ui"
1501
-
1502
- // Tailwind class merge utility (clsx + tailwind-merge)
1503
- <div className={cn("p-4 rounded-xl", isActive && "bg-brand-primary text-white")} />
1504
- ```
1505
-
1506
- ---
1507
-
1508
- ## Icons
1509
-
1510
- Curated subset from lucide-react, re-exported for convenience:
1511
-
1512
- ```tsx
1513
- import { PlusIcon, SearchIcon, SettingsIcon } from "@hilum/ui/icons"
1514
- ```
1515
-
1516
- ---
1517
-
1518
- ## Design decisions
1519
-
1520
- - **Framework-agnostic React** — works in client-rendered apps, TanStack Start prerendered docs, and Electron
1521
- - **Tailwind v4** — CSS-variable-backed utilities, runtime-overridable via `createTheme`
1522
- - **Radix UI primitives** — all interactive components are WAI-ARIA compliant
1523
- - **Lockstep versioning** — all packages release together
1524
- - **OKLCH color space** — all generated palettes use perceptually uniform interpolation
51
+ Primary exports:
52
+ - `createTheme({ primary, secondary })` returns `{ css, palette }`
53
+ - `applyTheme({ primary, secondary })` injects theme CSS in the browser
54
+ - `<ThemeProvider primary secondary>` applies theme CSS from React
55
+
56
+ ## Documentation
57
+
58
+ - Overview: https://ui.hilum.dev/
59
+ - Foundations: https://ui.hilum.dev/foundations
60
+ - Theming: https://ui.hilum.dev/theming
61
+ - Atoms: https://ui.hilum.dev/atoms
62
+ - Molecules: https://ui.hilum.dev/molecules
63
+ - Blocks: https://ui.hilum.dev/blocks
64
+ - Marketing: https://ui.hilum.dev/marketing
65
+ - Ecommerce: https://ui.hilum.dev/ecommerce
66
+ - Application UI: https://ui.hilum.dev/application-ui
67
+ - Designer: https://ui.hilum.dev/designer
68
+
69
+ ## Component Index
70
+
71
+ - Account Menu (/molecules/account-menu/) — Structured account dropdown with profile header, sections, action rows, and separators. Composes: Dropdown Menu · Avatar.
72
+ - Accordion (/atoms/accordion/) — Vertically stacked sections that expand and collapse.
73
+ - Action Panel (/molecules/action-panel/) — Bordered panel that communicates one focused action. Composes: Button · Card.
74
+ - Activity Feed (/molecules/activity-feed/) — Vertical timeline of events with icons, rich content, and timestamps. Composes: Icon.
75
+ - Alert Dialog (/atoms/alert-dialog/) — Confirmation modal that requires explicit action before proceeding.
76
+ - Alert (/atoms/alert/) — Inline message communicating status or feedback.
77
+ - Aspect Ratio (/atoms/aspect-ratio/) — Constrains content to a specific width-to-height ratio.
78
+ - Avatar Stack (/atoms/avatar-stack/) — Overlapping group of avatars with optional overflow badge.
79
+ - Avatar (/atoms/avatar/) — User representations with image, fallback, and optional status indicator.
80
+ - Badge (/atoms/badge/) — Compact labels for status, categories, and metadata.
81
+ - Breadcrumb (/atoms/breadcrumb/) — Navigation trail showing the current page location.
82
+ - Button Group (/atoms/button-group/) — Multiple related actions presented as a unified joined control.
83
+ - Button (/atoms/button/) — Triggers actions. Supports multiple variants, sizes, loading states, and icon compositions.
84
+ - Calendar (/atoms/calendar/) — Date selection calendar with single, range, and multi-select modes.
85
+ - Callout (/atoms/callout/) — Prominent status or guidance panel with icon, actions, and semantic tone.
86
+ - Card Heading (/molecules/card-heading/) — Header row for cards and panels with title, description, leading slot, and actions. Composes: Card · Avatar · Button · Dropdown Menu.
87
+ - Card (/atoms/card/) — Contained surface for grouping related content, media, stats, and article layouts.
88
+ - Carousel (/atoms/carousel/) — Horizontally scrollable item sequence with previous and next controls.
89
+ - Chart (/atoms/chart/) — Recharts-based data visualization with design-system styling.
90
+ - Checkbox (/atoms/checkbox/) — Binary selection control with checked, unchecked, and indeterminate states.
91
+ - Collapsible (/atoms/collapsible/) — Toggleable content region, often used for navigation groups.
92
+ - Color Input (/atoms/color-input/) — Compact color input combining swatch, hex field, and optional opacity control.
93
+ - Color Picker (/atoms/color-picker/) — Popover color selector with native color wheel, hex input, and preset palette.
94
+ - Combobox (/atoms/combobox/) — Searchable select field with autocomplete filtering.
95
+ - Command Palette (/molecules/command-palette/) — Modal search dialog for navigating and executing grouped commands. Composes: Dialog · Input · Icon · Kbd.
96
+ - Command (/atoms/command/) — Composable command menu with search, groups, keyboard navigation, and shortcuts.
97
+ - Context Menu (/atoms/context-menu/) — Right-click menu with nested sub-menus and keyboard support.
98
+ - Data Table (/atoms/data-table/) — Sortable, filterable table powered by TanStack Table.
99
+ - Data Transfer Controls (/molecules/data-transfer-controls/) — Import and export control cluster with optional scope selector and compact menu mode. Composes: Select · Button Group · Dropdown Menu.
100
+ - Date Picker (/atoms/date-picker/) — Date input pattern combining a trigger field with a calendar popover.
101
+ - Description List (/molecules/description-list/) — Key-value pairs for structured details in profiles and settings panels. Composes: Badge · Button.
102
+ - Dialog (/atoms/dialog/) — Modal overlay for focused tasks and confirmations.
103
+ - Drawer (/atoms/drawer/) — Bottom sheet that slides up from the edge, optimized for mobile.
104
+ - Dropdown Menu (/atoms/dropdown-menu/) — Contextual action menu revealed from a trigger.
105
+ - Empty State (/molecules/empty-state/) — Placeholder for empty lists, zero-data views, and no-results scenarios. Composes: Button · Icon.
106
+ - Field (/molecules/field/) — Labeled form control composition with hint and error text. Composes: Label · Input · Textarea.
107
+ - File Dropzone (/atoms/file-dropzone/) — Accessible drag-and-drop file input with loading and selected-file states.
108
+ - Grid List (/molecules/grid-list/) — Responsive grid of cards for simple content, accents, and contact layouts. Composes: Card · Badge · Avatar.
109
+ - Help Tooltip (/atoms/help-tooltip/) — Inline help trigger with tooltip content and optional learn-more link.
110
+ - Hover Card (/atoms/hover-card/) — Rich preview card that appears on hover over a link or element.
111
+ - Input Group (/molecules/input-group/) — Input with leading or trailing text addons, icons, and inset actions. Composes: Input.
112
+ - Input Number (/atoms/input-number/) — Numeric input with steppers, unit suffix, and arrow-key stepping.
113
+ - Input OTP (/atoms/input-otp/) — One-time password input with individual character slots.
114
+ - Input (/atoms/input/) — Single-line text field for user input.
115
+ - Kbd (/atoms/kbd/) — Keyboard shortcut display using compact monospaced styling.
116
+ - Label (/atoms/label/) — Accessible form label that associates text with its control.
117
+ - Media Asset Card (/molecules/media-asset-card/) — Selectable media or file card with grid, list, and responsive orientations. Composes: Card · Icon · Image.
118
+ - Media Object (/molecules/media-object/) — Layout primitive pairing fixed media with flexible text content. Composes: Avatar · Icon.
119
+ - Menubar (/atoms/menubar/) — Horizontal application menu bar with nested dropdown panels.
120
+ - Native Select (/atoms/native-select/) — Styled native HTML select with no JavaScript dropdown overhead.
121
+ - Navigation Menu (/atoms/navigation-menu/) — Top-level navigation with accessible animated dropdown panels.
122
+ - Notification (/molecules/notification/) — Toast-style notification panel with success, error, warning, and info variants. Composes: Icon · Button.
123
+ - Page Heading (/molecules/page-heading/) — Full page header with breadcrumb navigation, title, metadata, and actions. Composes: Button · Badge · Breadcrumb.
124
+ - Pagination (/atoms/pagination/) — Navigation control for multi-page content.
125
+ - Popover (/atoms/popover/) — Floating panel anchored to a trigger for richer contextual content.
126
+ - Progress (/atoms/progress/) — Visual indicator of completion or loading progress.
127
+ - Property Row (/molecules/property-row/) — Horizontal label and control row for designer inspector panels. Composes: Input Number · Color Input · Slider.
128
+ - Radio Cards (/molecules/radio-card/) — Card-style single selection where each option highlights when selected. Composes: Radio Group · Card.
129
+ - Radio Group (/atoms/radio-group/) — Single selection from a set of mutually exclusive options.
130
+ - Resizable (/atoms/resizable/) — Drag-to-resize panel groups for flexible layouts.
131
+ - Rich Text Editor (/atoms/rich-text-editor/) — Toolbar-driven content editor for formatted HTML input.
132
+ - Scroll Area (/atoms/scroll-area/) — Scrollable container with styled custom scrollbar.
133
+ - Searchable Table (/atoms/searchable-table/) — Responsive table with search, filters, sorting, mobile cards, and pagination.
134
+ - Section Heading (/molecules/section-heading/) — Section header with optional description and action buttons. Composes: Button.
135
+ - Select (/atoms/select/) — Dropdown list for choosing a single option.
136
+ - Separator (/atoms/separator/) — Visual divider between sections, horizontal or vertical.
137
+ - Sheet (/atoms/sheet/) — Slide-in panel anchored to a screen edge.
138
+ - Sidebar (/atoms/sidebar/) — Composable side navigation with collapsible, icon, and off-canvas modes.
139
+ - Skeleton (/atoms/skeleton/) — Loading placeholder that mimics the shape of pending content.
140
+ - Slider (/atoms/slider/) — Range input for selecting numeric values.
141
+ - Toast (/atoms/sonner/) — Non-blocking notifications that appear briefly and dismiss automatically.
142
+ - Spinner (/atoms/spinner/) — Animated loading indicator for async operations.
143
+ - Stacked List (/molecules/stacked-list/) — Vertically stacked rows with consistent padding and optional hover behavior. Composes: Badge · Avatar.
144
+ - Stat Card (/molecules/stat-card/) — Metric display card with label, value, optional trend, and optional icon. Composes: Card · Badge · Icon.
145
+ - Status Badge (/atoms/status-badge/) — Semantic badge that maps status values to labels, variants, icons, and dots.
146
+ - Steps (/atoms/steps/) — Multi-step progress indicator with circles, bullets, and progress variants.
147
+ - Switch (/atoms/switch/) — Toggle between two states, on and off.
148
+ - Table (/atoms/table/) — Structured data display with rows and columns.
149
+ - Tabs (/atoms/tabs/) — Organizes content into switchable panels.
150
+ - Textarea (/atoms/textarea/) — Multi-line text field for longer user input.
151
+ - Titled Card (/molecules/titled-card/) — Responsive card wrapper with title, subtitle, actions, and mobile-flattened layout. Composes: Card · Card Heading.
152
+ - Toggle Group (/atoms/toggle-group/) — Set of toggles with single or multiple selection.
153
+ - Toggle (/atoms/toggle/) — Two-state press button for toolbars and filter controls.
154
+ - Tooltip (/atoms/tooltip/) — Brief label that appears on hover or focus to clarify an element.
155
+ - URL Redirect Prompt (/molecules/url-redirect-prompt/) — Redirect recommendation callout shown when an editable URL handle changes. Composes: Callout · Switch.
156
+
157
+ ## Structured Data
158
+
159
+ - `catalog.json` indexes the full docs route map
160
+ - `registry.json` exposes machine-readable marketing block source metadata
161
+ - `llms.txt` is generated from the same component registry used by the catalog