@optimum-intelligence/opti-ui 0.2.0 → 0.4.0

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.
Files changed (136) hide show
  1. package/README.md +105 -3
  2. package/dist/components/accordion/Accordion.d.ts +12 -0
  3. package/dist/components/accordion/Accordion.js +12 -0
  4. package/dist/components/accordion/Accordion.js.map +1 -1
  5. package/dist/components/alert/Alert.d.ts +4 -0
  6. package/dist/components/alert/Alert.js.map +1 -1
  7. package/dist/components/app-shell/AppShell.d.ts +22 -0
  8. package/dist/components/app-shell/AppShell.js +6 -0
  9. package/dist/components/app-shell/AppShell.js.map +1 -1
  10. package/dist/components/avatar/Avatar.d.ts +8 -0
  11. package/dist/components/avatar/Avatar.js +2 -0
  12. package/dist/components/avatar/Avatar.js.map +1 -1
  13. package/dist/components/badge/Badge.d.ts +9 -0
  14. package/dist/components/badge/Badge.js +6 -0
  15. package/dist/components/badge/Badge.js.map +1 -1
  16. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +1 -0
  17. package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
  18. package/dist/components/button/Button.d.ts +8 -0
  19. package/dist/components/button/Button.js +6 -0
  20. package/dist/components/button/Button.js.map +1 -1
  21. package/dist/components/calendar/Calendar.d.ts +3 -0
  22. package/dist/components/calendar/Calendar.js.map +1 -1
  23. package/dist/components/card/Card.d.ts +14 -1
  24. package/dist/components/card/Card.js +13 -0
  25. package/dist/components/card/Card.js.map +1 -1
  26. package/dist/components/choice/Choice.d.ts +13 -0
  27. package/dist/components/choice/Choice.js +10 -0
  28. package/dist/components/choice/Choice.js.map +1 -1
  29. package/dist/components/combobox/Combobox.d.ts +12 -0
  30. package/dist/components/combobox/Combobox.js.map +1 -1
  31. package/dist/components/command-palette/CommandPalette.d.ts +10 -0
  32. package/dist/components/command-palette/CommandPalette.js.map +1 -1
  33. package/dist/components/data-table/DataTable.d.ts +62 -96
  34. package/dist/components/data-table/DataTable.js +452 -418
  35. package/dist/components/data-table/DataTable.js.map +1 -1
  36. package/dist/components/data-table/DataTableContent.d.ts +36 -0
  37. package/dist/components/data-table/DataTableContent.js +550 -0
  38. package/dist/components/data-table/DataTableContent.js.map +1 -0
  39. package/dist/components/data-table/DataTableFilters.d.ts +18 -0
  40. package/dist/components/data-table/DataTableFilters.js +284 -0
  41. package/dist/components/data-table/DataTableFilters.js.map +1 -0
  42. package/dist/components/data-table/DataTableRow.d.ts +33 -0
  43. package/dist/components/data-table/DataTableRow.js +552 -0
  44. package/dist/components/data-table/DataTableRow.js.map +1 -0
  45. package/dist/components/data-table/context.d.ts +5 -0
  46. package/dist/components/data-table/context.js +14 -0
  47. package/dist/components/data-table/context.js.map +1 -0
  48. package/dist/components/data-table/layout.d.ts +60 -0
  49. package/dist/components/data-table/layout.js +272 -0
  50. package/dist/components/data-table/layout.js.map +1 -0
  51. package/dist/components/data-table/types.d.ts +335 -0
  52. package/dist/components/data-table/useDataTable.d.ts +9 -0
  53. package/dist/components/data-table/useDataTable.js +666 -0
  54. package/dist/components/data-table/useDataTable.js.map +1 -0
  55. package/dist/components/date-picker/DateRangePicker.d.ts +1 -0
  56. package/dist/components/date-picker/DateRangePicker.js.map +1 -1
  57. package/dist/components/date-picker/PickerField.d.ts +13 -0
  58. package/dist/components/date-picker/PickerField.js.map +1 -1
  59. package/dist/components/dialog/Dialog.d.ts +5 -0
  60. package/dist/components/dialog/Dialog.js.map +1 -1
  61. package/dist/components/drawer/Drawer.d.ts +10 -0
  62. package/dist/components/drawer/Drawer.js.map +1 -1
  63. package/dist/components/empty-state/EmptyState.d.ts +5 -0
  64. package/dist/components/empty-state/EmptyState.js.map +1 -1
  65. package/dist/components/file-upload/FileUpload.d.ts +21 -0
  66. package/dist/components/file-upload/FileUpload.js.map +1 -1
  67. package/dist/components/input/Input.d.ts +7 -0
  68. package/dist/components/input/Input.js +3 -0
  69. package/dist/components/input/Input.js.map +1 -1
  70. package/dist/components/link/Link.d.ts +1 -0
  71. package/dist/components/link/Link.js.map +1 -1
  72. package/dist/components/menu/Menu.d.ts +6 -0
  73. package/dist/components/menu/Menu.js.map +1 -1
  74. package/dist/components/number-field/NumberField.d.ts +7 -0
  75. package/dist/components/number-field/NumberField.js.map +1 -1
  76. package/dist/components/pagination/Pagination.d.ts +4 -0
  77. package/dist/components/pagination/Pagination.js.map +1 -1
  78. package/dist/components/popover/Popover.d.ts +4 -0
  79. package/dist/components/popover/Popover.js.map +1 -1
  80. package/dist/components/preview-card/PreviewCard.d.ts +4 -0
  81. package/dist/components/preview-card/PreviewCard.js.map +1 -1
  82. package/dist/components/progress/Progress.d.ts +8 -0
  83. package/dist/components/progress/Progress.js.map +1 -1
  84. package/dist/components/scroll-area/ScrollArea.d.ts +1 -0
  85. package/dist/components/scroll-area/ScrollArea.js.map +1 -1
  86. package/dist/components/search-input/SearchInput.d.ts +2 -0
  87. package/dist/components/search-input/SearchInput.js.map +1 -1
  88. package/dist/components/select/Select.d.ts +11 -0
  89. package/dist/components/select/Select.js.map +1 -1
  90. package/dist/components/separator/Separator.d.ts +1 -0
  91. package/dist/components/separator/Separator.js +1 -0
  92. package/dist/components/separator/Separator.js.map +1 -1
  93. package/dist/components/skeleton/Skeleton.d.ts +7 -0
  94. package/dist/components/skeleton/Skeleton.js +1 -0
  95. package/dist/components/skeleton/Skeleton.js.map +1 -1
  96. package/dist/components/slider/Slider.d.ts +1 -0
  97. package/dist/components/slider/Slider.js.map +1 -1
  98. package/dist/components/spinner/Spinner.d.ts +2 -0
  99. package/dist/components/spinner/Spinner.js +1 -0
  100. package/dist/components/spinner/Spinner.js.map +1 -1
  101. package/dist/components/stat-card/StatCard.d.ts +5 -1
  102. package/dist/components/stat-card/StatCard.js.map +1 -1
  103. package/dist/components/stepper/Stepper.d.ts +4 -0
  104. package/dist/components/stepper/Stepper.js.map +1 -1
  105. package/dist/components/table/Table.d.ts +23 -0
  106. package/dist/components/table/Table.js +17 -0
  107. package/dist/components/table/Table.js.map +1 -1
  108. package/dist/components/tabs/Tabs.d.ts +1 -0
  109. package/dist/components/tabs/Tabs.js.map +1 -1
  110. package/dist/components/tag/Tag.d.ts +3 -0
  111. package/dist/components/tag/Tag.js.map +1 -1
  112. package/dist/components/toast/Toast.d.ts +2 -0
  113. package/dist/components/toast/Toast.js.map +1 -1
  114. package/dist/components/toggle/Toggle.d.ts +7 -0
  115. package/dist/components/toggle/Toggle.js +1 -0
  116. package/dist/components/toggle/Toggle.js.map +1 -1
  117. package/dist/components/tooltip/Tooltip.d.ts +8 -0
  118. package/dist/components/tooltip/Tooltip.js.map +1 -1
  119. package/dist/components/typography/Typography.d.ts +5 -0
  120. package/dist/components/typography/Typography.js +2 -0
  121. package/dist/components/typography/Typography.js.map +1 -1
  122. package/dist/components.json +5375 -0
  123. package/dist/icons/index.d.ts +8 -0
  124. package/dist/icons/index.js +9 -1
  125. package/dist/icons/index.js.map +1 -1
  126. package/dist/index.d.ts +2 -0
  127. package/dist/index.js +4 -2
  128. package/dist/llms-full.txt +2590 -0
  129. package/dist/llms.txt +175 -0
  130. package/dist/opti-ui.css +494 -167
  131. package/dist/theme/ThemeProvider.d.ts +1 -0
  132. package/dist/theme/ThemeProvider.js.map +1 -1
  133. package/dist/utils/portal.d.ts +4 -0
  134. package/dist/utils/portal.js +4 -0
  135. package/dist/utils/portal.js.map +1 -1
  136. package/package.json +7 -3
@@ -0,0 +1,2590 @@
1
+ # Opti UI (`@optimum-intelligence/opti-ui`)
2
+
3
+ > Optimum's customizable React component library, built on Base UI. React 19, styled with CSS custom properties (`--oui-*`) in cascade layers.
4
+
5
+ ## Setup
6
+
7
+ React 19 is a peer dependency; the build is precompiled with React Compiler. `@base-ui/react` is installed with the package.
8
+
9
+ ```tsx
10
+ import '@optimum-intelligence/opti-ui/styles.css';
11
+ import '@optimum-intelligence/opti-ui/fonts.css'; // optional: loads Poppins + Montserrat from Google Fonts
12
+ import { Button, Card, CardTitle, ToastProvider, Tooltip } from '@optimum-intelligence/opti-ui';
13
+
14
+ export function App() {
15
+ return (
16
+ <Tooltip.Provider>
17
+ <ToastProvider>
18
+ <Card>
19
+ <CardTitle>Monthly energy</CardTitle>
20
+ <Button>Export report</Button>
21
+ </Card>
22
+ </ToastProvider>
23
+ </Tooltip.Provider>
24
+ );
25
+ }
26
+ ```
27
+
28
+ Add `class="oui-root"` to `<body>` for the library font, text color and background. Add `oui-isolate`
29
+ to your app root so portalled popups stack above app content. Every module has a `'use client'` banner,
30
+ so the components work in Next.js App Router.
31
+
32
+ ## Customization
33
+
34
+ Start with the simplest option that does what you need:
35
+
36
+ 1. **Tokens.** Every color, radius, shadow, font, size and duration is a `--oui-*` custom property. Most
37
+ colors are derived from two inputs with `color-mix()`, so a product theme is often just two values:
38
+
39
+ ```css
40
+ :root {
41
+ --oui-color-brand: #0f2a44; /* deep base: primary buttons, headings, navbar, muted text */
42
+ --oui-color-accent: #1f8fd6; /* focus rings, selection, borders, tints */
43
+ }
44
+ ```
45
+
46
+ 2. **Scoped themes.** `<ThemeProvider theme={{ 'color-accent': '#1f8fd6' }} mode="dark">` applies tokens to a
47
+ subtree. Popups opened inside are portalled into the provider, so they inherit the same theme. For
48
+ dark mode across the whole app, set `data-oui-theme="dark"` on `<html>`.
49
+ 3. **Component variables.** Use these per instance or globally, e.g. `--oui-button-radius`,
50
+ `--oui-button-height`, `--oui-input-height`, `--oui-card-padding`, `--oui-card-radius`,
51
+ `--oui-dialog-width`, `--oui-navbar-width`, `--oui-navbar-collapsed-width`, `--oui-switch-width`, `--oui-progress-height`.
52
+ 4. **Classes.** All library CSS is inside cascade layers (`oui.tokens < oui.base < oui.components`).
53
+ Any unlayered CSS in your app overrides it, whatever its specificity, so `!important` is never
54
+ needed. Every part has a stable class (`oui-select__trigger`, `oui-dialog__footer`, …).
55
+ 5. **State attributes.** Style states through Base UI's data attributes (`[data-checked]`,
56
+ `[data-popup-open]`, `[data-highlighted]`, …) and the library's own (`[data-variant]`, `[data-size]`,
57
+ `[data-tone]`). `className` also accepts a function of component state.
58
+ 6. **The render prop.** Swap the rendered element and keep the styles and behaviour:
59
+ `<NavbarItem render={<NavLink to="/fleet" />}>`,
60
+ `<Button render={<a href="…" />} nativeButton={false}>`.
61
+
62
+ **Tailwind v4:** declare the layer order so utilities still win over library styles:
63
+ `@layer theme, base, oui, components, utilities;`
64
+
65
+ # Theme
66
+
67
+ ## createTheme
68
+
69
+ function · Theme
70
+
71
+ Builds a theme from a base, applying overrides on top.
72
+
73
+ ```tsx
74
+ import { createTheme } from '@optimum-intelligence/opti-ui';
75
+ ```
76
+
77
+ Signature: `createTheme(...themes: Theme[])`
78
+
79
+ ## ThemeProvider
80
+
81
+ component · Theme
82
+
83
+ Scopes a theme to its children. Popups opened inside are portalled into the
84
+ provider so they pick up the same tokens.
85
+
86
+ ```tsx
87
+ import { ThemeProvider } from '@optimum-intelligence/opti-ui';
88
+ ```
89
+
90
+ | Prop | Type | Default | Description |
91
+ | --- | --- | --- | --- |
92
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the provider's root element. |
93
+ | `theme?` | `Theme` | | Token overrides applied to this subtree. |
94
+ | `mode?` | `'light' \| 'dark'` | | Color mode for this subtree. |
95
+
96
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
97
+
98
+ ## themeToStyle
99
+
100
+ function · Theme
101
+
102
+ Converts a theme object into CSS custom properties for a `style` prop.
103
+
104
+ ```tsx
105
+ import { themeToStyle } from '@optimum-intelligence/opti-ui';
106
+ ```
107
+
108
+ Signature: `themeToStyle(theme: Theme \| undefined)`
109
+
110
+ # Layout
111
+
112
+ ## AppShell
113
+
114
+ component · Layout
115
+
116
+ Full-height layout with a fixed navbar and an internally scrolling main
117
+ area. Below 900px the navbar moves into a slide-in drawer.
118
+ Customize width with `--oui-navbar-width` and `--oui-navbar-collapsed-width`.
119
+
120
+ ```tsx
121
+ import { AppShell } from '@optimum-intelligence/opti-ui';
122
+ ```
123
+
124
+ | Prop | Type | Default | Description |
125
+ | --- | --- | --- | --- |
126
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the shell's root element. |
127
+ | `navbar` | `React.ReactNode` | | Navbar content (usually a `<Navbar>`). Rendered in a drawer on small screens. |
128
+ | `mobileBrand?` | `React.ReactNode` | | Brand shown in the mobile top bar. |
129
+ | `mobileActions?` | `React.ReactNode` | | Extra content on the right of the mobile top bar. |
130
+ | `menuLabel?` | `string` | `'Open navigation'` | Accessible name of the button that opens the navigation drawer on small screens. |
131
+ | `mainProps?` | `React.HTMLAttributes<HTMLElement>` | | Props for the scrolling `<main>` element. |
132
+
133
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
134
+
135
+ ## Card
136
+
137
+ component · Layout
138
+
139
+ Surface that groups related content. Compose with `CardHeader` (`CardTitle`, `CardDescription`,
140
+ `CardActions`), `CardContent` and `CardFooter`.
141
+
142
+ ```tsx
143
+ import { Card } from '@optimum-intelligence/opti-ui';
144
+ ```
145
+
146
+ ```tsx
147
+ <Card variant="elevated">
148
+ <CardHeader>
149
+ <CardTitle>Monthly energy</CardTitle>
150
+ <CardDescription>Last 30 days</CardDescription>
151
+ </CardHeader>
152
+ <CardContent>…</CardContent>
153
+ </Card>
154
+ ```
155
+
156
+ | Prop | Type | Default | Description |
157
+ | --- | --- | --- | --- |
158
+ | `variant?` | `'outlined' \| 'elevated' \| 'filled' \| 'ghost'` | `'outlined'` | `outlined` (default) uses the card border, `elevated` a soft shadow. |
159
+ | `padding?` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Inner spacing. Override with `--oui-card-padding`. |
160
+ | `interactive?` | `boolean` | `false` | Adds hover and focus states — use with `render={<a href=… />}` or a click handler. |
161
+
162
+ Also accepts all props of: `useRender.ComponentProps<'div', CardState>`.
163
+
164
+ ## CardActions
165
+
166
+ compound · Layout
167
+
168
+ Right-aligned slot inside CardHeader for icon buttons or menus.
169
+
170
+ ```tsx
171
+ import { CardActions } from '@optimum-intelligence/opti-ui';
172
+ ```
173
+
174
+ ### CardActions.displayName
175
+
176
+ ## CardContent
177
+
178
+ compound · Layout
179
+
180
+ Styled `<div>` (`.oui-card__content`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
181
+
182
+ ```tsx
183
+ import { CardContent } from '@optimum-intelligence/opti-ui';
184
+ ```
185
+
186
+ ### CardContent.displayName
187
+
188
+ ## CardDescription
189
+
190
+ compound · Layout
191
+
192
+ Styled `<p>` (`.oui-card__description`). Accepts `className`, `style`, the `render` prop and all `<p>` attributes.
193
+
194
+ ```tsx
195
+ import { CardDescription } from '@optimum-intelligence/opti-ui';
196
+ ```
197
+
198
+ ### CardDescription.displayName
199
+
200
+ ## CardFooter
201
+
202
+ compound · Layout
203
+
204
+ Styled `<div>` (`.oui-card__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
205
+
206
+ ```tsx
207
+ import { CardFooter } from '@optimum-intelligence/opti-ui';
208
+ ```
209
+
210
+ ### CardFooter.displayName
211
+
212
+ ## CardHeader
213
+
214
+ compound · Layout
215
+
216
+ Styled `<div>` (`.oui-card__header`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
217
+
218
+ ```tsx
219
+ import { CardHeader } from '@optimum-intelligence/opti-ui';
220
+ ```
221
+
222
+ ### CardHeader.displayName
223
+
224
+ ## CardTitle
225
+
226
+ compound · Layout
227
+
228
+ Styled `<h3>` (`.oui-card__title`). Accepts `className`, `style`, the `render` prop and all `<h3>` attributes.
229
+
230
+ ```tsx
231
+ import { CardTitle } from '@optimum-intelligence/opti-ui';
232
+ ```
233
+
234
+ ### CardTitle.displayName
235
+
236
+ ## Grid
237
+
238
+ component · Layout
239
+
240
+ Responsive dashboard grid.
241
+
242
+ ```tsx
243
+ import { Grid } from '@optimum-intelligence/opti-ui';
244
+ ```
245
+
246
+ | Prop | Type | Default | Description |
247
+ | --- | --- | --- | --- |
248
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the grid element. |
249
+ | `columns?` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `3` | Columns on wide screens; collapses to 2 below 1200px (for 4+) and 1 below 900px. |
250
+ | `gap?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Space between grid cells. |
251
+
252
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
253
+
254
+ ## Navbar
255
+
256
+ component · Layout
257
+
258
+ Collapsible side navigation. Use inside `AppShell`. Compose with `NavbarHeader` (`NavbarBrand`),
259
+ `NavbarSection` (`NavbarSectionLabel`, `NavbarItem`) and `NavbarFooter`.
260
+
261
+ ```tsx
262
+ import { Navbar } from '@optimum-intelligence/opti-ui';
263
+ ```
264
+
265
+ | Prop | Type | Default | Description |
266
+ | --- | --- | --- | --- |
267
+ | `variant?` | `'inverse' \| 'surface'` | `'inverse'` | `inverse` (brand-colored, default) or `surface` (light panel). |
268
+ | `collapsible?` | `boolean` | `true` | Shows a toggle in the top right that shrinks the navbar to an icon rail. Defaults to `true`. |
269
+ | `collapsed?` | `boolean` | | Controlled collapsed state. |
270
+ | `defaultCollapsed?` | `boolean` | `false` | Initial collapsed state when uncontrolled. |
271
+ | `onCollapsedChange?` | `(collapsed: boolean) => void` | | Called when the user collapses or expands the navbar. |
272
+ | `expandOnHover?` | `boolean` | `true` | Temporarily opens a collapsed navbar while the mouse is over it. Defaults to `true`. |
273
+ | `collapseLabel?` | `string` | `'Collapse'` | Accessible names for the icon-only toggle. |
274
+ | `expandLabel?` | `string` | `'Expand'` | Accessible name of the toggle while collapsed. |
275
+
276
+ Also accepts all props of: `useRender.ComponentProps<'nav', NavbarState>`.
277
+
278
+ ## NavbarBrand
279
+
280
+ component · Layout
281
+
282
+ Logo, title and subtitle block for the top of a `Navbar`.
283
+
284
+ ```tsx
285
+ import { NavbarBrand } from '@optimum-intelligence/opti-ui';
286
+ ```
287
+
288
+ | Prop | Type | Default | Description |
289
+ | --- | --- | --- | --- |
290
+ | `logo?` | `React.ReactNode` | | Logo or icon shown before the title; stays visible when the navbar is collapsed. |
291
+ | `title` | `React.ReactNode` | | Product or organization name. |
292
+ | `subtitle?` | `React.ReactNode` | | Smaller line under the title. |
293
+
294
+ Also accepts all props of: `Omit<useRender.ComponentProps<'div'>, 'title'>`.
295
+
296
+ ## NavbarFooter
297
+
298
+ compound · Layout
299
+
300
+ Styled `<div>` (`.oui-navbar__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
301
+
302
+ ```tsx
303
+ import { NavbarFooter } from '@optimum-intelligence/opti-ui';
304
+ ```
305
+
306
+ ### NavbarFooter.displayName
307
+
308
+ ## NavbarHeader
309
+
310
+ compound · Layout
311
+
312
+ Styled `<div>` (`.oui-navbar__header`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
313
+
314
+ ```tsx
315
+ import { NavbarHeader } from '@optimum-intelligence/opti-ui';
316
+ ```
317
+
318
+ ### NavbarHeader.displayName
319
+
320
+ ## NavbarItem
321
+
322
+ component · Layout
323
+
324
+ Navigation link. Renders an `<a>`; use `render={<Link to="…" />}` for a
325
+ router link or `render={<button />}` for an action.
326
+
327
+ ```tsx
328
+ import { NavbarItem } from '@optimum-intelligence/opti-ui';
329
+ ```
330
+
331
+ | Prop | Type | Default | Description |
332
+ | --- | --- | --- | --- |
333
+ | `icon?` | `React.ReactNode` | | Icon shown before the label; it stays visible when the navbar is collapsed to a rail. |
334
+ | `active?` | `boolean` | `false` | Marks the current page (sets aria-current). |
335
+ | `badge?` | `React.ReactNode` | | Trailing content such as a count badge. |
336
+
337
+ Also accepts all props of: `useRender.ComponentProps<'a', NavbarItemState>`.
338
+
339
+ ## NavbarSection
340
+
341
+ compound · Layout
342
+
343
+ Styled `<div>` (`.oui-navbar__section`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
344
+
345
+ ```tsx
346
+ import { NavbarSection } from '@optimum-intelligence/opti-ui';
347
+ ```
348
+
349
+ ### NavbarSection.displayName
350
+
351
+ ## NavbarSectionLabel
352
+
353
+ compound · Layout
354
+
355
+ Styled `<div>` (`.oui-navbar__section-label`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
356
+
357
+ ```tsx
358
+ import { NavbarSectionLabel } from '@optimum-intelligence/opti-ui';
359
+ ```
360
+
361
+ ### NavbarSectionLabel.displayName
362
+
363
+ ## PageHeader
364
+
365
+ component · Layout
366
+
367
+ Page title block with optional breadcrumbs, eyebrow, description and actions.
368
+
369
+ ```tsx
370
+ import { PageHeader } from '@optimum-intelligence/opti-ui';
371
+ ```
372
+
373
+ | Prop | Type | Default | Description |
374
+ | --- | --- | --- | --- |
375
+ | `ref?` | `React.Ref<HTMLElement>` | | Ref to the `<header>` element. |
376
+ | `breadcrumbs?` | `React.ReactNode` | | Trail shown above the title, usually `<Breadcrumbs>`. |
377
+ | `eyebrow?` | `React.ReactNode` | | Small label above the title. |
378
+ | `title` | `React.ReactNode` | | Page title, rendered as the page `<h1>`. |
379
+ | `description?` | `React.ReactNode` | | Supporting text under the title. |
380
+ | `actions?` | `React.ReactNode` | | Buttons or controls aligned to the right of the title. |
381
+
382
+ Also accepts all props of: `Omit<React.HTMLAttributes<HTMLElement>, 'title'>`.
383
+
384
+ ## ScrollArea
385
+
386
+ component · Layout
387
+
388
+ Scroll container with slim, themed overlay scrollbars. Set a height or max-height.
389
+
390
+ ```tsx
391
+ import { ScrollArea } from '@optimum-intelligence/opti-ui';
392
+ ```
393
+
394
+ | Prop | Type | Default | Description |
395
+ | --- | --- | --- | --- |
396
+ | `scrollbars?` | `'vertical' \| 'horizontal' \| 'both'` | `'vertical'` | Which scrollbars to render. |
397
+ | `viewportProps?` | `BaseScrollArea.Viewport.Props` | | Props for the inner scrolling viewport, e.g. a `ref` to read the scroll position. |
398
+
399
+ Also accepts all props of: `BaseScrollArea.Root.Props`.
400
+
401
+ ## Separator
402
+
403
+ component · Layout
404
+
405
+ Thin divider line. Set `orientation="vertical"` for a vertical rule.
406
+
407
+ ```tsx
408
+ import { Separator } from '@optimum-intelligence/opti-ui';
409
+ ```
410
+
411
+
412
+ Also accepts all props of: `BaseSeparator.Props`.
413
+
414
+ ## Stack
415
+
416
+ component · Layout
417
+
418
+ Flex container that spaces its children evenly, in a column or a row.
419
+
420
+ ```tsx
421
+ import { Stack } from '@optimum-intelligence/opti-ui';
422
+ ```
423
+
424
+ | Prop | Type | Default | Description |
425
+ | --- | --- | --- | --- |
426
+ | `direction?` | `'column' \| 'row'` | `'column'` | `column` (default) stacks children, `row` puts them on a line. |
427
+ | `gap?` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Space between children. Override with `--oui-stack-gap`. |
428
+ | `align?` | `'start' \| 'center' \| 'end' \| 'stretch' \| 'baseline'` | | Cross-axis alignment. Defaults to `stretch` in a column and `center` in a row. |
429
+ | `justify?` | `'start' \| 'center' \| 'end' \| 'between'` | | Main-axis distribution. |
430
+ | `wrap?` | `boolean` | `false` | Let a row's children wrap onto more lines. |
431
+
432
+ Also accepts all props of: `useRender.ComponentProps<'div', StackState>`.
433
+
434
+ ## StatCard
435
+
436
+ component · Layout
437
+
438
+ KPI tile: label, large value, optional unit and trend.
439
+
440
+ ```tsx
441
+ import { StatCard } from '@optimum-intelligence/opti-ui';
442
+ ```
443
+
444
+ | Prop | Type | Default | Description |
445
+ | --- | --- | --- | --- |
446
+ | `variant?` | `'outlined' \| 'elevated' \| 'filled' \| 'ghost'` | | `outlined` (default) uses the card border, `elevated` a soft shadow. |
447
+ | `padding?` | `'none' \| 'sm' \| 'md' \| 'lg'` | | Inner spacing. Override with `--oui-card-padding`. |
448
+ | `interactive?` | `boolean` | | Adds hover and focus states — use with `render={<a href=… />}` or a click handler. |
449
+ | `label` | `React.ReactNode` | | What the number measures. |
450
+ | `value` | `React.ReactNode` | | The headline figure. |
451
+ | `unit?` | `React.ReactNode` | | Unit beside the value, e.g. "kWh" or "orders". |
452
+ | `delta?` | `React.ReactNode` | | Change indicator, e.g. "+12.4%". |
453
+ | `trend?` | `'up' \| 'down' \| 'flat'` | | Arrow direction shown next to `delta`. |
454
+ | `tone?` | `'positive' \| 'negative' \| 'neutral'` | | Color of the delta. Defaults to positive for `up`, negative for `down`. |
455
+ | `hint?` | `React.ReactNode` | | Supporting text under the value. |
456
+ | `icon?` | `React.ReactNode` | | Icon tile shown in the top-right corner. |
457
+ | `loading?` | `boolean` | | Replaces the value with a skeleton while data loads. |
458
+
459
+ Also accepts all props of: `useRender.ComponentProps<'div', CardState>`.
460
+
461
+ # Typography
462
+
463
+ ## Eyebrow
464
+
465
+ component · Typography
466
+
467
+ Small uppercase label used above titles, in filter bars and table headers.
468
+
469
+ ```tsx
470
+ import { Eyebrow } from '@optimum-intelligence/opti-ui';
471
+ ```
472
+
473
+
474
+ Also accepts all props of: `useRender.ComponentProps<'span'>`.
475
+
476
+ ## Heading
477
+
478
+ component · Typography
479
+
480
+ Heading element. `level` sets the tag (`h1`–`h6`) and the default size; `size` overrides only the look.
481
+
482
+ ```tsx
483
+ import { Heading } from '@optimum-intelligence/opti-ui';
484
+ ```
485
+
486
+ | Prop | Type | Default | Description |
487
+ | --- | --- | --- | --- |
488
+ | `level?` | `HeadingLevel` | `2` | Semantic level; picks the element. |
489
+ | `size?` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | | Visual size, independent of the level. |
490
+
491
+ Also accepts all props of: `useRender.ComponentProps<'h2', HeadingState>`.
492
+
493
+ ## Link
494
+
495
+ component · Typography
496
+
497
+ Text link. Pass a router link through `render`: `<Link render={<NavLink to="/fleet" />}>`.
498
+
499
+ ```tsx
500
+ import { Link } from '@optimum-intelligence/opti-ui';
501
+ ```
502
+
503
+ | Prop | Type | Default | Description |
504
+ | --- | --- | --- | --- |
505
+ | `tone?` | `'accent' \| 'muted' \| 'inherit'` | `'accent'` | `inherit` takes the color of the surrounding text. |
506
+ | `underline?` | `'always' \| 'hover' \| 'none'` | `'always'` | When the underline shows. |
507
+ | `external?` | `boolean` | `false` | Opens in a new tab, with a trailing icon. |
508
+
509
+ Also accepts all props of: `useRender.ComponentProps<'a', LinkState>`.
510
+
511
+ ## Text
512
+
513
+ component · Typography
514
+
515
+ Body text paragraph. Use `render={<span />}` for inline text.
516
+
517
+ ```tsx
518
+ import { Text } from '@optimum-intelligence/opti-ui';
519
+ ```
520
+
521
+ | Prop | Type | Default | Description |
522
+ | --- | --- | --- | --- |
523
+ | `size?` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Font size. |
524
+ | `tone?` | `'default' \| 'strong' \| 'muted' \| 'subtle' \| 'accent' \| 'success' \| 'warning' \| 'danger'` | `'default'` | Color role: from `strong` to `subtle`, or a status color. |
525
+ | `weight?` | `'regular' \| 'medium' \| 'semibold' \| 'bold'` | | Font weight. Inherits when omitted. |
526
+
527
+ Also accepts all props of: `useRender.ComponentProps<'p', TextState>`.
528
+
529
+ # Actions
530
+
531
+ ## Button
532
+
533
+ component · Actions
534
+
535
+ Action button. Use `render={<a href="…" />}` with `nativeButton={false}` to style a link as a button.
536
+
537
+ ```tsx
538
+ import { Button } from '@optimum-intelligence/opti-ui';
539
+ ```
540
+
541
+ ```tsx
542
+ <Button variant="secondary" loading={saving} onClick={save}>Save</Button>
543
+ ```
544
+
545
+ | Prop | Type | Default | Description |
546
+ | --- | --- | --- | --- |
547
+ | `variant?` | `'primary' \| 'accent' \| 'secondary' \| 'soft' \| 'ghost' \| 'danger'` | `'primary'` | Visual emphasis. |
548
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and padding. |
549
+ | `shape?` | `'pill' \| 'rounded'` | `'pill'` | `pill` (default) or `rounded` corners. Override with `--oui-button-radius`. |
550
+ | `fullWidth?` | `boolean` | | Stretch to the container width. |
551
+ | `loading?` | `boolean` | | Shows a spinner and blocks interaction while keeping focus. |
552
+
553
+ Also accepts all props of: `BaseButton.Props`.
554
+
555
+ ## ContextMenu
556
+
557
+ compound · Actions
558
+
559
+ Menu opened by right click or long press on `ContextMenu.Trigger`, which wraps
560
+ the target area. The item parts are the same as `Menu`'s.
561
+
562
+ ```tsx
563
+ import { ContextMenu } from '@optimum-intelligence/opti-ui';
564
+ ```
565
+
566
+ ### ContextMenu.Root
567
+
568
+ Base UI `ContextMenu.Root` re-exported unchanged. See https://base-ui.com/react/components/context-menu.
569
+
570
+ ### ContextMenu.Trigger
571
+
572
+ Base UI `ContextMenu.Trigger` re-exported unchanged. See https://base-ui.com/react/components/context-menu.
573
+
574
+ ### ContextMenu.Content
575
+
576
+ | Prop | Type | Default | Description |
577
+ | --- | --- | --- | --- |
578
+ | `positionerProps?` | `BaseContextMenu.Positioner.Props` | | Props for the positioner element that places the popup. |
579
+
580
+ Also accepts all props of: `BaseContextMenu.Popup.Props`.
581
+
582
+ ### ContextMenu.Item
583
+
584
+ ### ContextMenu.LinkItem
585
+
586
+ ### ContextMenu.CheckboxItem
587
+
588
+ ### ContextMenu.RadioGroup
589
+
590
+ ### ContextMenu.RadioItem
591
+
592
+ ### ContextMenu.Group
593
+
594
+ ### ContextMenu.GroupLabel
595
+
596
+ ### ContextMenu.Separator
597
+
598
+ ### ContextMenu.SubmenuRoot
599
+
600
+ ### ContextMenu.SubmenuTrigger
601
+
602
+ ## IconButton
603
+
604
+ component · Actions
605
+
606
+ Square button for a single icon. Defaults to the compact ghost style.
607
+
608
+ ```tsx
609
+ import { IconButton } from '@optimum-intelligence/opti-ui';
610
+ ```
611
+
612
+ | Prop | Type | Default | Description |
613
+ | --- | --- | --- | --- |
614
+ | `variant?` | `'primary' \| 'accent' \| 'secondary' \| 'soft' \| 'ghost' \| 'danger'` | `'ghost'` | Visual emphasis. |
615
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and padding. |
616
+ | `loading?` | `boolean` | | Shows a spinner and blocks interaction while keeping focus. |
617
+ | `aria-label` | `string` | | Required: icon-only buttons need an accessible name. |
618
+ | `shape?` | `'rounded' \| 'circle'` | `'rounded'` | `rounded` square (default) or `circle`. |
619
+
620
+ Also accepts all props of: `BaseButton.Props`.
621
+
622
+ ## Menu
623
+
624
+ compound · Actions
625
+
626
+ Dropdown menu of actions. Compose `Menu.Root` › `Menu.Trigger` + `Menu.Content` › items.
627
+ For nested menus use `Menu.SubmenuRoot` › `Menu.SubmenuTrigger` + `Menu.Content`.
628
+
629
+ ```tsx
630
+ import { Menu } from '@optimum-intelligence/opti-ui';
631
+ ```
632
+
633
+ ### Menu.Root
634
+
635
+ Base UI `Menu.Root` re-exported unchanged. See https://base-ui.com/react/components/menu.
636
+
637
+ ### Menu.Trigger
638
+
639
+ Base UI `Menu.Trigger` re-exported unchanged. See https://base-ui.com/react/components/menu.
640
+
641
+ ### Menu.Content
642
+
643
+ | Prop | Type | Default | Description |
644
+ | --- | --- | --- | --- |
645
+ | `side?` | `BaseMenu.Positioner.Props['side']` | | Which side of the trigger the menu opens on. |
646
+ | `align?` | `BaseMenu.Positioner.Props['align']` | `'start'` | Alignment along that side. |
647
+ | `sideOffset?` | `BaseMenu.Positioner.Props['sideOffset']` | `6` | Distance from the trigger in px. |
648
+ | `alignOffset?` | `BaseMenu.Positioner.Props['alignOffset']` | | Shift along the alignment axis in px. |
649
+ | `positionerProps?` | `BaseMenu.Positioner.Props` | | Props for the positioner element that places the popup. |
650
+
651
+ Also accepts all props of: `BaseMenu.Popup.Props`.
652
+
653
+ ### Menu.Item
654
+
655
+
656
+ Also accepts all props of: `BaseMenu.Item.Props`, `ItemExtras`.
657
+
658
+ ### Menu.LinkItem
659
+
660
+
661
+ Also accepts all props of: `BaseMenu.LinkItem.Props`, `Omit<ItemExtras, 'danger'>`.
662
+
663
+ ### Menu.CheckboxItem
664
+
665
+
666
+ Also accepts all props of: `BaseMenu.CheckboxItem.Props`, `Omit<ItemExtras, 'icon' \| 'danger'>`.
667
+
668
+ ### Menu.RadioGroup
669
+
670
+ Base UI `Menu.RadioGroup` re-exported unchanged. See https://base-ui.com/react/components/menu.
671
+
672
+ ### Menu.RadioItem
673
+
674
+
675
+ Also accepts all props of: `BaseMenu.RadioItem.Props`, `Omit<ItemExtras, 'icon' \| 'danger'>`.
676
+
677
+ ### Menu.Group
678
+
679
+ Base UI `Menu.Group` re-exported unchanged. See https://base-ui.com/react/components/menu.
680
+
681
+ ### Menu.GroupLabel
682
+
683
+ ### Menu.Separator
684
+
685
+ ### Menu.SubmenuRoot
686
+
687
+ Base UI `Menu.SubmenuRoot` re-exported unchanged. See https://base-ui.com/react/components/menu.
688
+
689
+ ### Menu.SubmenuTrigger
690
+
691
+
692
+ Also accepts all props of: `BaseMenu.SubmenuTrigger.Props`, `Omit<ItemExtras, 'shortcut' \| 'danger'>`.
693
+
694
+ ## SegmentedControl
695
+
696
+ component · Actions
697
+
698
+ Single-choice switcher (e.g. Day / Week / Month). Always keeps one value selected.
699
+
700
+ ```tsx
701
+ import { SegmentedControl } from '@optimum-intelligence/opti-ui';
702
+ ```
703
+
704
+ | Prop | Type | Default | Description |
705
+ | --- | --- | --- | --- |
706
+ | `size?` | `'sm' \| 'md'` | `'md'` | Segment height. |
707
+ | `variant?` | `'segmented' \| 'outline'` | | `segmented` renders a pill track like a tab switcher; `outline` separate buttons. |
708
+ | `fullWidth?` | `boolean` | | Stretch segments to fill the width. |
709
+ | `options` | `SegmentedControlOption[]` | | Segments to show. |
710
+ | `value?` | `string` | | Selected option `value` (controlled). |
711
+ | `defaultValue?` | `string` | | Initially selected option `value` when uncontrolled. |
712
+ | `onValueChange?` | `(value: string) => void` | | Called with the new `value` when the selection changes. |
713
+
714
+ Also accepts all props of: `BaseToggleGroup.Props`.
715
+
716
+ ## Toggle
717
+
718
+ component · Actions
719
+
720
+ Two-state button (bold, pin, favourite…). Inside a ToggleGroup it acts as a segment.
721
+
722
+ ```tsx
723
+ import { Toggle } from '@optimum-intelligence/opti-ui';
724
+ ```
725
+
726
+ | Prop | Type | Default | Description |
727
+ | --- | --- | --- | --- |
728
+ | `size?` | `'sm' \| 'md'` | `'md'` | Button height. |
729
+
730
+ Also accepts all props of: `BaseToggle.Props`.
731
+
732
+ ## ToggleGroup
733
+
734
+ component · Actions
735
+
736
+ Group of `Toggle` buttons that share selection state (single or multiple).
737
+
738
+ ```tsx
739
+ import { ToggleGroup } from '@optimum-intelligence/opti-ui';
740
+ ```
741
+
742
+ | Prop | Type | Default | Description |
743
+ | --- | --- | --- | --- |
744
+ | `size?` | `'sm' \| 'md'` | `'md'` | Segment height. |
745
+ | `variant?` | `'segmented' \| 'outline'` | `'segmented'` | `segmented` renders a pill track like a tab switcher; `outline` separate buttons. |
746
+ | `fullWidth?` | `boolean` | | Stretch segments to fill the width. |
747
+
748
+ Also accepts all props of: `BaseToggleGroup.Props`.
749
+
750
+ ## Toolbar
751
+
752
+ compound · Actions
753
+
754
+ Row of controls that is a single tab stop; arrow keys move between them.
755
+ Other controls join through `render`: `<Toolbar.Button render={<Toggle />} />`,
756
+ `<Toolbar.Button render={<Menu.Trigger />} />`.
757
+
758
+ ```tsx
759
+ import { Toolbar } from '@optimum-intelligence/opti-ui';
760
+ ```
761
+
762
+ ### Toolbar.Root
763
+
764
+ ### Toolbar.Button
765
+
766
+ ### Toolbar.Link
767
+
768
+ ### Toolbar.Group
769
+
770
+ ### Toolbar.Separator
771
+
772
+ ### Toolbar.Input
773
+
774
+ # Forms
775
+
776
+ ## Calendar
777
+
778
+ component · Forms
779
+
780
+ Month grid for picking one day. Keyboard: arrows move by day / week,
781
+ Home / End jump within the week, PageUp / PageDown change month (with Shift: year).
782
+ The month and year in the title open a list to jump straight to another one.
783
+
784
+ ```tsx
785
+ import { Calendar } from '@optimum-intelligence/opti-ui';
786
+ ```
787
+
788
+ | Prop | Type | Default | Description |
789
+ | --- | --- | --- | --- |
790
+ | `value?` | `string \| null` | | Selected day as an ISO date (`"2026-03-09"`). |
791
+ | `defaultValue?` | `string \| null` | `null` | Initially selected day (ISO date) when uncontrolled. |
792
+ | `onValueChange?` | `(value: string) => void` | | Called with the picked day as an ISO date. |
793
+
794
+ Also accepts all props of: `CalendarOptions`.
795
+
796
+ ## Checkbox
797
+
798
+ component · Forms
799
+
800
+ Checkbox with optional `label` and `description`. Supports `indeterminate`.
801
+
802
+ ```tsx
803
+ import { Checkbox } from '@optimum-intelligence/opti-ui';
804
+ ```
805
+
806
+
807
+ Also accepts all props of: `BaseCheckbox.Root.Props`, `ChoiceLabelProps`.
808
+
809
+ ## CheckboxGroup
810
+
811
+ component · Forms
812
+
813
+ Manages the checked values of several `Checkbox` children (`value` / `onValueChange`).
814
+
815
+ ```tsx
816
+ import { CheckboxGroup } from '@optimum-intelligence/opti-ui';
817
+ ```
818
+
819
+ | Prop | Type | Default | Description |
820
+ | --- | --- | --- | --- |
821
+ | `orientation?` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction of the checkboxes. |
822
+
823
+ Also accepts all props of: `BaseCheckboxGroup.Props`.
824
+
825
+ ## Combobox
826
+
827
+ compound · Forms
828
+
829
+ Searchable select. `<Combobox items={…} />` covers single and `multiple`
830
+ (chips) selection; compose the parts for anything custom.
831
+
832
+ ```tsx
833
+ import { Combobox } from '@optimum-intelligence/opti-ui';
834
+ ```
835
+
836
+ | Prop | Type | Default | Description |
837
+ | --- | --- | --- | --- |
838
+ | `items` | `ComboboxOption[]` | | Options to choose from. |
839
+ | `label?` | `React.ReactNode` | | Visible field label. |
840
+ | `description?` | `React.ReactNode` | | Help text under the input. |
841
+ | `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
842
+ | `placeholder?` | `string` | | Placeholder shown while nothing is typed or selected. |
843
+ | `emptyText?` | `React.ReactNode` | `'No results found.'` | Shown when the filter matches nothing. |
844
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
845
+ | `hideClear?` | `boolean` | | Hide the clear button. |
846
+ | `inputProps?` | `BaseCombobox.Input.Props` | | Props for the text input. |
847
+
848
+ Also accepts all props of: `RootProps`.
849
+
850
+ ### Combobox.Root
851
+
852
+ Base UI `Combobox.Root` re-exported unchanged. See https://base-ui.com/react/components/combobox.
853
+
854
+ ### Combobox.InputGroup
855
+
856
+ | Prop | Type | Default | Description |
857
+ | --- | --- | --- | --- |
858
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
859
+
860
+ Also accepts all props of: `BaseCombobox.InputGroup.Props`.
861
+
862
+ ### Combobox.Input
863
+
864
+ ### Combobox.Trigger
865
+
866
+ ### Combobox.Clear
867
+
868
+ ### Combobox.Value
869
+
870
+ Base UI `Combobox.Value` re-exported unchanged. See https://base-ui.com/react/components/combobox.
871
+
872
+ ### Combobox.Chips
873
+
874
+ ### Combobox.Chip
875
+
876
+ ### Combobox.Content
877
+
878
+ | Prop | Type | Default | Description |
879
+ | --- | --- | --- | --- |
880
+ | `side?` | `BaseCombobox.Positioner.Props['side']` | | Which side of the input the list opens on. |
881
+ | `align?` | `BaseCombobox.Positioner.Props['align']` | | Alignment along that side. |
882
+ | `sideOffset?` | `BaseCombobox.Positioner.Props['sideOffset']` | `6` | Distance from the input in px. |
883
+ | `positionerProps?` | `BaseCombobox.Positioner.Props` | | Props for the positioner element that places the popup. |
884
+
885
+ Also accepts all props of: `BaseCombobox.Popup.Props`.
886
+
887
+ ### Combobox.List
888
+
889
+ ### Combobox.Item
890
+
891
+ ### Combobox.Empty
892
+
893
+ ### Combobox.Group
894
+
895
+ Base UI `Combobox.Group` re-exported unchanged. See https://base-ui.com/react/components/combobox.
896
+
897
+ ### Combobox.GroupLabel
898
+
899
+ ### Combobox.Collection
900
+
901
+ Base UI `Combobox.Collection` re-exported unchanged. See https://base-ui.com/react/components/combobox.
902
+
903
+ ### Combobox.useFilter
904
+
905
+ Base UI `Combobox.useFilter` re-exported unchanged. See https://base-ui.com/react/components/combobox.
906
+
907
+ ## DatePicker
908
+
909
+ component · Forms
910
+
911
+ Date field with a calendar popover. Values are ISO dates (`"2026-03-09"`),
912
+ the same format as `<input type="date">`, and are shown the same way.
913
+
914
+ ```tsx
915
+ import { DatePicker } from '@optimum-intelligence/opti-ui';
916
+ ```
917
+
918
+
919
+ Also accepts all props of: `PickerProps`.
920
+
921
+ ## DateRangePicker
922
+
923
+ component · Forms
924
+
925
+ Date range field with a calendar popover and optional presets. Values are
926
+ `{ start, end }` ISO dates (`"2026-03-09"`), both inclusive.
927
+
928
+ ```tsx
929
+ import { DateRangePicker } from '@optimum-intelligence/opti-ui';
930
+ ```
931
+
932
+ | Prop | Type | Default | Description |
933
+ | --- | --- | --- | --- |
934
+ | `ref?` | `React.Ref<HTMLButtonElement>` | | Ref to the trigger button. |
935
+ | `label?` | `React.ReactNode` | | Visible field label. |
936
+ | `description?` | `React.ReactNode` | | Help text under the field. |
937
+ | `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
938
+ | `required?` | `boolean` | | Marks the field required and adds the required indicator to the label. |
939
+ | `disabled?` | `boolean` | | Disables the field. |
940
+ | `placeholder?` | `React.ReactNode` | `'Select dates'` | Text shown while no date is selected. |
941
+ | `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
942
+ | `open?` | `boolean` | | Whether the calendar popover is open (controlled). |
943
+ | `defaultOpen?` | `boolean` | | Initial popover state when uncontrolled. |
944
+ | `onOpenChange?` | `(open: boolean) => void` | | Called when the popover opens or closes. |
945
+ | `id?` | `string` | | Id of the trigger button. Generated when omitted. |
946
+ | `className?` | `string` | | Class name for the trigger button. |
947
+ | `triggerProps?` | `Omit<React.ComponentProps<typeof BasePopover.Trigger>, 'children' \| 'disabled' \| 'id'>` | | Props for the trigger button (aria-*, data-*, onBlur…). |
948
+ | `contentProps?` | `Omit<PopoverContentProps, 'children'>` | | Props for the popover content. |
949
+ | `value?` | `DateRange \| null` | | Selected days as ISO dates; both ends are inclusive. |
950
+ | `defaultValue?` | `DateRange \| null` | `null` | Initially selected range when uncontrolled. |
951
+ | `onValueChange?` | `(value: DateRange \| null) => void` | | Called with the new range, or `null` when cleared. |
952
+ | `min?` | `string` | | Earliest allowed day. |
953
+ | `max?` | `string` | | Latest allowed day. |
954
+ | `presets?` | `DateRangePreset[]` | | Shortcuts listed beside the calendar ("Last 7 days", "This month"…). |
955
+ | `startName?` | `string` | | Submits the first day with a form under this name. |
956
+ | `endName?` | `string` | | Submits the last day with a form under this name. |
957
+ | `clearable?` | `boolean` | | Show the Clear action. Defaults to `true` unless `required`. |
958
+ | `formatValue?` | `(value: DateRange) => React.ReactNode` | | Custom display text for the selected range. |
959
+ | `labels?` | `Partial<DateRangePickerLabels>` | | Override texts for localisation. |
960
+
961
+ Also accepts all props of: `Pick<RangeCalendarProps, 'isDateDisabled' \| 'defaultMonth' \| 'locale' \| 'weekStartsOn' \| 'numberOfMonths'>`.
962
+
963
+ ## DateTimePicker
964
+
965
+ component · Forms
966
+
967
+ Date and time field. Values are local ISO date-times (`"2026-03-09T14:30"`),
968
+ the same format as `<input type="datetime-local">`, shown as `2026-03-09 14:30:00`
969
+ on a 24-hour clock whatever the locale.
970
+
971
+ ```tsx
972
+ import { DateTimePicker } from '@optimum-intelligence/opti-ui';
973
+ ```
974
+
975
+ | Prop | Type | Default | Description |
976
+ | --- | --- | --- | --- |
977
+ | `step?` | `number` | | Granularity of the time input in seconds (60 = minutes, 1 = seconds). |
978
+ | `defaultTime?` | `string` | | Time used when a day is picked before any time is set. |
979
+
980
+ Also accepts all props of: `PickerProps`.
981
+
982
+ ## Dropzone
983
+
984
+ component · Forms
985
+
986
+ Drop target that also opens the file browser on click, Enter or Space.
987
+
988
+ ```tsx
989
+ import { Dropzone } from '@optimum-intelligence/opti-ui';
990
+ ```
991
+
992
+ | Prop | Type | Default | Description |
993
+ | --- | --- | --- | --- |
994
+ | `ref?` | `React.Ref<HTMLLabelElement>` | | Ref to the dropzone element. |
995
+ | `onFiles?` | `(files: File[]) => void` | | Called with the picked or dropped files that pass `accept` and `maxSize`. |
996
+ | `onReject?` | `(rejections: FileRejection[]) => void` | | Called with the files that were turned away, and why. |
997
+ | `accept?` | `string` | | Allowed types, as for `<input accept>`: `".pdf,image/*"`. |
998
+ | `multiple?` | `boolean` | | Allow choosing several files. |
999
+ | `maxSize?` | `number` | | Largest allowed file, in bytes. |
1000
+ | `files?` | `File[]` | | The current selection. It is kept in the native input, so the files submit with a form and `required` validates. Without it the input is emptied after each pick. |
1001
+ | `disabled?` | `boolean` | | Disables picking and dropping. |
1002
+ | `invalid?` | `boolean` | | Shows the error styling. |
1003
+ | `size?` | `'sm' \| 'md'` | `'md'` | `sm` is a single compact row. |
1004
+ | `icon?` | `React.ReactNode` | | Icon shown before the title. Defaults to an upload icon. |
1005
+ | `title?` | `React.ReactNode` | | Main line. Defaults to "Drop files here or click to browse". |
1006
+ | `hint?` | `React.ReactNode` | | Secondary line, e.g. the allowed types and size. |
1007
+ | `inputProps?` | `Omit<React.ComponentProps<'input'>, 'ref' \| 'type'>` | | Props for the file input (name, id, required, aria-*…). |
1008
+
1009
+ Also accepts all props of: `Omit<React.LabelHTMLAttributes<HTMLLabelElement>, 'title'>`.
1010
+
1011
+ ## Field
1012
+
1013
+ compound · Forms
1014
+
1015
+ Field parts wire up labels, descriptions and validation for any control
1016
+ inside (Input, Select, Checkbox, Switch, NumberField…).
1017
+
1018
+ ```tsx
1019
+ import { Field } from '@optimum-intelligence/opti-ui';
1020
+ ```
1021
+
1022
+ ### Field.Root
1023
+
1024
+ ### Field.Label
1025
+
1026
+ | Prop | Type | Default | Description |
1027
+ | --- | --- | --- | --- |
1028
+ | `required?` | `boolean` | | Appends a required marker. |
1029
+
1030
+ Also accepts all props of: `BaseField.Label.Props`.
1031
+
1032
+ ### Field.Description
1033
+
1034
+ ### Field.Error
1035
+
1036
+ ### Field.Item
1037
+
1038
+ ### Field.Validity
1039
+
1040
+ Base UI `Field.Validity` re-exported unchanged. See https://base-ui.com/react/components/field.
1041
+
1042
+ ## Fieldset
1043
+
1044
+ compound · Forms
1045
+
1046
+ Groups related fields under a legend.
1047
+
1048
+ ```tsx
1049
+ import { Fieldset } from '@optimum-intelligence/opti-ui';
1050
+ ```
1051
+
1052
+ ### Fieldset.Root
1053
+
1054
+ ### Fieldset.Legend
1055
+
1056
+ ## FileItem
1057
+
1058
+ component · Forms
1059
+
1060
+ One file in a list: name, size, upload progress or error, and a remove button.
1061
+
1062
+ ```tsx
1063
+ import { FileItem } from '@optimum-intelligence/opti-ui';
1064
+ ```
1065
+
1066
+ | Prop | Type | Default | Description |
1067
+ | --- | --- | --- | --- |
1068
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the item element. |
1069
+ | `name` | `string` | | File name. |
1070
+ | `size?` | `number` | | Size in bytes. |
1071
+ | `icon?` | `React.ReactNode` | | Icon before the name. Defaults to a file icon. |
1072
+ | `status?` | `'idle' \| 'uploading' \| 'success' \| 'error'` | `'idle'` | Upload state; sets the progress bar and error styling. |
1073
+ | `progress?` | `number \| null` | `null` | Upload progress from 0 to 100, shown while `uploading`. `null` is indeterminate. |
1074
+ | `error?` | `React.ReactNode` | | Message shown in place of the size when `status` is `error`. |
1075
+ | `onRemove?` | `() => void` | | Adds the remove button. |
1076
+ | `removeLabel?` | `string` | | Accessible name of the remove button. Defaults to "Remove {name}". |
1077
+ | `actions?` | `React.ReactNode` | | Extra controls before the remove button (download, preview…). |
1078
+ | `locale?` | `string` | | BCP 47 locale for the size. |
1079
+
1080
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
1081
+
1082
+ ## FileUpload
1083
+
1084
+ component · Forms
1085
+
1086
+ File field: a dropzone plus the list of chosen files. It only collects
1087
+ `File` objects; upload them yourself and report progress through `fileState`.
1088
+
1089
+ ```tsx
1090
+ import { FileUpload } from '@optimum-intelligence/opti-ui';
1091
+ ```
1092
+
1093
+ | Prop | Type | Default | Description |
1094
+ | --- | --- | --- | --- |
1095
+ | `ref?` | `React.Ref<HTMLLabelElement>` | | Ref to the dropzone element. |
1096
+ | `value?` | `File[]` | | Chosen files (controlled). |
1097
+ | `defaultValue?` | `File[]` | | Initially chosen files when uncontrolled. |
1098
+ | `onValueChange?` | `(files: File[]) => void` | | Called with the full list of files after a file is added or removed. |
1099
+ | `maxFiles?` | `number` | | Most files allowed when `multiple`. |
1100
+ | `fileState?` | `(file: File) => Pick<FileItemProps, 'status' \| 'progress' \| 'error'> \| undefined` | | Upload state of a file, for showing progress and errors in the list. |
1101
+ | `label?` | `React.ReactNode` | | Visible field label. |
1102
+ | `description?` | `React.ReactNode` | | Help text under the dropzone. |
1103
+ | `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
1104
+ | `required?` | `boolean` | | Requires at least one file before the form submits. |
1105
+ | `disabled?` | `boolean` | | Disables picking, dropping and removing files. |
1106
+ | `name?` | `string` | | Submits the files with a form under this name. |
1107
+ | `id?` | `string` | | Id of the file input. Generated when omitted. |
1108
+ | `className?` | `string` | | Class name for the root element. |
1109
+ | `locale?` | `string` | | BCP 47 locale for file sizes. |
1110
+ | `labels?` | `Partial<FileUploadLabels>` | | Override texts for localisation. |
1111
+
1112
+ Also accepts all props of: `Pick<DropzoneProps, 'accept' \| 'multiple' \| 'maxSize' \| 'onReject' \| 'size' \| 'icon' \| 'title' \| 'hint'>`.
1113
+
1114
+ ## Form
1115
+
1116
+ component · Forms
1117
+
1118
+ Form with Base UI validation wiring and vertical field spacing.
1119
+
1120
+ ```tsx
1121
+ import { Form } from '@optimum-intelligence/opti-ui';
1122
+ ```
1123
+
1124
+
1125
+ Also accepts all props of: `BaseForm.Props`.
1126
+
1127
+ ## formatDate
1128
+
1129
+ function · Forms
1130
+
1131
+ `"2026-03-09"`, or `"2026-03-09 14:30:00"` for a date-time: the same everywhere, on a 24-hour clock.
1132
+
1133
+ ```tsx
1134
+ import { formatDate } from '@optimum-intelligence/opti-ui';
1135
+ ```
1136
+
1137
+ Signature: `formatDate(value: string \| null \| undefined)`
1138
+
1139
+ ## formatDateLong
1140
+
1141
+ function · Forms
1142
+
1143
+ The written form, `"2026. March 9."`, or `"2026. March 9. 14:30"` for a date-time.
1144
+ The order and the 24-hour clock are fixed; `locale` only translates the month name.
1145
+
1146
+ ```tsx
1147
+ import { formatDateLong } from '@optimum-intelligence/opti-ui';
1148
+ ```
1149
+
1150
+ Signature: `formatDateLong(value: string \| null \| undefined, locale?: string)`
1151
+
1152
+ ## formatFileSize
1153
+
1154
+ function · Forms
1155
+
1156
+ `1536` → `"1.5 KB"`.
1157
+
1158
+ ```tsx
1159
+ import { formatFileSize } from '@optimum-intelligence/opti-ui';
1160
+ ```
1161
+
1162
+ Signature: `formatFileSize(bytes: number, locale?: string)`
1163
+
1164
+ ## Input
1165
+
1166
+ component · Forms
1167
+
1168
+ Text input, optionally with `startAdornment` / `endAdornment` inside the box. Use `TextField` for a labelled one.
1169
+
1170
+ ```tsx
1171
+ import { Input } from '@optimum-intelligence/opti-ui';
1172
+ ```
1173
+
1174
+ | Prop | Type | Default | Description |
1175
+ | --- | --- | --- | --- |
1176
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
1177
+ | `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
1178
+ | `endAdornment?` | `React.ReactNode` | | Icon, text or button rendered inside the box, after the value. |
1179
+
1180
+ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
1181
+
1182
+ ## NumberField
1183
+
1184
+ component · Forms
1185
+
1186
+ Numeric input with stepper buttons, locale formatting and keyboard stepping.
1187
+
1188
+ ```tsx
1189
+ import { NumberField } from '@optimum-intelligence/opti-ui';
1190
+ ```
1191
+
1192
+ | Prop | Type | Default | Description |
1193
+ | --- | --- | --- | --- |
1194
+ | `label?` | `React.ReactNode` | | Visible field label. |
1195
+ | `description?` | `React.ReactNode` | | Help text under the input. |
1196
+ | `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
1197
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
1198
+ | `placeholder?` | `string` | | Placeholder shown while empty. |
1199
+ | `hideStepper?` | `boolean` | | Hide the − / + stepper buttons. |
1200
+ | `decrementLabel?` | `string` | `'Decrease'` | Accessible name of the − button. |
1201
+ | `incrementLabel?` | `string` | `'Increase'` | Accessible name of the + button. |
1202
+
1203
+ Also accepts all props of: `BaseNumberField.Root.Props`.
1204
+
1205
+ ## PasswordField
1206
+
1207
+ component · Forms
1208
+
1209
+ Labelled password input with description and error message.
1210
+
1211
+ ```tsx
1212
+ import { PasswordField } from '@optimum-intelligence/opti-ui';
1213
+ ```
1214
+
1215
+ | Prop | Type | Default | Description |
1216
+ | --- | --- | --- | --- |
1217
+ | `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
1218
+ | `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
1219
+ | `visible?` | `boolean` | | Whether the value is shown as plain text. |
1220
+ | `defaultVisible?` | `boolean` | | Initial visibility when uncontrolled. |
1221
+ | `onVisibleChange?` | `(visible: boolean) => void` | | Called when the user toggles visibility. |
1222
+ | `toggleLabel?` | `string` | | Accessible name of the show/hide button. |
1223
+
1224
+ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`, `FieldShellProps`.
1225
+
1226
+ ## PasswordInput
1227
+
1228
+ component · Forms
1229
+
1230
+ Password input with a button that reveals the value.
1231
+
1232
+ ```tsx
1233
+ import { PasswordInput } from '@optimum-intelligence/opti-ui';
1234
+ ```
1235
+
1236
+ | Prop | Type | Default | Description |
1237
+ | --- | --- | --- | --- |
1238
+ | `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
1239
+ | `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
1240
+ | `visible?` | `boolean` | | Whether the value is shown as plain text. |
1241
+ | `defaultVisible?` | `boolean` | `false` | Initial visibility when uncontrolled. |
1242
+ | `onVisibleChange?` | `(visible: boolean) => void` | | Called when the user toggles visibility. |
1243
+ | `toggleLabel?` | `string` | `'Show password'` | Accessible name of the show/hide button. |
1244
+
1245
+ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
1246
+
1247
+ ## Radio
1248
+
1249
+ component · Forms
1250
+
1251
+ Radio button with optional `label` and `description`. Use inside `RadioGroup`; each needs a `value`.
1252
+
1253
+ ```tsx
1254
+ import { Radio } from '@optimum-intelligence/opti-ui';
1255
+ ```
1256
+
1257
+
1258
+ Also accepts all props of: `BaseRadio.Root.Props`, `ChoiceLabelProps`.
1259
+
1260
+ ## RadioGroup
1261
+
1262
+ component · Forms
1263
+
1264
+ Single-choice group for `Radio` children (`value` / `onValueChange`).
1265
+
1266
+ ```tsx
1267
+ import { RadioGroup } from '@optimum-intelligence/opti-ui';
1268
+ ```
1269
+
1270
+ | Prop | Type | Default | Description |
1271
+ | --- | --- | --- | --- |
1272
+ | `orientation?` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction of the radios. |
1273
+
1274
+ Also accepts all props of: `BaseRadioGroup.Props`.
1275
+
1276
+ ## RangeCalendar
1277
+
1278
+ component · Forms
1279
+
1280
+ Month grid for picking a range of days: the first pick sets one end, the
1281
+ second completes the range (in either order). Same keyboard as Calendar.
1282
+ Disabled days cannot be picked as an end but may fall inside a range.
1283
+
1284
+ ```tsx
1285
+ import { RangeCalendar } from '@optimum-intelligence/opti-ui';
1286
+ ```
1287
+
1288
+ | Prop | Type | Default | Description |
1289
+ | --- | --- | --- | --- |
1290
+ | `value?` | `DateRange \| null` | | Selected days as ISO dates; both ends are inclusive. |
1291
+ | `defaultValue?` | `DateRange \| null` | `null` | Initially selected range when uncontrolled. |
1292
+ | `onValueChange?` | `(value: DateRange) => void` | | Called once both ends are picked, with `start` on or before `end`. |
1293
+
1294
+ Also accepts all props of: `CalendarOptions`.
1295
+
1296
+ ## SearchInput
1297
+
1298
+ component · Forms
1299
+
1300
+ Text input with a search icon and a clear button that appears once there is a value.
1301
+
1302
+ ```tsx
1303
+ import { SearchInput } from '@optimum-intelligence/opti-ui';
1304
+ ```
1305
+
1306
+ | Prop | Type | Default | Description |
1307
+ | --- | --- | --- | --- |
1308
+ | `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
1309
+ | `value?` | `string` | | Current text (controlled). |
1310
+ | `defaultValue?` | `string` | `''` | Initial text when uncontrolled. |
1311
+ | `onValueChange?` | `(value: string) => void` | | Called with the new text on typing and with `''` on clear. |
1312
+ | `clearLabel?` | `string` | `'Clear search'` | Accessible name of the clear button. |
1313
+ | `icon?` | `React.ReactNode` | | Replaces the leading search icon. |
1314
+
1315
+ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
1316
+
1317
+ ## Select
1318
+
1319
+ compound · Forms
1320
+
1321
+ `<Select items={…} />` renders a complete labelled select. For full control
1322
+ compose the parts: `Select.Root`, `Select.Trigger`, `Select.Content`,
1323
+ `Select.Item`, `Select.Group`, `Select.GroupLabel`, `Select.Separator`.
1324
+
1325
+ ```tsx
1326
+ import { Select } from '@optimum-intelligence/opti-ui';
1327
+ ```
1328
+
1329
+ | Prop | Type | Default | Description |
1330
+ | --- | --- | --- | --- |
1331
+ | `items` | `Array<SelectOption \| SelectOptionGroup>` | | Options, or groups of options. |
1332
+ | `label?` | `React.ReactNode` | | Visible field label. |
1333
+ | `description?` | `React.ReactNode` | | Help text under the trigger. |
1334
+ | `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
1335
+ | `placeholder?` | `React.ReactNode` | `'Select…'` | Text shown while nothing is selected. |
1336
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
1337
+ | `triggerProps?` | `Omit<SelectTriggerProps, 'size' \| 'placeholder'>` | | Props passed to the trigger button (className, style, aria-*). |
1338
+ | `contentProps?` | `Omit<SelectContentProps, 'children'>` | | Props for the popup (side, align, className…). |
1339
+
1340
+ Also accepts all props of: `RootProps`.
1341
+
1342
+ ### Select.Root
1343
+
1344
+ Base UI `Select.Root` re-exported unchanged. See https://base-ui.com/react/components/select.
1345
+
1346
+ ### Select.Label
1347
+
1348
+ ### Select.Trigger
1349
+
1350
+ The select button. Renders the value and chevron unless children are given.
1351
+
1352
+ | Prop | Type | Default | Description |
1353
+ | --- | --- | --- | --- |
1354
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
1355
+ | `placeholder?` | `React.ReactNode` | | Placeholder shown by the default value slot. |
1356
+
1357
+ Also accepts all props of: `BaseSelect.Trigger.Props`.
1358
+
1359
+ ### Select.Value
1360
+
1361
+ ### Select.Content
1362
+
1363
+ Portal + positioner + popup + list in one.
1364
+
1365
+ | Prop | Type | Default | Description |
1366
+ | --- | --- | --- | --- |
1367
+ | `side?` | `BaseSelect.Positioner.Props['side']` | | Which side of the trigger the list opens on. |
1368
+ | `align?` | `BaseSelect.Positioner.Props['align']` | | Alignment along that side. |
1369
+ | `sideOffset?` | `BaseSelect.Positioner.Props['sideOffset']` | `6` | Distance from the trigger in px. |
1370
+ | `alignItemWithTrigger?` | `boolean` | `false` | Overlap the trigger so the selected item lines up with it (macOS style). |
1371
+ | `positionerProps?` | `BaseSelect.Positioner.Props` | | Props for the positioner element that places the popup. |
1372
+
1373
+ Also accepts all props of: `BaseSelect.Popup.Props`.
1374
+
1375
+ ### Select.Item
1376
+
1377
+ ### Select.Group
1378
+
1379
+ ### Select.GroupLabel
1380
+
1381
+ ### Select.Separator
1382
+
1383
+ ## Slider
1384
+
1385
+ component · Forms
1386
+
1387
+ Single value or range (pass an array) slider.
1388
+
1389
+ ```tsx
1390
+ import { Slider } from '@optimum-intelligence/opti-ui';
1391
+ ```
1392
+
1393
+ | Prop | Type | Default | Description |
1394
+ | --- | --- | --- | --- |
1395
+ | `label?` | `React.ReactNode` | | Visible label above the track. |
1396
+ | `showValue?` | `boolean` | | Show the formatted value next to the label. |
1397
+ | `thumbLabels?` | `string[]` | | Accessible labels for each thumb (needed for range sliders). |
1398
+
1399
+ Also accepts all props of: `BaseSlider.Root.Props`.
1400
+
1401
+ ## Switch
1402
+
1403
+ component · Forms
1404
+
1405
+ On/off switch with optional `label` and `description`.
1406
+
1407
+ ```tsx
1408
+ import { Switch } from '@optimum-intelligence/opti-ui';
1409
+ ```
1410
+
1411
+ ```tsx
1412
+ <Switch label="Email alerts" checked={on} onCheckedChange={setOn} />
1413
+ ```
1414
+
1415
+
1416
+ Also accepts all props of: `BaseSwitch.Root.Props`, `ChoiceLabelProps`.
1417
+
1418
+ ## Textarea
1419
+
1420
+ component · Forms
1421
+
1422
+ Multi-line text input. Use `TextareaField` for a labelled one.
1423
+
1424
+ ```tsx
1425
+ import { Textarea } from '@optimum-intelligence/opti-ui';
1426
+ ```
1427
+
1428
+ | Prop | Type | Default | Description |
1429
+ | --- | --- | --- | --- |
1430
+ | `ref?` | `React.Ref<HTMLTextAreaElement>` | | Ref to the `<textarea>`. |
1431
+ | `autoResize?` | `boolean` | | Grow with content up to `maxRows` (uses CSS field-sizing where supported). |
1432
+
1433
+ Also accepts all props of: `React.TextareaHTMLAttributes<HTMLTextAreaElement>`.
1434
+
1435
+ ## TextareaField
1436
+
1437
+ component · Forms
1438
+
1439
+ Labelled textarea with description and error message.
1440
+
1441
+ ```tsx
1442
+ import { TextareaField } from '@optimum-intelligence/opti-ui';
1443
+ ```
1444
+
1445
+ | Prop | Type | Default | Description |
1446
+ | --- | --- | --- | --- |
1447
+ | `ref?` | `React.Ref<HTMLTextAreaElement>` | | Ref to the `<textarea>`. |
1448
+ | `autoResize?` | `boolean` | | Grow with content up to `maxRows` (uses CSS field-sizing where supported). |
1449
+
1450
+ Also accepts all props of: `React.TextareaHTMLAttributes<HTMLTextAreaElement>`, `FieldShellProps`.
1451
+
1452
+ ## TextField
1453
+
1454
+ component · Forms
1455
+
1456
+ Labelled input with description and error message.
1457
+
1458
+ ```tsx
1459
+ import { TextField } from '@optimum-intelligence/opti-ui';
1460
+ ```
1461
+
1462
+ | Prop | Type | Default | Description |
1463
+ | --- | --- | --- | --- |
1464
+ | `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
1465
+ | `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
1466
+ | `endAdornment?` | `React.ReactNode` | | Icon, text or button rendered inside the box, after the value. |
1467
+
1468
+ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`, `FieldShellProps`.
1469
+
1470
+ # Overlays
1471
+
1472
+ ## AlertDialog
1473
+
1474
+ compound · Overlays
1475
+
1476
+ Confirmation dialog that requires an explicit choice (no outside-click dismissal).
1477
+
1478
+ ```tsx
1479
+ import { AlertDialog } from '@optimum-intelligence/opti-ui';
1480
+ ```
1481
+
1482
+ ### AlertDialog.Root
1483
+
1484
+ Base UI `AlertDialog.Root` re-exported unchanged. See https://base-ui.com/react/components/alert-dialog.
1485
+
1486
+ ### AlertDialog.Trigger
1487
+
1488
+ Base UI `AlertDialog.Trigger` re-exported unchanged. See https://base-ui.com/react/components/alert-dialog.
1489
+
1490
+ ### AlertDialog.Content
1491
+
1492
+ | Prop | Type | Default | Description |
1493
+ | --- | --- | --- | --- |
1494
+ | `size?` | `Exclude<DialogSize, 'full'>` | `'sm'` | Dialog width. |
1495
+
1496
+ Also accepts all props of: `BaseAlertDialog.Popup.Props`.
1497
+
1498
+ ### AlertDialog.Header
1499
+
1500
+ Styled `<div>` (`.oui-dialog__header`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
1501
+
1502
+ ### AlertDialog.Title
1503
+
1504
+ ### AlertDialog.Description
1505
+
1506
+ ### AlertDialog.Body
1507
+
1508
+ Styled `<div>` (`.oui-dialog__body`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
1509
+
1510
+ ### AlertDialog.Footer
1511
+
1512
+ Styled `<div>` (`.oui-dialog__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
1513
+
1514
+ ### AlertDialog.Close
1515
+
1516
+ Base UI `AlertDialog.Close` re-exported unchanged. See https://base-ui.com/react/components/alert-dialog.
1517
+
1518
+ ## CommandPalette
1519
+
1520
+ component · Overlays
1521
+
1522
+ Searchable command menu in a dialog (Ctrl / ⌘ + K) for navigation and quick
1523
+ actions. Keyboard: arrows move, Enter chooses, Esc closes.
1524
+
1525
+ ```tsx
1526
+ import { CommandPalette } from '@optimum-intelligence/opti-ui';
1527
+ ```
1528
+
1529
+ | Prop | Type | Default | Description |
1530
+ | --- | --- | --- | --- |
1531
+ | `items` | `T[]` | | Commands to list. |
1532
+ | `onSelect?` | `(item: T) => void` | | Called for any chosen item, after the item's own `onSelect`. |
1533
+ | `open?` | `boolean` | | Whether the palette is open (controlled). |
1534
+ | `defaultOpen?` | `boolean` | `false` | Initial state when uncontrolled. |
1535
+ | `onOpenChange?` | `(open: boolean) => void` | | Called when the palette opens or closes. |
1536
+ | `search?` | `string` | | Search text (controlled). |
1537
+ | `defaultSearch?` | `string` | `''` | Initial search text when uncontrolled. |
1538
+ | `onSearchChange?` | `(search: string) => void` | | Called when the search text changes. |
1539
+ | `filter?` | `((item: T, search: string) => boolean) \| false` | | Custom match function, or `false` when `items` are already filtered (server-side search). By default every term must occur in the label, keywords or group. |
1540
+ | `maxResults?` | `number` | `50` | Cap on rendered results. |
1541
+ | `hotkey?` | `string \| false` | `'k'` | Key that toggles the palette together with Ctrl / ⌘. `false` disables the shortcut. |
1542
+ | `keepOpenOnSelect?` | `boolean` | | Keep the palette open after choosing an item. |
1543
+ | `title?` | `string` | `'Command palette'` | Accessible name of the dialog. |
1544
+ | `placeholder?` | `string` | `'Search…'` | Placeholder of the search input. |
1545
+ | `emptyText?` | `React.ReactNode` | `'No results found.'` | Shown when nothing matches. |
1546
+ | `loading?` | `boolean` | | Show a spinner in the search row while results load. |
1547
+ | `footer?` | `React.ReactNode` | | Content below the results (key hints, a retry button…). |
1548
+ | `className?` | `string` | | Class name for the palette popup. |
1549
+
1550
+ Also accepts all props of: `CommandItem = CommandItem>`.
1551
+
1552
+ ## createToastManager
1553
+
1554
+ function · Overlays
1555
+
1556
+ Base UI `Toast.createToastManager` re-exported unchanged. See https://base-ui.com/react/components/toast.
1557
+
1558
+ ```tsx
1559
+ import { createToastManager } from '@optimum-intelligence/opti-ui';
1560
+ ```
1561
+
1562
+ ## Dialog
1563
+
1564
+ compound · Overlays
1565
+
1566
+ Modal dialog and side sheet. Compose:
1567
+ `Dialog.Root` › `Dialog.Trigger` + `Dialog.Content` › `Dialog.Header` (`Title`, `Description`), `Dialog.Body`, `Dialog.Footer`.
1568
+ Use `render={<Button />}` on `Dialog.Trigger` / `Dialog.Close` to style them as buttons.
1569
+
1570
+ ```tsx
1571
+ import { Dialog } from '@optimum-intelligence/opti-ui';
1572
+ ```
1573
+
1574
+ ### Dialog.Root
1575
+
1576
+ Base UI `Dialog.Root` re-exported unchanged. See https://base-ui.com/react/components/dialog.
1577
+
1578
+ ### Dialog.Trigger
1579
+
1580
+ Base UI `Dialog.Trigger` re-exported unchanged. See https://base-ui.com/react/components/dialog.
1581
+
1582
+ ### Dialog.Content
1583
+
1584
+ | Prop | Type | Default | Description |
1585
+ | --- | --- | --- | --- |
1586
+ | `size?` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'md'` | Width of a centered dialog, or of a sheet. |
1587
+ | `placement?` | `'center' \| 'right' \| 'left' \| 'bottom'` | `'center'` | `center` modal, or a sheet docked to an edge. |
1588
+ | `showClose?` | `boolean` | `true` | Render the corner close button. |
1589
+ | `closeLabel?` | `string` | `'Close'` | Accessible name of the close button. |
1590
+ | `backdropProps?` | `BaseDialog.Backdrop.Props` | | Props for the backdrop behind the dialog. |
1591
+
1592
+ Also accepts all props of: `BaseDialog.Popup.Props`.
1593
+
1594
+ ### Dialog.Header
1595
+
1596
+ Styled `<div>` (`.oui-dialog__header`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
1597
+
1598
+ ### Dialog.Title
1599
+
1600
+ ### Dialog.Description
1601
+
1602
+ ### Dialog.Body
1603
+
1604
+ Styled `<div>` (`.oui-dialog__body`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
1605
+
1606
+ ### Dialog.Footer
1607
+
1608
+ Styled `<div>` (`.oui-dialog__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
1609
+
1610
+ ### Dialog.Close
1611
+
1612
+ Base UI `Dialog.Close` re-exported unchanged. See https://base-ui.com/react/components/dialog.
1613
+
1614
+ ### Dialog.createHandle
1615
+
1616
+ Base UI `Dialog.createHandle` re-exported unchanged. See https://base-ui.com/react/components/dialog.
1617
+
1618
+ ## Drawer
1619
+
1620
+ component · Overlays
1621
+
1622
+ Side panel for inspecting or editing a record without leaving the page:
1623
+ pinned header, scrolling body, optional pinned footer. For a free-form
1624
+ sheet use `Dialog.Content` with `placement`.
1625
+
1626
+ ```tsx
1627
+ import { Drawer } from '@optimum-intelligence/opti-ui';
1628
+ ```
1629
+
1630
+ | Prop | Type | Default | Description |
1631
+ | --- | --- | --- | --- |
1632
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the drawer panel. |
1633
+ | `open?` | `boolean` | | Whether the drawer is open (controlled). |
1634
+ | `defaultOpen?` | `boolean` | `false` | Initial state when uncontrolled. |
1635
+ | `onOpenChange?` | `(open: boolean) => void` | | Called when the drawer opens or closes. |
1636
+ | `trigger?` | `React.ReactElement` | | Element that opens the drawer, e.g. `<Button>Details</Button>`. Omit when `open` is controlled. |
1637
+ | `title` | `React.ReactNode` | | Header title; also the drawer's accessible name. |
1638
+ | `eyebrow?` | `React.ReactNode` | | Small label above the title, e.g. the record type. |
1639
+ | `description?` | `React.ReactNode` | | Supporting text under the title. |
1640
+ | `actions?` | `React.ReactNode` | | Header content next to the close button (edit, delete, a menu…). |
1641
+ | `footer?` | `React.ReactNode` | | Pinned to the bottom, for form buttons. |
1642
+ | `side?` | `'right' \| 'left'` | `'right'` | Edge the drawer slides in from. |
1643
+ | `size?` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Width: sm 24rem, md 32rem (default), lg 48rem, xl 60rem. Override with `--oui-drawer-width`. |
1644
+ | `dismissible?` | `boolean` | `true` | Set to `false` to block Esc, outside clicks and the close button, e.g. while a form inside is saving. |
1645
+ | `modal?` | `boolean` | `true` | `false` leaves the page behind interactive and drops the backdrop. |
1646
+ | `closeLabel?` | `string` | `'Close'` | Accessible name of the close button. |
1647
+ | `className?` | `string` | | Class name for the drawer panel. |
1648
+ | `bodyProps?` | `React.HTMLAttributes<HTMLDivElement>` | | Props for the scrolling content area. |
1649
+ | `children?` | `React.ReactNode` | | Drawer body content. |
1650
+
1651
+ ## Popover
1652
+
1653
+ compound · Overlays
1654
+
1655
+ Floating panel anchored to a trigger, for small forms, filters and details.
1656
+
1657
+ ```tsx
1658
+ import { Popover } from '@optimum-intelligence/opti-ui';
1659
+ ```
1660
+
1661
+ ### Popover.Root
1662
+
1663
+ Base UI `Popover.Root` re-exported unchanged. See https://base-ui.com/react/components/popover.
1664
+
1665
+ ### Popover.Trigger
1666
+
1667
+ Base UI `Popover.Trigger` re-exported unchanged. See https://base-ui.com/react/components/popover.
1668
+
1669
+ ### Popover.Content
1670
+
1671
+ | Prop | Type | Default | Description |
1672
+ | --- | --- | --- | --- |
1673
+ | `side?` | `BasePopover.Positioner.Props['side']` | `'bottom'` | Which side of the trigger the popover opens on. |
1674
+ | `align?` | `BasePopover.Positioner.Props['align']` | `'center'` | Alignment along that side. |
1675
+ | `sideOffset?` | `BasePopover.Positioner.Props['sideOffset']` | `8` | Distance from the trigger in px. |
1676
+ | `arrow?` | `boolean` | | Show a small arrow pointing at the trigger. |
1677
+ | `positionerProps?` | `BasePopover.Positioner.Props` | | Props for the positioner element that places the popup. |
1678
+
1679
+ Also accepts all props of: `BasePopover.Popup.Props`.
1680
+
1681
+ ### Popover.Title
1682
+
1683
+ ### Popover.Description
1684
+
1685
+ ### Popover.Close
1686
+
1687
+ Base UI `Popover.Close` re-exported unchanged. See https://base-ui.com/react/components/popover.
1688
+
1689
+ ## PreviewCard
1690
+
1691
+ compound · Overlays
1692
+
1693
+ Card that appears when a link is hovered or focused, previewing what is behind it.
1694
+ `PreviewCard.Trigger` is the link itself. Keep the content supplementary: touch users never see it.
1695
+
1696
+ ```tsx
1697
+ import { PreviewCard } from '@optimum-intelligence/opti-ui';
1698
+ ```
1699
+
1700
+ ### PreviewCard.Root
1701
+
1702
+ Base UI `PreviewCard.Root` re-exported unchanged. See https://base-ui.com/react/components/preview-card.
1703
+
1704
+ ### PreviewCard.Trigger
1705
+
1706
+ Base UI `PreviewCard.Trigger` re-exported unchanged. See https://base-ui.com/react/components/preview-card.
1707
+
1708
+ ### PreviewCard.Content
1709
+
1710
+ | Prop | Type | Default | Description |
1711
+ | --- | --- | --- | --- |
1712
+ | `side?` | `BasePreviewCard.Positioner.Props['side']` | `'bottom'` | Which side of the trigger the card opens on. |
1713
+ | `align?` | `BasePreviewCard.Positioner.Props['align']` | `'center'` | Alignment along that side. |
1714
+ | `sideOffset?` | `BasePreviewCard.Positioner.Props['sideOffset']` | `8` | Distance from the trigger in px. |
1715
+ | `arrow?` | `boolean` | | Show a small arrow pointing at the trigger. |
1716
+ | `positionerProps?` | `BasePreviewCard.Positioner.Props` | | Props for the positioner element that places the popup. |
1717
+
1718
+ Also accepts all props of: `BasePreviewCard.Popup.Props`.
1719
+
1720
+ ## ToastProvider
1721
+
1722
+ component · Overlays
1723
+
1724
+ Mount once near the app root. Then call `useToast()` anywhere below, or pass
1725
+ a `toastManager` from `createToastManager()` to trigger toasts outside React.
1726
+
1727
+ ```tsx
1728
+ import { ToastProvider } from '@optimum-intelligence/opti-ui';
1729
+ ```
1730
+
1731
+ | Prop | Type | Default | Description |
1732
+ | --- | --- | --- | --- |
1733
+ | `children?` | `React.ReactNode` | | App content; toasts render over it. |
1734
+ | `placement?` | `'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' \| 'bottom-center' \| 'top-center'` | `'bottom-right'` | Screen corner or edge where toasts stack. |
1735
+ | `viewportClassName?` | `string` | | Class for the viewport (positioning container). |
1736
+
1737
+ Also accepts all props of: `Omit<BaseToast.Provider.Props, 'children'>`.
1738
+
1739
+ ## Tooltip
1740
+
1741
+ compound · Overlays
1742
+
1743
+ `<Tooltip content="Export"><IconButton … /></Tooltip>`.
1744
+ Wrap the app in `Tooltip.Provider` so adjacent tooltips open instantly.
1745
+
1746
+ ```tsx
1747
+ import { Tooltip } from '@optimum-intelligence/opti-ui';
1748
+ ```
1749
+
1750
+ | Prop | Type | Default | Description |
1751
+ | --- | --- | --- | --- |
1752
+ | `content` | `React.ReactNode` | | Tooltip text. |
1753
+ | `children` | `React.ReactElement` | | The trigger. Must be a single element that accepts a ref (e.g. a Button). |
1754
+ | `side?` | `TooltipContentProps['side']` | | Which side of the trigger the tooltip shows on. |
1755
+ | `align?` | `TooltipContentProps['align']` | | Alignment along that side. |
1756
+ | `delay?` | `number` | | Hover delay in ms. |
1757
+ | `contentProps?` | `Omit<TooltipContentProps, 'children'>` | | Props for the tooltip popup (arrow, sideOffset, className…). |
1758
+
1759
+ Also accepts all props of: `Omit<BaseTooltip.Root.Props, 'children'>`.
1760
+
1761
+ ### Tooltip.Provider
1762
+
1763
+ Base UI `Tooltip.Provider` re-exported unchanged. See https://base-ui.com/react/components/tooltip.
1764
+
1765
+ ### Tooltip.Root
1766
+
1767
+ Base UI `Tooltip.Root` re-exported unchanged. See https://base-ui.com/react/components/tooltip.
1768
+
1769
+ ### Tooltip.Trigger
1770
+
1771
+ Base UI `Tooltip.Trigger` re-exported unchanged. See https://base-ui.com/react/components/tooltip.
1772
+
1773
+ ### Tooltip.Content
1774
+
1775
+ | Prop | Type | Default | Description |
1776
+ | --- | --- | --- | --- |
1777
+ | `side?` | `BaseTooltip.Positioner.Props['side']` | `'top'` | Which side of the trigger the tooltip shows on. |
1778
+ | `align?` | `BaseTooltip.Positioner.Props['align']` | `'center'` | Alignment along that side. |
1779
+ | `sideOffset?` | `BaseTooltip.Positioner.Props['sideOffset']` | `8` | Distance from the trigger in px. |
1780
+ | `arrow?` | `boolean` | `true` | Show a small arrow pointing at the trigger. |
1781
+ | `positionerProps?` | `BaseTooltip.Positioner.Props` | | Props for the positioner element that places the popup. |
1782
+
1783
+ Also accepts all props of: `BaseTooltip.Popup.Props`.
1784
+
1785
+ ## useToast
1786
+
1787
+ hook · Overlays
1788
+
1789
+ Toast API with tone shortcuts: `toast.success({ title })`.
1790
+
1791
+ ```tsx
1792
+ import { useToast } from '@optimum-intelligence/opti-ui';
1793
+ ```
1794
+
1795
+ Signature: `useToast()`
1796
+
1797
+ # Disclosure & navigation
1798
+
1799
+ ## Accordion
1800
+
1801
+ compound · Disclosure & navigation
1802
+
1803
+ Expandable sections. Compose `Accordion.Root` › `Accordion.Item` (give each a `value`) ›
1804
+ `Accordion.Trigger` + `Accordion.Panel`. Pass `multiple` to `Root` to allow several open at once.
1805
+
1806
+ ```tsx
1807
+ import { Accordion } from '@optimum-intelligence/opti-ui';
1808
+ ```
1809
+
1810
+ ```tsx
1811
+ <Accordion.Root defaultValue={['a']}>
1812
+ <Accordion.Item value="a">
1813
+ <Accordion.Trigger>Billing</Accordion.Trigger>
1814
+ <Accordion.Panel>…</Accordion.Panel>
1815
+ </Accordion.Item>
1816
+ </Accordion.Root>
1817
+ ```
1818
+
1819
+ ### Accordion.Root
1820
+
1821
+ | Prop | Type | Default | Description |
1822
+ | --- | --- | --- | --- |
1823
+ | `variant?` | `'separated' \| 'plain'` | `'plain'` | `separated` renders each item as its own card; `plain` uses dividers. |
1824
+
1825
+ Also accepts all props of: `BaseAccordion.Root.Props`.
1826
+
1827
+ ### Accordion.Item
1828
+
1829
+ ### Accordion.Trigger
1830
+
1831
+ Header + trigger + chevron in one.
1832
+
1833
+ ### Accordion.Panel
1834
+
1835
+ ## Breadcrumb
1836
+
1837
+ component · Disclosure & navigation
1838
+
1839
+ One step of a breadcrumb trail. Pass a router link through `render`.
1840
+
1841
+ ```tsx
1842
+ import { Breadcrumb } from '@optimum-intelligence/opti-ui';
1843
+ ```
1844
+
1845
+ | Prop | Type | Default | Description |
1846
+ | --- | --- | --- | --- |
1847
+ | `current?` | `boolean` | `false` | Marks the page the user is on; it renders as text instead of a link. |
1848
+
1849
+ Also accepts all props of: `useRender.ComponentProps<'a', BreadcrumbState>`.
1850
+
1851
+ ## Breadcrumbs
1852
+
1853
+ component · Disclosure & navigation
1854
+
1855
+ Trail of links to the pages above the current one. Each child becomes one step.
1856
+
1857
+ ```tsx
1858
+ import { Breadcrumbs } from '@optimum-intelligence/opti-ui';
1859
+ ```
1860
+
1861
+ | Prop | Type | Default | Description |
1862
+ | --- | --- | --- | --- |
1863
+ | `ref?` | `React.Ref<HTMLElement>` | | Ref to the `<nav>` element. |
1864
+ | `separator?` | `React.ReactNode` | | Shown between items. Defaults to a chevron. |
1865
+
1866
+ Also accepts all props of: `React.HTMLAttributes<HTMLElement>`.
1867
+
1868
+ ## Collapsible
1869
+
1870
+ compound · Disclosure & navigation
1871
+
1872
+ A single section that shows and hides: advanced options, "show more", filter groups.
1873
+
1874
+ ```tsx
1875
+ import { Collapsible } from '@optimum-intelligence/opti-ui';
1876
+ ```
1877
+
1878
+ ### Collapsible.Root
1879
+
1880
+ ### Collapsible.Trigger
1881
+
1882
+ | Prop | Type | Default | Description |
1883
+ | --- | --- | --- | --- |
1884
+ | `chevron?` | `boolean` | `true` | Show the chevron that turns when the panel opens. |
1885
+
1886
+ Also accepts all props of: `BaseCollapsible.Trigger.Props`.
1887
+
1888
+ ### Collapsible.Panel
1889
+
1890
+ ## getPageItems
1891
+
1892
+ function · Disclosure & navigation
1893
+
1894
+ Page numbers to render, with `'gap'` where pages are skipped.
1895
+
1896
+ ```tsx
1897
+ import { getPageItems } from '@optimum-intelligence/opti-ui';
1898
+ ```
1899
+
1900
+ Signature: `getPageItems(page: number, pageCount: number, siblingCount = 1)`
1901
+
1902
+ ## Pagination
1903
+
1904
+ component · Disclosure & navigation
1905
+
1906
+ Controlled page navigation with an optional rows-per-page select.
1907
+
1908
+ ```tsx
1909
+ import { Pagination } from '@optimum-intelligence/opti-ui';
1910
+ ```
1911
+
1912
+ | Prop | Type | Default | Description |
1913
+ | --- | --- | --- | --- |
1914
+ | `ref?` | `React.Ref<HTMLElement>` | | Ref to the `<nav>` element. |
1915
+ | `page` | `number` | | Current page, starting at 1. |
1916
+ | `pageSize` | `number` | | Items per page. |
1917
+ | `total` | `number` | | Total number of items across all pages. |
1918
+ | `onPageChange` | `(page: number) => void` | | Called with the new page number. |
1919
+ | `onPageSizeChange?` | `(pageSize: number) => void` | | Passing this adds the rows-per-page select. |
1920
+ | `pageSizeOptions?` | `number[]` | `[10, 25, 50]` | Choices in the rows-per-page select. |
1921
+ | `variant?` | `'pages' \| 'simple'` | `'pages'` | `pages` shows numbered buttons; `simple` only previous / next. |
1922
+ | `siblingCount?` | `number` | `1` | Numbered pages shown on each side of the current one. |
1923
+ | `hideRange?` | `boolean` | | Hide the "11–20 of 87" summary. |
1924
+ | `labels?` | `Partial<PaginationLabels>` | | Override texts for localisation. |
1925
+
1926
+ Also accepts all props of: `Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>`.
1927
+
1928
+ ## Stepper
1929
+
1930
+ component · Disclosure & navigation
1931
+
1932
+ Progress through an ordered sequence: a wizard, a checkout, a background job's phases.
1933
+
1934
+ ```tsx
1935
+ import { Stepper } from '@optimum-intelligence/opti-ui';
1936
+ ```
1937
+
1938
+ | Prop | Type | Default | Description |
1939
+ | --- | --- | --- | --- |
1940
+ | `ref?` | `React.Ref<HTMLOListElement>` | | Ref to the `<ol>` element. |
1941
+ | `steps` | `StepItem[]` | | The steps in order. |
1942
+ | `current?` | `number` | `0` | Index of the active step. Earlier steps are complete; `steps.length` completes all of them. |
1943
+ | `orientation?` | `'horizontal' \| 'vertical'` | `'horizontal'` | Lay the steps out in a row or a column. |
1944
+ | `size?` | `'sm' \| 'md'` | `'md'` | Marker and text size. |
1945
+ | `labels?` | `Partial<StepperLabels>` | | Screen-reader text for each status. |
1946
+
1947
+ Also accepts all props of: `React.OlHTMLAttributes<HTMLOListElement>`.
1948
+
1949
+ ## Tabs
1950
+
1951
+ compound · Disclosure & navigation
1952
+
1953
+ `Tabs.Root` › `Tabs.List` › `Tabs.Tab`, then one `Tabs.Panel` per value.
1954
+
1955
+ ```tsx
1956
+ import { Tabs } from '@optimum-intelligence/opti-ui';
1957
+ ```
1958
+
1959
+ ### Tabs.Root
1960
+
1961
+ ### Tabs.List
1962
+
1963
+ | Prop | Type | Default | Description |
1964
+ | --- | --- | --- | --- |
1965
+ | `variant?` | `'underline' \| 'segmented'` | `'underline'` | `underline` (default) for page sections, `segmented` for compact switchers. |
1966
+ | `size?` | `'sm' \| 'md'` | `'md'` | Tab height and text size. |
1967
+
1968
+ Also accepts all props of: `BaseTabs.List.Props`.
1969
+
1970
+ ### Tabs.Tab
1971
+
1972
+ ### Tabs.Panel
1973
+
1974
+ # Feedback & data display
1975
+
1976
+ ## Alert
1977
+
1978
+ component · Feedback & data display
1979
+
1980
+ Inline message for page- or section-level feedback.
1981
+
1982
+ ```tsx
1983
+ import { Alert } from '@optimum-intelligence/opti-ui';
1984
+ ```
1985
+
1986
+ | Prop | Type | Default | Description |
1987
+ | --- | --- | --- | --- |
1988
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the alert element. |
1989
+ | `tone?` | `'info' \| 'success' \| 'warning' \| 'danger' \| 'neutral'` | `'info'` | Semantic color and default icon. `danger` and `warning` announce as an alert role. |
1990
+ | `variant?` | `'soft' \| 'outline'` | `'soft'` | `soft` (tinted, default) or `outline`. |
1991
+ | `title?` | `React.ReactNode` | | Bold first line above the message. |
1992
+ | `icon?` | `React.ReactNode \| false` | | Custom icon, or `false` to hide it. |
1993
+ | `actions?` | `React.ReactNode` | | Buttons rendered after the message. |
1994
+ | `onDismiss?` | `() => void` | | Shows a dismiss button. |
1995
+ | `dismissLabel?` | `string` | `'Dismiss'` | Accessible name of the dismiss button. |
1996
+
1997
+ Also accepts all props of: `Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>`.
1998
+
1999
+ ## Avatar
2000
+
2001
+ component · Feedback & data display
2002
+
2003
+ User or entity picture with initials fallback.
2004
+
2005
+ ```tsx
2006
+ import { Avatar } from '@optimum-intelligence/opti-ui';
2007
+ ```
2008
+
2009
+ | Prop | Type | Default | Description |
2010
+ | --- | --- | --- | --- |
2011
+ | `src?` | `string` | | Image URL. Falls back to initials or `fallback` while loading or on error. |
2012
+ | `alt?` | `string` | | Image alt text. Defaults to `name`. |
2013
+ | `name?` | `string` | | Name used for initials when the image is missing. |
2014
+ | `fallback?` | `React.ReactNode` | | Explicit fallback content (overrides initials). |
2015
+ | `size?` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Diameter. |
2016
+ | `shape?` | `'circle' \| 'rounded'` | `'circle'` | Outline shape. |
2017
+
2018
+ Also accepts all props of: `BaseAvatar.Root.Props`.
2019
+
2020
+ ## AvatarGroup
2021
+
2022
+ component · Feedback & data display
2023
+
2024
+ Overlapping row of `Avatar` children, with an optional "+N" overflow counter.
2025
+
2026
+ ```tsx
2027
+ import { AvatarGroup } from '@optimum-intelligence/opti-ui';
2028
+ ```
2029
+
2030
+ | Prop | Type | Default | Description |
2031
+ | --- | --- | --- | --- |
2032
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the group element. |
2033
+ | `max?` | `number` | | Show at most this many avatars, then a "+N" counter. |
2034
+ | `size?` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Size applied to every avatar in the group. |
2035
+
2036
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
2037
+
2038
+ ## Badge
2039
+
2040
+ component · Feedback & data display
2041
+
2042
+ Small status label.
2043
+
2044
+ ```tsx
2045
+ import { Badge } from '@optimum-intelligence/opti-ui';
2046
+ ```
2047
+
2048
+ ```tsx
2049
+ <Badge tone="success" dot>Online</Badge>
2050
+ ```
2051
+
2052
+ | Prop | Type | Default | Description |
2053
+ | --- | --- | --- | --- |
2054
+ | `tone?` | `'neutral' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Semantic color. |
2055
+ | `variant?` | `'soft' \| 'solid' \| 'outline'` | `'soft'` | `soft` tinted, `solid` filled, `outline` bordered. |
2056
+ | `size?` | `'sm' \| 'md'` | `'md'` | Badge height and text size. |
2057
+ | `dot?` | `boolean` | | Leading status dot. |
2058
+
2059
+ Also accepts all props of: `useRender.ComponentProps<'span', BadgeState>`.
2060
+
2061
+ ## DataTable
2062
+
2063
+ compound · Feedback & data display
2064
+
2065
+ `<DataTable data={…} columns={…} />` renders a complete table with search,
2066
+ filters, sorting, pagination, row selection, row actions and inline editing;
2067
+ columns declare what they take part in. Every piece of state works
2068
+ uncontrolled or controlled (`search` / `filterValues` / `sort` / `page` /
2069
+ `selection`), and with `mode="server"` the same state drives an API.
2070
+
2071
+ For another layout, create the table with `useDataTable` and compose the
2072
+ parts: `DataTable.Root`, `DataTable.Toolbar`, `DataTable.Search`,
2073
+ `DataTable.Filters`, `DataTable.Filter`, `DataTable.Actions`,
2074
+ `DataTable.Summary`, `DataTable.Content`, `DataTable.Pagination`.
2075
+
2076
+ ```tsx
2077
+ import { DataTable } from '@optimum-intelligence/opti-ui';
2078
+ ```
2079
+
2080
+ | Prop | Type | Default | Description |
2081
+ | --- | --- | --- | --- |
2082
+ | `layout?` | `'stable' \| 'auto'` | | `stable` (default) measures the columns once and holds their widths, keeps a short last page as tall as a full one, and keeps a row's height while it is edited: nothing moves while the table is used. `auto` leaves the layout to the browser, which fits the columns to the rows on screen. |
2083
+ | `maxHeight?` | `number \| string` | | Scrolls the rows inside this height and keeps the header in view. |
2084
+ | `virtualized?` | `boolean \| DataTableVirtualOptions` | | Renders only the rows in view, for thousands of rows without pagination. Rows are one line high: columns fit their longest value, so mark those with long text `truncate`. Scrolls inside `maxHeight` (default `32rem`). |
2085
+ | `onEndReached?` | `() => void` | | Called when the rows are scrolled near their end, once per row count: load and append the next rows. Needs `maxHeight` or `virtualized`. |
2086
+ | `empty?` | `React.ReactNode` | | Replaces the default empty state. |
2087
+ | `tableProps?` | `Omit<TableProps, 'children'>` | | Props for the underlying `Table` (className, wrapperProps, aria-*). |
2088
+ | `pageSizeOptions?` | `number[]` | | Choices in the rows-per-page select. |
2089
+ | `controlSize?` | `'sm' \| 'md'` | | Size of the search box and the filters. |
2090
+ | `toolbar?` | `React.ReactNode \| ((context: DataTableToolbarContext<T>) => React.ReactNode)` | | Extra toolbar content (export, add…). A function receives the processed rows. |
2091
+ | `className?` | `string` | | Class name for the table's root element. |
2092
+
2093
+ Also accepts all props of: `UseDataTableOptions<T>`, `Pick<TableProps, 'density' \| 'striped' \| 'stickyHeader'>`.
2094
+
2095
+ ### DataTable.Root
2096
+
2097
+ Provides a table to the parts inside it.
2098
+
2099
+ | Prop | Type | Default | Description |
2100
+ | --- | --- | --- | --- |
2101
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the table's root element. |
2102
+ | `table` | `DataTableInstance<T>` | | The table from `useDataTable`. |
2103
+
2104
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
2105
+
2106
+ ### DataTable.Toolbar
2107
+
2108
+ Styled `<div>` (`.oui-data-table__toolbar`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
2109
+
2110
+ ### DataTable.Search
2111
+
2112
+ Search box of the table. Typing applies after the table's `searchDebounce`; clearing applies at once.
2113
+
2114
+ | Prop | Type | Default | Description |
2115
+ | --- | --- | --- | --- |
2116
+ | `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
2117
+ | `clearLabel?` | `string` | | Accessible name of the clear button. |
2118
+ | `icon?` | `React.ReactNode` | | Replaces the leading search icon. |
2119
+ | `className?` | `string` | | Class name for the search box. |
2120
+
2121
+ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
2122
+
2123
+ ### DataTable.Filters
2124
+
2125
+ Every filter of the table, with a clear button while any is active. Children are added after the filters.
2126
+
2127
+ | Prop | Type | Default | Description |
2128
+ | --- | --- | --- | --- |
2129
+ | `size?` | `'sm' \| 'md'` | | Control height of every filter. |
2130
+
2131
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
2132
+
2133
+ ### DataTable.Filter
2134
+
2135
+ The control of one filter: a dropdown, a toggle chip or a date range picker.
2136
+
2137
+ | Prop | Type | Default | Description |
2138
+ | --- | --- | --- | --- |
2139
+ | `id` | `string` | | Id of the filter: the column id, or the `id` given in `filters`. |
2140
+ | `size?` | `'sm' \| 'md'` | | Control height. |
2141
+ | `className?` | `string` | | Class name for the filter control. |
2142
+
2143
+ ### DataTable.Actions
2144
+
2145
+ Styled `<div>` (`.oui-data-table__actions`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
2146
+
2147
+ ### DataTable.Summary
2148
+
2149
+ Row count, or the number of selected rows, with a spinner while loading.
2150
+
2151
+ ### DataTable.Content
2152
+
2153
+ The table itself, with its loading, empty and error states.
2154
+
2155
+ | Prop | Type | Default | Description |
2156
+ | --- | --- | --- | --- |
2157
+ | `layout?` | `'stable' \| 'auto'` | | `stable` (default) measures the columns once and holds their widths, keeps a short last page as tall as a full one, and keeps a row's height while it is edited: nothing moves while the table is used. `auto` leaves the layout to the browser, which fits the columns to the rows on screen. |
2158
+ | `maxHeight?` | `number \| string` | | Scrolls the rows inside this height and keeps the header in view. |
2159
+ | `virtualized?` | `boolean \| DataTableVirtualOptions` | | Renders only the rows in view, for thousands of rows without pagination. Rows are one line high: columns fit their longest value, so mark those with long text `truncate`. Scrolls inside `maxHeight` (default `32rem`). |
2160
+ | `onEndReached?` | `() => void` | | Called when the rows are scrolled near their end, once per row count: load and append the next rows. Needs `maxHeight` or `virtualized`. |
2161
+ | `empty?` | `React.ReactNode` | | Replaces the default empty state. |
2162
+ | `tableProps?` | `Omit<TableProps, 'children'>` | | Props for the underlying `Table` (className, wrapperProps, aria-*). |
2163
+
2164
+ Also accepts all props of: `Pick<TableProps, 'density' \| 'striped' \| 'stickyHeader'>`.
2165
+
2166
+ ### DataTable.Pagination
2167
+
2168
+ Page navigation of the table. Renders nothing when there are no rows, or the table is not paginated.
2169
+
2170
+ | Prop | Type | Default | Description |
2171
+ | --- | --- | --- | --- |
2172
+ | `ref?` | `React.Ref<HTMLElement>` | | Ref to the `<nav>` element. |
2173
+ | `pageSizeOptions?` | `number[]` | | Choices in the rows-per-page select. |
2174
+ | `variant?` | `'pages' \| 'simple'` | | `pages` shows numbered buttons; `simple` only previous / next. |
2175
+ | `siblingCount?` | `number` | | Numbered pages shown on each side of the current one. |
2176
+ | `hideRange?` | `boolean` | | Hide the "11–20 of 87" summary. |
2177
+ | `labels?` | `Partial<PaginationLabels>` | | Override texts for localisation. |
2178
+
2179
+ Also accepts all props of: `Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>`.
2180
+
2181
+ ## EmptyState
2182
+
2183
+ component · Feedback & data display
2184
+
2185
+ Placeholder for empty lists, searches without results and first-run screens.
2186
+
2187
+ ```tsx
2188
+ import { EmptyState } from '@optimum-intelligence/opti-ui';
2189
+ ```
2190
+
2191
+ | Prop | Type | Default | Description |
2192
+ | --- | --- | --- | --- |
2193
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the root element. |
2194
+ | `icon?` | `React.ReactNode` | | Illustration or icon above the title. |
2195
+ | `title` | `React.ReactNode` | | What is missing, e.g. "No vehicles yet". |
2196
+ | `description?` | `React.ReactNode` | | Explains why it is empty or what to do next. |
2197
+ | `actions?` | `React.ReactNode` | | Buttons for the next step. |
2198
+ | `align?` | `'center' \| 'start'` | `'center'` | Center content (default) or align to start. |
2199
+
2200
+ Also accepts all props of: `Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>`.
2201
+
2202
+ ## Meter
2203
+
2204
+ component · Feedback & data display
2205
+
2206
+ A measurement within a known range (quota, capacity, score).
2207
+
2208
+ ```tsx
2209
+ import { Meter } from '@optimum-intelligence/opti-ui';
2210
+ ```
2211
+
2212
+ | Prop | Type | Default | Description |
2213
+ | --- | --- | --- | --- |
2214
+ | `label?` | `React.ReactNode` | | Label above the bar. |
2215
+ | `showValue?` | `boolean` | `true` | Show the formatted value next to the label. Defaults to `true`. |
2216
+ | `tone?` | `'accent' \| 'primary' \| 'success' \| 'warning' \| 'danger'` | `'accent'` | Bar color. |
2217
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Bar thickness. |
2218
+
2219
+ Also accepts all props of: `BaseMeter.Root.Props`.
2220
+
2221
+ ## Progress
2222
+
2223
+ component · Feedback & data display
2224
+
2225
+ Task completion. Pass `value={null}` for an indeterminate bar.
2226
+
2227
+ ```tsx
2228
+ import { Progress } from '@optimum-intelligence/opti-ui';
2229
+ ```
2230
+
2231
+ | Prop | Type | Default | Description |
2232
+ | --- | --- | --- | --- |
2233
+ | `label?` | `React.ReactNode` | | Label above the bar. |
2234
+ | `showValue?` | `boolean` | | Show the formatted value next to the label. |
2235
+ | `tone?` | `'accent' \| 'primary' \| 'success' \| 'warning' \| 'danger'` | `'accent'` | Bar color. |
2236
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Bar thickness. |
2237
+
2238
+ Also accepts all props of: `BaseProgress.Root.Props`.
2239
+
2240
+ ## Skeleton
2241
+
2242
+ component · Feedback & data display
2243
+
2244
+ Pulsing placeholder for content that is still loading.
2245
+
2246
+ ```tsx
2247
+ import { Skeleton } from '@optimum-intelligence/opti-ui';
2248
+ ```
2249
+
2250
+ | Prop | Type | Default | Description |
2251
+ | --- | --- | --- | --- |
2252
+ | `ref?` | `React.Ref<HTMLSpanElement>` | | Ref to the placeholder element. |
2253
+ | `width?` | `number \| string` | | Width in px (number) or any CSS length. |
2254
+ | `height?` | `number \| string` | | Height in px (number) or any CSS length. |
2255
+ | `circle?` | `boolean` | | Render as a circle (uses `width` for both dimensions). |
2256
+ | `radius?` | `number \| string` | | Corner radius in px (number) or any CSS length. |
2257
+
2258
+ Also accepts all props of: `React.HTMLAttributes<HTMLSpanElement>`.
2259
+
2260
+ ## SkeletonText
2261
+
2262
+ component · Feedback & data display
2263
+
2264
+ Skeleton placeholder shaped like a paragraph; the last line is shorter.
2265
+
2266
+ ```tsx
2267
+ import { SkeletonText } from '@optimum-intelligence/opti-ui';
2268
+ ```
2269
+
2270
+ | Prop | Type | Default | Description |
2271
+ | --- | --- | --- | --- |
2272
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the wrapper element. |
2273
+ | `lines?` | `number` | `3` | Number of placeholder lines. |
2274
+
2275
+ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
2276
+
2277
+ ## Spinner
2278
+
2279
+ component · Feedback & data display
2280
+
2281
+ Indeterminate loading indicator that follows `currentColor`.
2282
+
2283
+ ```tsx
2284
+ import { Spinner } from '@optimum-intelligence/opti-ui';
2285
+ ```
2286
+
2287
+ | Prop | Type | Default | Description |
2288
+ | --- | --- | --- | --- |
2289
+ | `ref?` | `React.Ref<HTMLSpanElement>` | | Ref to the spinner element. |
2290
+ | `size?` | `number \| string` | | Diameter, e.g. `1rem` or `24`. Defaults to `1.25em`. |
2291
+ | `label?` | `string \| null` | `'Loading'` | Accessible label. Set to `null` when a parent already announces loading. |
2292
+
2293
+ Also accepts all props of: `React.HTMLAttributes<HTMLSpanElement>`.
2294
+
2295
+ ## Table
2296
+
2297
+ component · Feedback & data display
2298
+
2299
+ Styled HTML table inside a horizontally scrolling wrapper. Compose with `TableHeader`, `TableBody`,
2300
+ `TableFooter`, `TableRow`, `TableHead`, `TableCell` and `TableCaption`. For search, filters, sorting
2301
+ and pagination use `DataTable` instead.
2302
+
2303
+ ```tsx
2304
+ import { Table } from '@optimum-intelligence/opti-ui';
2305
+ ```
2306
+
2307
+ ```tsx
2308
+ <Table striped>
2309
+ <TableHeader>
2310
+ <TableRow><TableHead>Site</TableHead><TableHead align="end">kWh</TableHead></TableRow>
2311
+ </TableHeader>
2312
+ <TableBody>
2313
+ <TableRow><TableCell>Győr</TableCell><TableCell numeric>1,204</TableCell></TableRow>
2314
+ </TableBody>
2315
+ </Table>
2316
+ ```
2317
+
2318
+ | Prop | Type | Default | Description |
2319
+ | --- | --- | --- | --- |
2320
+ | `ref?` | `React.Ref<HTMLTableElement>` | | Ref to the `<table>`. |
2321
+ | `density?` | `'compact' \| 'normal' \| 'comfortable'` | `'normal'` | Row height. |
2322
+ | `striped?` | `boolean` | | Alternating row background. |
2323
+ | `hoverable?` | `boolean` | `true` | Highlight rows on hover. |
2324
+ | `stickyHeader?` | `boolean` | | Keep the header visible while the wrapper scrolls (set a max height on it). |
2325
+ | `wrapperProps?` | `React.HTMLAttributes<HTMLDivElement>` | | Props for the horizontally scrolling wrapper. |
2326
+
2327
+ Also accepts all props of: `React.TableHTMLAttributes<HTMLTableElement>`.
2328
+
2329
+ ## TableBody
2330
+
2331
+ compound · Feedback & data display
2332
+
2333
+ Styled `<tbody>` (`.oui-table__body`). Accepts `className`, `style`, the `render` prop and all `<tbody>` attributes.
2334
+
2335
+ ```tsx
2336
+ import { TableBody } from '@optimum-intelligence/opti-ui';
2337
+ ```
2338
+
2339
+ ### TableBody.displayName
2340
+
2341
+ ## TableCaption
2342
+
2343
+ compound · Feedback & data display
2344
+
2345
+ Styled `<caption>` (`.oui-table__caption`). Accepts `className`, `style`, the `render` prop and all `<caption>` attributes.
2346
+
2347
+ ```tsx
2348
+ import { TableCaption } from '@optimum-intelligence/opti-ui';
2349
+ ```
2350
+
2351
+ ### TableCaption.displayName
2352
+
2353
+ ## TableCell
2354
+
2355
+ component · Feedback & data display
2356
+
2357
+ Body cell (`<td>`). `numeric` right-aligns and uses tabular figures.
2358
+
2359
+ ```tsx
2360
+ import { TableCell } from '@optimum-intelligence/opti-ui';
2361
+ ```
2362
+
2363
+ | Prop | Type | Default | Description |
2364
+ | --- | --- | --- | --- |
2365
+ | `ref?` | `React.Ref<HTMLTableCellElement>` | | Ref to the `<td>`. |
2366
+ | `align?` | `Align` | | Horizontal alignment. Defaults to `end` when `numeric`, else `start`. |
2367
+ | `numeric?` | `boolean` | | Tabular figures for numeric columns. |
2368
+
2369
+ Also accepts all props of: `Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'>`.
2370
+
2371
+ ## TableFooter
2372
+
2373
+ compound · Feedback & data display
2374
+
2375
+ Styled `<tfoot>` (`.oui-table__footer`). Accepts `className`, `style`, the `render` prop and all `<tfoot>` attributes.
2376
+
2377
+ ```tsx
2378
+ import { TableFooter } from '@optimum-intelligence/opti-ui';
2379
+ ```
2380
+
2381
+ ### TableFooter.displayName
2382
+
2383
+ ## TableHead
2384
+
2385
+ component · Feedback & data display
2386
+
2387
+ Column header cell (`<th>`), optionally a sort button.
2388
+
2389
+ ```tsx
2390
+ import { TableHead } from '@optimum-intelligence/opti-ui';
2391
+ ```
2392
+
2393
+ | Prop | Type | Default | Description |
2394
+ | --- | --- | --- | --- |
2395
+ | `ref?` | `React.Ref<HTMLTableCellElement>` | | Ref to the `<th>`. |
2396
+ | `align?` | `Align` | `'start'` | Horizontal alignment of the header content. |
2397
+ | `sort?` | `SortDirection` | | Current sort of this column. Passing it (even `false`) makes the header sortable. |
2398
+ | `onSort?` | `() => void` | | Called when the sortable header is clicked. |
2399
+
2400
+ Also accepts all props of: `Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'>`.
2401
+
2402
+ ## TableHeader
2403
+
2404
+ compound · Feedback & data display
2405
+
2406
+ Styled `<thead>` (`.oui-table__header`). Accepts `className`, `style`, the `render` prop and all `<thead>` attributes.
2407
+
2408
+ ```tsx
2409
+ import { TableHeader } from '@optimum-intelligence/opti-ui';
2410
+ ```
2411
+
2412
+ ### TableHeader.displayName
2413
+
2414
+ ## TableRow
2415
+
2416
+ compound · Feedback & data display
2417
+
2418
+ Styled `<tr>` (`.oui-table__row`). Accepts `className`, `style`, the `render` prop and all `<tr>` attributes.
2419
+
2420
+ ```tsx
2421
+ import { TableRow } from '@optimum-intelligence/opti-ui';
2422
+ ```
2423
+
2424
+ ### TableRow.displayName
2425
+
2426
+ ## Tag
2427
+
2428
+ component · Feedback & data display
2429
+
2430
+ Label for a value the user can take away again: an active filter, a recipient, a keyword.
2431
+
2432
+ ```tsx
2433
+ import { Tag } from '@optimum-intelligence/opti-ui';
2434
+ ```
2435
+
2436
+ | Prop | Type | Default | Description |
2437
+ | --- | --- | --- | --- |
2438
+ | `tone?` | `'neutral' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Semantic color. |
2439
+ | `size?` | `'sm' \| 'md'` | `'md'` | Tag height. |
2440
+ | `icon?` | `React.ReactNode` | | Leading icon. |
2441
+ | `onRemove?` | `() => void` | | Adds the remove button. |
2442
+ | `removeLabel?` | `string` | | Accessible name of the remove button. Defaults to "Remove <text>". |
2443
+ | `disabled?` | `boolean` | `false` | Dims the tag and disables its remove button. |
2444
+
2445
+ Also accepts all props of: `useRender.ComponentProps<'span', TagState>`.
2446
+
2447
+ ## useDataTable
2448
+
2449
+ hook · Feedback & data display
2450
+
2451
+ State and row processing of a `DataTable`, without any markup. Pass the
2452
+ result to `DataTable.Root` to lay the parts out yourself, or read `rows`,
2453
+ `filterValues` and the rest to drive something else (an export, a chart).
2454
+
2455
+ ```tsx
2456
+ import { useDataTable } from '@optimum-intelligence/opti-ui';
2457
+ ```
2458
+
2459
+ | Prop | Type | Default | Description |
2460
+ | --- | --- | --- | --- |
2461
+ | `data` | `T[]` | | All rows, or in server mode the rows of the current page. |
2462
+ | `columns` | `DataTableColumn<T>[]` | | Column definitions: id, header, cell renderer, sorting, filter and layout options. |
2463
+ | `mode?` | `'client' \| 'server'` | `'client'` | `server` renders `data` as it is: search, filtering, sorting and pagination are left to the API, driven by the `search` / `filterValues` / `sort` / `page` callbacks. |
2464
+ | `total?` | `number` | | Server mode: number of rows across all pages. |
2465
+ | `loading?` | `boolean` | `false` | Shows placeholder rows when there is no data yet, and dims the rows during a refetch. |
2466
+ | `error?` | `React.ReactNode` | | Error message shown in place of the rows. |
2467
+ | `onRetry?` | `() => void` | | Adds a retry button to the error message. |
2468
+ | `getRowId?` | `(row: T, index: number) => string` | | Stable id per row, needed for selection and editing. Defaults to `row.id`, then the index. |
2469
+ | `locale?` | `string` | | Language whose alphabet orders sorted text and filter options (`"hu"`). Defaults to the browser's. |
2470
+ | `searchable?` | `boolean` | `true` | Show the search box (default `true`). |
2471
+ | `search?` | `string` | | Search text (controlled). |
2472
+ | `defaultSearch?` | `string` | `''` | Initial search text when uncontrolled. |
2473
+ | `onSearchChange?` | `(search: string) => void` | | Called when the search text changes (after `searchDebounce`). |
2474
+ | `searchDebounce?` | `number` | | Milliseconds of typing pause before the search applies. Defaults to 300 in server mode, 0 otherwise. |
2475
+ | `filter?` | `(row: T, search: string) => boolean` | | Replaces the built-in search, which matches every term against the searchable columns. |
2476
+ | `filters?` | `DataTableFilter<T>[]` | | Toolbar filters that are not tied to a column. Columns add theirs with `filter`. |
2477
+ | `filterValues?` | `DataTableFilterValues` | | Filter values by filter id (controlled). |
2478
+ | `defaultFilterValues?` | `DataTableFilterValues` | | Initial filter values when uncontrolled. |
2479
+ | `onFilterValuesChange?` | `(values: DataTableFilterValues) => void` | | Called with all filter values when one changes or they are cleared. |
2480
+ | `sort?` | `DataTableSort \| null` | | Column sort (controlled); `null` for none. |
2481
+ | `defaultSort?` | `DataTableSort \| null` | `null` | Initial sort when uncontrolled. |
2482
+ | `onSortChange?` | `(sort: DataTableSort \| null) => void` | | Called when the user sorts a column. |
2483
+ | `paginated?` | `boolean` | `true` | Paginate rows (default `true`). |
2484
+ | `page?` | `number` | | Current page, starting at 1 (controlled). |
2485
+ | `onPageChange?` | `(page: number) => void` | | Called when the page changes. |
2486
+ | `pageSize?` | `number` | | Rows per page (controlled). |
2487
+ | `defaultPageSize?` | `number` | `10` | Initial rows per page when uncontrolled. |
2488
+ | `onPageSizeChange?` | `(pageSize: number) => void` | | Called when the rows per page change. |
2489
+ | `selection?` | `string[]` | | Selected row ids. Passing `onSelectionChange` adds the checkbox column. Select-all covers every filtered row, or in server mode the current page. |
2490
+ | `onSelectionChange?` | `(selection: string[]) => void` | | Called with the selected row ids. |
2491
+ | `onRowClick?` | `(row: T) => void` | | Makes rows clickable and keyboard-activatable (Enter). |
2492
+ | `rowLabel?` | `(row: T) => string` | | Accessible name of a row, used by row selection and clickable rows. |
2493
+ | `rowActions?` | `(row: T) => DataTableRowAction[] \| React.ReactNode` | | Trailing cell of each row: icon buttons, or any content (a menu, a link). |
2494
+ | `rowTone?` | `(row: T) => DataTableRowTone \| null \| undefined` | | Tints a row to flag its state. |
2495
+ | `rowProps?` | `(row: T) => React.HTMLAttributes<HTMLTableRowElement> & Record<`data-${string}`, unknown>` | | Extra props for a row's `<tr>` (`className`, `style`, `data-*`). |
2496
+ | `onRowSave?` | `(row: T, original: T) => void \| Promise<void>` | | Adds an edit action to each row; columns with `edit` turn into inputs. Called with the edited row. Return a promise to keep the row open while it saves; a rejected one leaves it open for another try. |
2497
+ | `onRowDelete?` | `(row: T) => void` | | Adds a delete action, shown while a row is edited, or on every row without `onRowSave`. |
2498
+ | `labels?` | `Partial<DataTableLabels>` | | Override texts for localisation. |
2499
+
2500
+ ## useDataTableContext
2501
+
2502
+ hook · Feedback & data display
2503
+
2504
+ The table of the surrounding `DataTable.Root`, for building custom parts.
2505
+
2506
+ ```tsx
2507
+ import { useDataTableContext } from '@optimum-intelligence/opti-ui';
2508
+ ```
2509
+
2510
+ Signature: `useDataTableContext()`
2511
+
2512
+ # Icons & utilities
2513
+
2514
+ ## cx
2515
+
2516
+ function · Icons & utilities
2517
+
2518
+ Joins truthy class names.
2519
+
2520
+ ```tsx
2521
+ import { cx } from '@optimum-intelligence/opti-ui';
2522
+ ```
2523
+
2524
+ Signature: `cx(...classes: ClassValue[])`
2525
+
2526
+ ## Icons
2527
+
2528
+ icons · Icons & utilities
2529
+
2530
+ Small built-in stroke icon set. Every icon renders an `<svg>` that follows the font size and `currentColor`.
2531
+
2532
+ ```tsx
2533
+ import { ArrowDownIcon } from '@optimum-intelligence/opti-ui';
2534
+ ```
2535
+
2536
+ Icons: `ArrowDownIcon`, `ArrowUpIcon`, `CalendarIcon`, `CheckIcon`, `ChevronDownIcon`, `ChevronLeftIcon`, `ChevronRightIcon`, `ChevronUpIcon`, `ChevronsLeftIcon`, `ChevronsRightIcon`, `ChevronsUpDownIcon`, `CircleCheckIcon`, `CircleIcon`, `CircleXIcon`, `ClockIcon`, `ExternalLinkIcon`, `EyeIcon`, `EyeOffIcon`, `FileIcon`, `InfoIcon`, `MenuIcon`, `MinusIcon`, `MoreHorizontalIcon`, `PencilIcon`, `PlusIcon`, `SearchIcon`, `TrashIcon`, `TrendingDownIcon`, `TrendingUpIcon`, `TriangleAlertIcon`, `UploadIcon`, `XIcon`
2537
+
2538
+ | Prop | Type | Default | Description |
2539
+ | --- | --- | --- | --- |
2540
+ | `size?` | `number \| string` | | Width and height. Defaults to `1em` so icons follow the font size. |
2541
+
2542
+ ## matchesQuery
2543
+
2544
+ function · Icons & utilities
2545
+
2546
+ True when every whitespace-separated term of `query` occurs in `text`. An empty query matches.
2547
+
2548
+ ```tsx
2549
+ import { matchesQuery } from '@optimum-intelligence/opti-ui';
2550
+ ```
2551
+
2552
+ Signature: `matchesQuery(text: unknown, query: string)`
2553
+
2554
+ ## normalizeText
2555
+
2556
+ function · Icons & utilities
2557
+
2558
+ Lower-cases and strips diacritics, so "gyor" matches "Győr".
2559
+
2560
+ ```tsx
2561
+ import { normalizeText } from '@optimum-intelligence/opti-ui';
2562
+ ```
2563
+
2564
+ Signature: `normalizeText(value: unknown)`
2565
+
2566
+ ## usePortalContainer
2567
+
2568
+ hook · Icons & utilities
2569
+
2570
+ Returns the element popups should portal into: the nearest `ThemeProvider`, or
2571
+ `undefined` for the document body. Pass it as `container` when building a custom portalled popup.
2572
+
2573
+ ```tsx
2574
+ import { usePortalContainer } from '@optimum-intelligence/opti-ui';
2575
+ ```
2576
+
2577
+ Signature: `usePortalContainer()`
2578
+
2579
+ ## withClass
2580
+
2581
+ function · Icons & utilities
2582
+
2583
+ Prepends a library class to a Base UI `className` prop, preserving the
2584
+ function form so consumers can still derive classes from component state.
2585
+
2586
+ ```tsx
2587
+ import { withClass } from '@optimum-intelligence/opti-ui';
2588
+ ```
2589
+
2590
+ Signature: `withClass(base: string, className: StateClassName<State>,)`