@optimum-intelligence/opti-ui 0.4.0 → 0.5.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.
- package/README.md +9 -7
- package/dist/components/app-shell/AppShell.d.ts +75 -6
- package/dist/components/app-shell/AppShell.js +670 -185
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/badge/Badge.d.ts +2 -4
- package/dist/components/badge/Badge.js +12 -29
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/calendar/Calendar.d.ts +19 -8
- package/dist/components/calendar/Calendar.js +285 -212
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/calendar/DateConfig.d.ts +37 -0
- package/dist/components/calendar/DateConfig.js +75 -0
- package/dist/components/calendar/DateConfig.js.map +1 -0
- package/dist/components/calendar/date-utils.d.ts +41 -6
- package/dist/components/calendar/date-utils.js +119 -20
- package/dist/components/calendar/date-utils.js.map +1 -1
- package/dist/components/data-table/DataTableContent.js +3 -3
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +33 -10
- package/dist/components/date-picker/DatePicker.js +315 -279
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/DateRangePicker.d.ts +11 -4
- package/dist/components/date-picker/DateRangePicker.js +240 -206
- package/dist/components/date-picker/DateRangePicker.js.map +1 -1
- package/dist/components/date-picker/PickerField.js +1 -1
- package/dist/components/date-picker/PickerField.js.map +1 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +2 -2
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components.json +2023 -1864
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -3
- package/dist/llms-full.txt +869 -752
- package/dist/llms.txt +37 -35
- package/dist/opti-ui.css +171 -81
- package/package.json +1 -1
package/dist/llms-full.txt
CHANGED
|
@@ -107,1365 +107,1483 @@ import { themeToStyle } from '@optimum-intelligence/opti-ui';
|
|
|
107
107
|
|
|
108
108
|
Signature: `themeToStyle(theme: Theme \| undefined)`
|
|
109
109
|
|
|
110
|
-
#
|
|
110
|
+
# Forms
|
|
111
111
|
|
|
112
|
-
##
|
|
112
|
+
## Calendar
|
|
113
113
|
|
|
114
|
-
component ·
|
|
114
|
+
component · Forms
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
Month grid for picking one day. Keyboard: arrows move by day / week,
|
|
117
|
+
Home / End jump within the week, PageUp / PageDown change month (with Shift: year).
|
|
118
|
+
The month and year in the title open a list to jump straight to another one.
|
|
119
|
+
With `granularity="month"` or `"year"` it shows a month or year grid instead.
|
|
119
120
|
|
|
120
121
|
```tsx
|
|
121
|
-
import {
|
|
122
|
+
import { Calendar } from '@optimum-intelligence/opti-ui';
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<Calendar value={month} onValueChange={setMonth} granularity="month" />
|
|
122
127
|
```
|
|
123
128
|
|
|
124
129
|
| Prop | Type | Default | Description |
|
|
125
130
|
| --- | --- | --- | --- |
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
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. |
|
|
131
|
+
| `value?` | `string \| null` | | Selected day as an ISO date (`"2026-03-09"`). With a month or year `granularity`, the day it falls in is enough. |
|
|
132
|
+
| `defaultValue?` | `string \| null` | `null` | Initially selected day (ISO date) when uncontrolled. |
|
|
133
|
+
| `onValueChange?` | `(value: string) => void` | | Called with the picked day as an ISO date: the 1st of the month, or 1 January, for a month or year `granularity`. |
|
|
132
134
|
|
|
133
|
-
Also accepts all props of: `
|
|
135
|
+
Also accepts all props of: `CalendarOptions`.
|
|
134
136
|
|
|
135
|
-
##
|
|
137
|
+
## Checkbox
|
|
136
138
|
|
|
137
|
-
component ·
|
|
139
|
+
component · Forms
|
|
138
140
|
|
|
139
|
-
|
|
140
|
-
`CardActions`), `CardContent` and `CardFooter`.
|
|
141
|
+
Checkbox with optional `label` and `description`. Supports `indeterminate`.
|
|
141
142
|
|
|
142
143
|
```tsx
|
|
143
|
-
import {
|
|
144
|
+
import { Checkbox } from '@optimum-intelligence/opti-ui';
|
|
144
145
|
```
|
|
145
146
|
|
|
147
|
+
|
|
148
|
+
Also accepts all props of: `BaseCheckbox.Root.Props`, `ChoiceLabelProps`.
|
|
149
|
+
|
|
150
|
+
## CheckboxGroup
|
|
151
|
+
|
|
152
|
+
component · Forms
|
|
153
|
+
|
|
154
|
+
Manages the checked values of several `Checkbox` children (`value` / `onValueChange`).
|
|
155
|
+
|
|
146
156
|
```tsx
|
|
147
|
-
|
|
148
|
-
<CardHeader>
|
|
149
|
-
<CardTitle>Monthly energy</CardTitle>
|
|
150
|
-
<CardDescription>Last 30 days</CardDescription>
|
|
151
|
-
</CardHeader>
|
|
152
|
-
<CardContent>…</CardContent>
|
|
153
|
-
</Card>
|
|
157
|
+
import { CheckboxGroup } from '@optimum-intelligence/opti-ui';
|
|
154
158
|
```
|
|
155
159
|
|
|
156
160
|
| Prop | Type | Default | Description |
|
|
157
161
|
| --- | --- | --- | --- |
|
|
158
|
-
| `
|
|
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. |
|
|
162
|
+
| `orientation?` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction of the checkboxes. |
|
|
161
163
|
|
|
162
|
-
Also accepts all props of: `
|
|
164
|
+
Also accepts all props of: `BaseCheckboxGroup.Props`.
|
|
163
165
|
|
|
164
|
-
##
|
|
166
|
+
## Combobox
|
|
165
167
|
|
|
166
|
-
compound ·
|
|
168
|
+
compound · Forms
|
|
167
169
|
|
|
168
|
-
|
|
170
|
+
Searchable select. `<Combobox items={…} />` covers single and `multiple`
|
|
171
|
+
(chips) selection; compose the parts for anything custom.
|
|
169
172
|
|
|
170
173
|
```tsx
|
|
171
|
-
import {
|
|
174
|
+
import { Combobox } from '@optimum-intelligence/opti-ui';
|
|
172
175
|
```
|
|
173
176
|
|
|
174
|
-
|
|
177
|
+
| Prop | Type | Default | Description |
|
|
178
|
+
| --- | --- | --- | --- |
|
|
179
|
+
| `items` | `ComboboxOption[]` | | Options to choose from. |
|
|
180
|
+
| `label?` | `React.ReactNode` | | Visible field label. |
|
|
181
|
+
| `description?` | `React.ReactNode` | | Help text under the input. |
|
|
182
|
+
| `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
|
|
183
|
+
| `placeholder?` | `string` | | Placeholder shown while nothing is typed or selected. |
|
|
184
|
+
| `emptyText?` | `React.ReactNode` | `'No results found.'` | Shown when the filter matches nothing. |
|
|
185
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
186
|
+
| `hideClear?` | `boolean` | | Hide the clear button. |
|
|
187
|
+
| `inputProps?` | `BaseCombobox.Input.Props` | | Props for the text input. |
|
|
175
188
|
|
|
176
|
-
|
|
189
|
+
Also accepts all props of: `RootProps`.
|
|
177
190
|
|
|
178
|
-
|
|
191
|
+
### Combobox.Root
|
|
179
192
|
|
|
180
|
-
|
|
193
|
+
Base UI `Combobox.Root` re-exported unchanged. See https://base-ui.com/react/components/combobox.
|
|
181
194
|
|
|
182
|
-
|
|
183
|
-
import { CardContent } from '@optimum-intelligence/opti-ui';
|
|
184
|
-
```
|
|
195
|
+
### Combobox.InputGroup
|
|
185
196
|
|
|
186
|
-
|
|
197
|
+
| Prop | Type | Default | Description |
|
|
198
|
+
| --- | --- | --- | --- |
|
|
199
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
187
200
|
|
|
188
|
-
|
|
201
|
+
Also accepts all props of: `BaseCombobox.InputGroup.Props`.
|
|
189
202
|
|
|
190
|
-
|
|
203
|
+
### Combobox.Input
|
|
191
204
|
|
|
192
|
-
|
|
205
|
+
### Combobox.Trigger
|
|
193
206
|
|
|
194
|
-
|
|
195
|
-
import { CardDescription } from '@optimum-intelligence/opti-ui';
|
|
196
|
-
```
|
|
207
|
+
### Combobox.Clear
|
|
197
208
|
|
|
198
|
-
###
|
|
209
|
+
### Combobox.Value
|
|
199
210
|
|
|
200
|
-
|
|
211
|
+
Base UI `Combobox.Value` re-exported unchanged. See https://base-ui.com/react/components/combobox.
|
|
201
212
|
|
|
202
|
-
|
|
213
|
+
### Combobox.Chips
|
|
203
214
|
|
|
204
|
-
|
|
215
|
+
### Combobox.Chip
|
|
205
216
|
|
|
206
|
-
|
|
207
|
-
import { CardFooter } from '@optimum-intelligence/opti-ui';
|
|
208
|
-
```
|
|
217
|
+
### Combobox.Content
|
|
209
218
|
|
|
210
|
-
|
|
219
|
+
| Prop | Type | Default | Description |
|
|
220
|
+
| --- | --- | --- | --- |
|
|
221
|
+
| `side?` | `BaseCombobox.Positioner.Props['side']` | | Which side of the input the list opens on. |
|
|
222
|
+
| `align?` | `BaseCombobox.Positioner.Props['align']` | | Alignment along that side. |
|
|
223
|
+
| `sideOffset?` | `BaseCombobox.Positioner.Props['sideOffset']` | `6` | Distance from the input in px. |
|
|
224
|
+
| `positionerProps?` | `BaseCombobox.Positioner.Props` | | Props for the positioner element that places the popup. |
|
|
211
225
|
|
|
212
|
-
|
|
226
|
+
Also accepts all props of: `BaseCombobox.Popup.Props`.
|
|
213
227
|
|
|
214
|
-
|
|
228
|
+
### Combobox.List
|
|
215
229
|
|
|
216
|
-
|
|
230
|
+
### Combobox.Item
|
|
217
231
|
|
|
218
|
-
|
|
219
|
-
import { CardHeader } from '@optimum-intelligence/opti-ui';
|
|
220
|
-
```
|
|
232
|
+
### Combobox.Empty
|
|
221
233
|
|
|
222
|
-
###
|
|
234
|
+
### Combobox.Group
|
|
223
235
|
|
|
224
|
-
|
|
236
|
+
Base UI `Combobox.Group` re-exported unchanged. See https://base-ui.com/react/components/combobox.
|
|
225
237
|
|
|
226
|
-
|
|
238
|
+
### Combobox.GroupLabel
|
|
227
239
|
|
|
228
|
-
|
|
240
|
+
### Combobox.Collection
|
|
229
241
|
|
|
230
|
-
|
|
231
|
-
import { CardTitle } from '@optimum-intelligence/opti-ui';
|
|
232
|
-
```
|
|
242
|
+
Base UI `Combobox.Collection` re-exported unchanged. See https://base-ui.com/react/components/combobox.
|
|
233
243
|
|
|
234
|
-
###
|
|
244
|
+
### Combobox.useFilter
|
|
235
245
|
|
|
236
|
-
|
|
246
|
+
Base UI `Combobox.useFilter` re-exported unchanged. See https://base-ui.com/react/components/combobox.
|
|
237
247
|
|
|
238
|
-
|
|
248
|
+
## DateConfigProvider
|
|
239
249
|
|
|
240
|
-
|
|
250
|
+
component · Forms
|
|
251
|
+
|
|
252
|
+
Sets default locale, time zone, week start and display formats for every
|
|
253
|
+
date picker and calendar inside it. Props on a component still win.
|
|
254
|
+
Nested providers override only the settings they pass.
|
|
241
255
|
|
|
242
256
|
```tsx
|
|
243
|
-
import {
|
|
257
|
+
import { DateConfigProvider } from '@optimum-intelligence/opti-ui';
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
```tsx
|
|
261
|
+
<DateConfigProvider timeZone="Europe/Budapest" locale="hu-HU" formats={{ day: 'YYYY.MM.DD' }}>
|
|
262
|
+
<App />
|
|
263
|
+
</DateConfigProvider>
|
|
244
264
|
```
|
|
245
265
|
|
|
246
266
|
| Prop | Type | Default | Description |
|
|
247
267
|
| --- | --- | --- | --- |
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
268
|
+
| `locale?` | `string` | | BCP 47 locale for month and weekday names. |
|
|
269
|
+
| `timeZone?` | `string` | | IANA zone (`"Europe/Budapest"`) that date-times are shown and edited in. Defaults to the browser's. |
|
|
270
|
+
| `weekStartsOn?` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | | First calendar column: 0 = Sunday, 1 = Monday. |
|
|
271
|
+
| `formats?` | `Partial<Record<DateGranularity, string>>` | | Display patterns per granularity, e.g. `{ day: 'DD.MM.YYYY' }`. Tokens as in `formatDate`. |
|
|
272
|
+
| `children?` | `React.ReactNode` | | The subtree that uses these settings. |
|
|
251
273
|
|
|
252
|
-
|
|
274
|
+
## DatePicker
|
|
253
275
|
|
|
254
|
-
|
|
276
|
+
component · Forms
|
|
255
277
|
|
|
256
|
-
|
|
278
|
+
Date field with a calendar popover. Day values are ISO dates (`"2026-03-09"`),
|
|
279
|
+
the same format as `<input type="date">`. `granularity="month"` or `"year"` opens a
|
|
280
|
+
month or year grid and stores the period's first day (`"2026-03-01"`); a time
|
|
281
|
+
granularity behaves like `DateTimePicker`.
|
|
257
282
|
|
|
258
|
-
|
|
259
|
-
|
|
283
|
+
```tsx
|
|
284
|
+
import { DatePicker } from '@optimum-intelligence/opti-ui';
|
|
285
|
+
```
|
|
260
286
|
|
|
261
287
|
```tsx
|
|
262
|
-
|
|
288
|
+
<DatePicker label="Delivery date" value={date} onValueChange={setDate} />
|
|
289
|
+
<DatePicker label="Billing month" granularity="month" format="MMMM YYYY" />
|
|
263
290
|
```
|
|
264
291
|
|
|
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
292
|
|
|
276
|
-
Also accepts all props of: `
|
|
293
|
+
Also accepts all props of: `PickerProps`.
|
|
277
294
|
|
|
278
|
-
##
|
|
295
|
+
## DateRangePicker
|
|
279
296
|
|
|
280
|
-
component ·
|
|
297
|
+
component · Forms
|
|
281
298
|
|
|
282
|
-
|
|
299
|
+
Date range field with a calendar popover and optional presets. Values are
|
|
300
|
+
`{ start, end }` ISO dates (`"2026-03-09"`), both inclusive. With
|
|
301
|
+
`granularity="month"` or `"year"` it picks whole months or years, and each end
|
|
302
|
+
is the first day of its period.
|
|
283
303
|
|
|
284
304
|
```tsx
|
|
285
|
-
import {
|
|
305
|
+
import { DateRangePicker } from '@optimum-intelligence/opti-ui';
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
<DateRangePicker label="Period" value={period} onValueChange={setPeriod} presets={presets} />
|
|
286
310
|
```
|
|
287
311
|
|
|
288
312
|
| Prop | Type | Default | Description |
|
|
289
313
|
| --- | --- | --- | --- |
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
314
|
+
| `ref?` | `React.Ref<HTMLButtonElement>` | | Ref to the trigger button. |
|
|
315
|
+
| `label?` | `React.ReactNode` | | Visible field label. |
|
|
316
|
+
| `description?` | `React.ReactNode` | | Help text under the field. |
|
|
317
|
+
| `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
|
|
318
|
+
| `required?` | `boolean` | | Marks the field required and adds the required indicator to the label. |
|
|
319
|
+
| `disabled?` | `boolean` | | Disables the field. |
|
|
320
|
+
| `placeholder?` | `React.ReactNode` | `'Select dates'` | Text shown while no date is selected. |
|
|
321
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
|
|
322
|
+
| `open?` | `boolean` | | Whether the calendar popover is open (controlled). |
|
|
323
|
+
| `defaultOpen?` | `boolean` | | Initial popover state when uncontrolled. |
|
|
324
|
+
| `onOpenChange?` | `(open: boolean) => void` | | Called when the popover opens or closes. |
|
|
325
|
+
| `id?` | `string` | | Id of the trigger button. Generated when omitted. |
|
|
326
|
+
| `className?` | `string` | | Class name for the trigger button. |
|
|
327
|
+
| `triggerProps?` | `Omit<React.ComponentProps<typeof BasePopover.Trigger>, 'children' \| 'disabled' \| 'id'>` | | Props for the trigger button (aria-*, data-*, onBlur…). |
|
|
328
|
+
| `contentProps?` | `Omit<PopoverContentProps, 'children'>` | | Props for the popover content. |
|
|
329
|
+
| `value?` | `DateRange \| null` | | Selected days as ISO dates; both ends are inclusive. |
|
|
330
|
+
| `defaultValue?` | `DateRange \| null` | `null` | Initially selected range when uncontrolled. |
|
|
331
|
+
| `onValueChange?` | `(value: DateRange \| null) => void` | | Called with the new range, or `null` when cleared. |
|
|
332
|
+
| `min?` | `string` | | Earliest allowed day. |
|
|
333
|
+
| `max?` | `string` | | Latest allowed day. |
|
|
334
|
+
| `presets?` | `DateRangePreset[]` | | Shortcuts listed beside the calendar ("Last 7 days", "This month"…). |
|
|
335
|
+
| `startName?` | `string` | | Submits the first day with a form under this name. |
|
|
336
|
+
| `endName?` | `string` | | Submits the last day with a form under this name. |
|
|
337
|
+
| `clearable?` | `boolean` | | Show the Clear action. Defaults to `true` unless `required`. |
|
|
338
|
+
| `format?` | `string` | | Display pattern for each end, e.g. `"DD.MM.YYYY"` (tokens as in `formatDate`). Defaults to `DateConfigProvider` formats, then an ISO-style pattern for the granularity. |
|
|
339
|
+
| `formatValue?` | `(value: DateRange) => React.ReactNode` | | Custom display text for the selected range. Wins over `format`. |
|
|
340
|
+
| `labels?` | `Partial<DateRangePickerLabels>` | | Override texts for localisation. |
|
|
293
341
|
|
|
294
|
-
Also accepts all props of: `
|
|
342
|
+
Also accepts all props of: `Pick<RangeCalendarProps, 'isDateDisabled' \| 'defaultMonth' \| 'locale' \| 'weekStartsOn' \| 'numberOfMonths' \| 'granularity'>`.
|
|
295
343
|
|
|
296
|
-
##
|
|
344
|
+
## DateTimePicker
|
|
297
345
|
|
|
298
|
-
|
|
346
|
+
component · Forms
|
|
299
347
|
|
|
300
|
-
|
|
348
|
+
Date and time field. Values are UTC instants (`"2026-03-09T13:30:00Z"`) shown and
|
|
349
|
+
edited in `timeZone` (the browser's by default) on a 24-hour clock, as
|
|
350
|
+
`2026-03-09 14:30`. Values without an offset (`"2026-03-09T14:30"`) are read as
|
|
351
|
+
wall-clock time in `timeZone`.
|
|
301
352
|
|
|
302
353
|
```tsx
|
|
303
|
-
import {
|
|
354
|
+
import { DateTimePicker } from '@optimum-intelligence/opti-ui';
|
|
304
355
|
```
|
|
305
356
|
|
|
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
357
|
```tsx
|
|
315
|
-
|
|
358
|
+
<DateTimePicker label="Departure" value={slot} onValueChange={setSlot} timeZone="Europe/Budapest" />
|
|
316
359
|
```
|
|
317
360
|
|
|
318
|
-
|
|
361
|
+
| Prop | Type | Default | Description |
|
|
362
|
+
| --- | --- | --- | --- |
|
|
363
|
+
| `step?` | `number` | | Spacing of the time options in seconds (60 = every minute, 900 = quarter hours, 1 = every second). |
|
|
364
|
+
| `defaultTime?` | `string` | | Time (`"09:00"`) used when a day is picked before any time is set. |
|
|
365
|
+
| `granularity?` | `'hour' \| 'minute' \| 'second'` | `'minute'` | Smallest unit shown and stored: `hour`, `minute` or `second`. When omitted, `second` if `step` is not a whole number of minutes, otherwise `minute`. |
|
|
319
366
|
|
|
320
|
-
|
|
367
|
+
Also accepts all props of: `PickerProps`.
|
|
321
368
|
|
|
322
|
-
|
|
369
|
+
## Dropzone
|
|
323
370
|
|
|
324
|
-
|
|
325
|
-
|
|
371
|
+
component · Forms
|
|
372
|
+
|
|
373
|
+
Drop target that also opens the file browser on click, Enter or Space.
|
|
326
374
|
|
|
327
375
|
```tsx
|
|
328
|
-
import {
|
|
376
|
+
import { Dropzone } from '@optimum-intelligence/opti-ui';
|
|
329
377
|
```
|
|
330
378
|
|
|
331
379
|
| Prop | Type | Default | Description |
|
|
332
380
|
| --- | --- | --- | --- |
|
|
333
|
-
| `
|
|
334
|
-
| `
|
|
335
|
-
| `
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
381
|
+
| `ref?` | `React.Ref<HTMLLabelElement>` | | Ref to the dropzone element. |
|
|
382
|
+
| `onFiles?` | `(files: File[]) => void` | | Called with the picked or dropped files that pass `accept` and `maxSize`. |
|
|
383
|
+
| `onReject?` | `(rejections: FileRejection[]) => void` | | Called with the files that were turned away, and why. |
|
|
384
|
+
| `accept?` | `string` | | Allowed types, as for `<input accept>`: `".pdf,image/*"`. |
|
|
385
|
+
| `multiple?` | `boolean` | | Allow choosing several files. |
|
|
386
|
+
| `maxSize?` | `number` | | Largest allowed file, in bytes. |
|
|
387
|
+
| `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. |
|
|
388
|
+
| `disabled?` | `boolean` | | Disables picking and dropping. |
|
|
389
|
+
| `invalid?` | `boolean` | | Shows the error styling. |
|
|
390
|
+
| `size?` | `'sm' \| 'md'` | `'md'` | `sm` is a single compact row. |
|
|
391
|
+
| `icon?` | `React.ReactNode` | | Icon shown before the title. Defaults to an upload icon. |
|
|
392
|
+
| `title?` | `React.ReactNode` | | Main line. Defaults to "Drop files here or click to browse". |
|
|
393
|
+
| `hint?` | `React.ReactNode` | | Secondary line, e.g. the allowed types and size. |
|
|
394
|
+
| `inputProps?` | `Omit<React.ComponentProps<'input'>, 'ref' \| 'type'>` | | Props for the file input (name, id, required, aria-*…). |
|
|
342
395
|
|
|
343
|
-
|
|
396
|
+
Also accepts all props of: `Omit<React.LabelHTMLAttributes<HTMLLabelElement>, 'title'>`.
|
|
397
|
+
|
|
398
|
+
## Field
|
|
399
|
+
|
|
400
|
+
compound · Forms
|
|
401
|
+
|
|
402
|
+
Field parts wire up labels, descriptions and validation for any control
|
|
403
|
+
inside (Input, Select, Checkbox, Switch, NumberField…).
|
|
344
404
|
|
|
345
405
|
```tsx
|
|
346
|
-
import {
|
|
406
|
+
import { Field } from '@optimum-intelligence/opti-ui';
|
|
347
407
|
```
|
|
348
408
|
|
|
349
|
-
###
|
|
409
|
+
### Field.Root
|
|
350
410
|
|
|
351
|
-
|
|
411
|
+
### Field.Label
|
|
352
412
|
|
|
353
|
-
|
|
413
|
+
| Prop | Type | Default | Description |
|
|
414
|
+
| --- | --- | --- | --- |
|
|
415
|
+
| `required?` | `boolean` | | Appends a required marker. |
|
|
354
416
|
|
|
355
|
-
|
|
417
|
+
Also accepts all props of: `BaseField.Label.Props`.
|
|
418
|
+
|
|
419
|
+
### Field.Description
|
|
420
|
+
|
|
421
|
+
### Field.Error
|
|
422
|
+
|
|
423
|
+
### Field.Item
|
|
424
|
+
|
|
425
|
+
### Field.Validity
|
|
426
|
+
|
|
427
|
+
Base UI `Field.Validity` re-exported unchanged. See https://base-ui.com/react/components/field.
|
|
428
|
+
|
|
429
|
+
## Fieldset
|
|
430
|
+
|
|
431
|
+
compound · Forms
|
|
432
|
+
|
|
433
|
+
Groups related fields under a legend.
|
|
356
434
|
|
|
357
435
|
```tsx
|
|
358
|
-
import {
|
|
436
|
+
import { Fieldset } from '@optimum-intelligence/opti-ui';
|
|
359
437
|
```
|
|
360
438
|
|
|
361
|
-
###
|
|
439
|
+
### Fieldset.Root
|
|
362
440
|
|
|
363
|
-
|
|
441
|
+
### Fieldset.Legend
|
|
364
442
|
|
|
365
|
-
|
|
443
|
+
## FileItem
|
|
366
444
|
|
|
367
|
-
|
|
445
|
+
component · Forms
|
|
446
|
+
|
|
447
|
+
One file in a list: name, size, upload progress or error, and a remove button.
|
|
368
448
|
|
|
369
449
|
```tsx
|
|
370
|
-
import {
|
|
450
|
+
import { FileItem } from '@optimum-intelligence/opti-ui';
|
|
371
451
|
```
|
|
372
452
|
|
|
373
453
|
| Prop | Type | Default | Description |
|
|
374
454
|
| --- | --- | --- | --- |
|
|
375
|
-
| `ref?` | `React.Ref<
|
|
376
|
-
| `
|
|
377
|
-
| `
|
|
378
|
-
| `
|
|
379
|
-
| `
|
|
380
|
-
| `
|
|
455
|
+
| `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the item element. |
|
|
456
|
+
| `name` | `string` | | File name. |
|
|
457
|
+
| `size?` | `number` | | Size in bytes. |
|
|
458
|
+
| `icon?` | `React.ReactNode` | | Icon before the name. Defaults to a file icon. |
|
|
459
|
+
| `status?` | `'idle' \| 'uploading' \| 'success' \| 'error'` | `'idle'` | Upload state; sets the progress bar and error styling. |
|
|
460
|
+
| `progress?` | `number \| null` | `null` | Upload progress from 0 to 100, shown while `uploading`. `null` is indeterminate. |
|
|
461
|
+
| `error?` | `React.ReactNode` | | Message shown in place of the size when `status` is `error`. |
|
|
462
|
+
| `onRemove?` | `() => void` | | Adds the remove button. |
|
|
463
|
+
| `removeLabel?` | `string` | | Accessible name of the remove button. Defaults to "Remove {name}". |
|
|
464
|
+
| `actions?` | `React.ReactNode` | | Extra controls before the remove button (download, preview…). |
|
|
465
|
+
| `locale?` | `string` | | BCP 47 locale for the size. |
|
|
381
466
|
|
|
382
|
-
Also accepts all props of: `
|
|
467
|
+
Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
383
468
|
|
|
384
|
-
##
|
|
469
|
+
## FileUpload
|
|
385
470
|
|
|
386
|
-
component ·
|
|
471
|
+
component · Forms
|
|
387
472
|
|
|
388
|
-
|
|
473
|
+
File field: a dropzone plus the list of chosen files. It only collects
|
|
474
|
+
`File` objects; upload them yourself and report progress through `fileState`.
|
|
389
475
|
|
|
390
476
|
```tsx
|
|
391
|
-
import {
|
|
477
|
+
import { FileUpload } from '@optimum-intelligence/opti-ui';
|
|
392
478
|
```
|
|
393
479
|
|
|
394
480
|
| Prop | Type | Default | Description |
|
|
395
481
|
| --- | --- | --- | --- |
|
|
396
|
-
| `
|
|
397
|
-
| `
|
|
482
|
+
| `ref?` | `React.Ref<HTMLLabelElement>` | | Ref to the dropzone element. |
|
|
483
|
+
| `value?` | `File[]` | | Chosen files (controlled). |
|
|
484
|
+
| `defaultValue?` | `File[]` | | Initially chosen files when uncontrolled. |
|
|
485
|
+
| `onValueChange?` | `(files: File[]) => void` | | Called with the full list of files after a file is added or removed. |
|
|
486
|
+
| `maxFiles?` | `number` | | Most files allowed when `multiple`. |
|
|
487
|
+
| `fileState?` | `(file: File) => Pick<FileItemProps, 'status' \| 'progress' \| 'error'> \| undefined` | | Upload state of a file, for showing progress and errors in the list. |
|
|
488
|
+
| `label?` | `React.ReactNode` | | Visible field label. |
|
|
489
|
+
| `description?` | `React.ReactNode` | | Help text under the dropzone. |
|
|
490
|
+
| `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
|
|
491
|
+
| `required?` | `boolean` | | Requires at least one file before the form submits. |
|
|
492
|
+
| `disabled?` | `boolean` | | Disables picking, dropping and removing files. |
|
|
493
|
+
| `name?` | `string` | | Submits the files with a form under this name. |
|
|
494
|
+
| `id?` | `string` | | Id of the file input. Generated when omitted. |
|
|
495
|
+
| `className?` | `string` | | Class name for the root element. |
|
|
496
|
+
| `locale?` | `string` | | BCP 47 locale for file sizes. |
|
|
497
|
+
| `labels?` | `Partial<FileUploadLabels>` | | Override texts for localisation. |
|
|
398
498
|
|
|
399
|
-
Also accepts all props of: `
|
|
499
|
+
Also accepts all props of: `Pick<DropzoneProps, 'accept' \| 'multiple' \| 'maxSize' \| 'onReject' \| 'size' \| 'icon' \| 'title' \| 'hint'>`.
|
|
400
500
|
|
|
401
|
-
##
|
|
501
|
+
## Form
|
|
402
502
|
|
|
403
|
-
component ·
|
|
503
|
+
component · Forms
|
|
404
504
|
|
|
405
|
-
|
|
505
|
+
Form with Base UI validation wiring and vertical field spacing.
|
|
406
506
|
|
|
407
507
|
```tsx
|
|
408
|
-
import {
|
|
508
|
+
import { Form } from '@optimum-intelligence/opti-ui';
|
|
409
509
|
```
|
|
410
510
|
|
|
411
511
|
|
|
412
|
-
Also accepts all props of: `
|
|
512
|
+
Also accepts all props of: `BaseForm.Props`.
|
|
413
513
|
|
|
414
|
-
##
|
|
514
|
+
## formatDate
|
|
415
515
|
|
|
416
|
-
|
|
516
|
+
function · Forms
|
|
417
517
|
|
|
418
|
-
|
|
518
|
+
Formats a date or date-time the way the date pickers show it: ISO-style
|
|
519
|
+
(`2026-03-09 14:30`) on a 24-hour clock by default, or with a custom `format`.
|
|
520
|
+
Instants (`"2026-03-09T13:30:00Z"`) are shown in `timeZone`. Returns `""` for an invalid value.
|
|
419
521
|
|
|
420
522
|
```tsx
|
|
421
|
-
import {
|
|
523
|
+
import { formatDate } from '@optimum-intelligence/opti-ui';
|
|
422
524
|
```
|
|
423
525
|
|
|
424
|
-
|
|
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. |
|
|
526
|
+
Signature: `formatDate(value: string \| null \| undefined, options: FormatDateOptions = {})`
|
|
431
527
|
|
|
432
|
-
|
|
528
|
+
```tsx
|
|
529
|
+
formatDate('2026-03-09T13:30:00Z', { timeZone: 'Europe/Budapest' }); // "2026-03-09 14:30"
|
|
530
|
+
formatDate('2026-03-01', { granularity: 'month', format: 'MMMM YYYY', locale: 'en' }); // "March 2026"
|
|
531
|
+
```
|
|
433
532
|
|
|
434
|
-
##
|
|
533
|
+
## formatFileSize
|
|
435
534
|
|
|
436
|
-
|
|
535
|
+
function · Forms
|
|
437
536
|
|
|
438
|
-
|
|
537
|
+
`1536` → `"1.5 KB"`.
|
|
439
538
|
|
|
440
539
|
```tsx
|
|
441
|
-
import {
|
|
540
|
+
import { formatFileSize } from '@optimum-intelligence/opti-ui';
|
|
442
541
|
```
|
|
443
542
|
|
|
444
|
-
|
|
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
|
|
543
|
+
Signature: `formatFileSize(bytes: number, locale?: string)`
|
|
462
544
|
|
|
463
|
-
##
|
|
545
|
+
## Input
|
|
464
546
|
|
|
465
|
-
component ·
|
|
547
|
+
component · Forms
|
|
466
548
|
|
|
467
|
-
|
|
549
|
+
Text input, optionally with `startAdornment` / `endAdornment` inside the box. Use `TextField` for a labelled one.
|
|
468
550
|
|
|
469
551
|
```tsx
|
|
470
|
-
import {
|
|
552
|
+
import { Input } from '@optimum-intelligence/opti-ui';
|
|
471
553
|
```
|
|
472
554
|
|
|
555
|
+
| Prop | Type | Default | Description |
|
|
556
|
+
| --- | --- | --- | --- |
|
|
557
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
558
|
+
| `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
|
|
559
|
+
| `endAdornment?` | `React.ReactNode` | | Icon, text or button rendered inside the box, after the value. |
|
|
473
560
|
|
|
474
|
-
Also accepts all props of: `
|
|
561
|
+
Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
|
|
475
562
|
|
|
476
|
-
##
|
|
563
|
+
## NumberField
|
|
477
564
|
|
|
478
|
-
component ·
|
|
565
|
+
component · Forms
|
|
479
566
|
|
|
480
|
-
|
|
567
|
+
Numeric input with stepper buttons, locale formatting and keyboard stepping.
|
|
481
568
|
|
|
482
569
|
```tsx
|
|
483
|
-
import {
|
|
570
|
+
import { NumberField } from '@optimum-intelligence/opti-ui';
|
|
484
571
|
```
|
|
485
572
|
|
|
486
573
|
| Prop | Type | Default | Description |
|
|
487
574
|
| --- | --- | --- | --- |
|
|
488
|
-
| `
|
|
489
|
-
| `
|
|
575
|
+
| `label?` | `React.ReactNode` | | Visible field label. |
|
|
576
|
+
| `description?` | `React.ReactNode` | | Help text under the input. |
|
|
577
|
+
| `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
|
|
578
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
579
|
+
| `placeholder?` | `string` | | Placeholder shown while empty. |
|
|
580
|
+
| `hideStepper?` | `boolean` | | Hide the − / + stepper buttons. |
|
|
581
|
+
| `decrementLabel?` | `string` | `'Decrease'` | Accessible name of the − button. |
|
|
582
|
+
| `incrementLabel?` | `string` | `'Increase'` | Accessible name of the + button. |
|
|
490
583
|
|
|
491
|
-
Also accepts all props of: `
|
|
584
|
+
Also accepts all props of: `BaseNumberField.Root.Props`.
|
|
492
585
|
|
|
493
|
-
##
|
|
586
|
+
## PasswordField
|
|
494
587
|
|
|
495
|
-
component ·
|
|
588
|
+
component · Forms
|
|
496
589
|
|
|
497
|
-
|
|
590
|
+
Labelled password input with description and error message.
|
|
498
591
|
|
|
499
592
|
```tsx
|
|
500
|
-
import {
|
|
593
|
+
import { PasswordField } from '@optimum-intelligence/opti-ui';
|
|
501
594
|
```
|
|
502
595
|
|
|
503
596
|
| Prop | Type | Default | Description |
|
|
504
597
|
| --- | --- | --- | --- |
|
|
505
|
-
| `
|
|
506
|
-
| `
|
|
507
|
-
| `
|
|
598
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
|
|
599
|
+
| `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
|
|
600
|
+
| `visible?` | `boolean` | | Whether the value is shown as plain text. |
|
|
601
|
+
| `defaultVisible?` | `boolean` | | Initial visibility when uncontrolled. |
|
|
602
|
+
| `onVisibleChange?` | `(visible: boolean) => void` | | Called when the user toggles visibility. |
|
|
603
|
+
| `toggleLabel?` | `string` | | Accessible name of the show/hide button. |
|
|
508
604
|
|
|
509
|
-
Also accepts all props of: `
|
|
605
|
+
Also accepts all props of: `Omit<BaseInput.Props, 'size'>`, `FieldShellProps`.
|
|
510
606
|
|
|
511
|
-
##
|
|
607
|
+
## PasswordInput
|
|
512
608
|
|
|
513
|
-
component ·
|
|
609
|
+
component · Forms
|
|
514
610
|
|
|
515
|
-
|
|
611
|
+
Password input with a button that reveals the value.
|
|
516
612
|
|
|
517
613
|
```tsx
|
|
518
|
-
import {
|
|
614
|
+
import { PasswordInput } from '@optimum-intelligence/opti-ui';
|
|
519
615
|
```
|
|
520
616
|
|
|
521
617
|
| Prop | Type | Default | Description |
|
|
522
618
|
| --- | --- | --- | --- |
|
|
523
|
-
| `size?` | `'
|
|
524
|
-
| `
|
|
525
|
-
| `
|
|
526
|
-
|
|
527
|
-
|
|
619
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
|
|
620
|
+
| `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
|
|
621
|
+
| `visible?` | `boolean` | | Whether the value is shown as plain text. |
|
|
622
|
+
| `defaultVisible?` | `boolean` | `false` | Initial visibility when uncontrolled. |
|
|
623
|
+
| `onVisibleChange?` | `(visible: boolean) => void` | | Called when the user toggles visibility. |
|
|
624
|
+
| `toggleLabel?` | `string` | `'Show password'` | Accessible name of the show/hide button. |
|
|
528
625
|
|
|
529
|
-
|
|
626
|
+
Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
|
|
530
627
|
|
|
531
|
-
##
|
|
628
|
+
## Radio
|
|
532
629
|
|
|
533
|
-
component ·
|
|
630
|
+
component · Forms
|
|
534
631
|
|
|
535
|
-
|
|
632
|
+
Radio button with optional `label` and `description`. Use inside `RadioGroup`; each needs a `value`.
|
|
536
633
|
|
|
537
634
|
```tsx
|
|
538
|
-
import {
|
|
635
|
+
import { Radio } from '@optimum-intelligence/opti-ui';
|
|
539
636
|
```
|
|
540
637
|
|
|
541
|
-
```tsx
|
|
542
|
-
<Button variant="secondary" loading={saving} onClick={save}>Save</Button>
|
|
543
|
-
```
|
|
544
638
|
|
|
545
|
-
|
|
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`.
|
|
639
|
+
Also accepts all props of: `BaseRadio.Root.Props`, `ChoiceLabelProps`.
|
|
554
640
|
|
|
555
|
-
##
|
|
641
|
+
## RadioGroup
|
|
556
642
|
|
|
557
|
-
|
|
643
|
+
component · Forms
|
|
558
644
|
|
|
559
|
-
|
|
560
|
-
the target area. The item parts are the same as `Menu`'s.
|
|
645
|
+
Single-choice group for `Radio` children (`value` / `onValueChange`).
|
|
561
646
|
|
|
562
647
|
```tsx
|
|
563
|
-
import {
|
|
648
|
+
import { RadioGroup } from '@optimum-intelligence/opti-ui';
|
|
564
649
|
```
|
|
565
650
|
|
|
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
651
|
| Prop | Type | Default | Description |
|
|
577
652
|
| --- | --- | --- | --- |
|
|
578
|
-
| `
|
|
579
|
-
|
|
580
|
-
Also accepts all props of: `BaseContextMenu.Popup.Props`.
|
|
581
|
-
|
|
582
|
-
### ContextMenu.Item
|
|
583
|
-
|
|
584
|
-
### ContextMenu.LinkItem
|
|
585
|
-
|
|
586
|
-
### ContextMenu.CheckboxItem
|
|
653
|
+
| `orientation?` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction of the radios. |
|
|
587
654
|
|
|
588
|
-
|
|
655
|
+
Also accepts all props of: `BaseRadioGroup.Props`.
|
|
589
656
|
|
|
590
|
-
|
|
657
|
+
## RangeCalendar
|
|
591
658
|
|
|
592
|
-
|
|
659
|
+
component · Forms
|
|
593
660
|
|
|
594
|
-
|
|
661
|
+
Month grid for picking a range of days: the first pick sets one end, the
|
|
662
|
+
second completes the range (in either order). Same keyboard as Calendar.
|
|
663
|
+
Disabled days cannot be picked as an end but may fall inside a range.
|
|
595
664
|
|
|
596
|
-
|
|
665
|
+
```tsx
|
|
666
|
+
import { RangeCalendar } from '@optimum-intelligence/opti-ui';
|
|
667
|
+
```
|
|
597
668
|
|
|
598
|
-
|
|
669
|
+
| Prop | Type | Default | Description |
|
|
670
|
+
| --- | --- | --- | --- |
|
|
671
|
+
| `value?` | `DateRange \| null` | | Selected days as ISO dates; both ends are inclusive. With a month or year `granularity`, each end is the 1st day of its month or year. |
|
|
672
|
+
| `defaultValue?` | `DateRange \| null` | `null` | Initially selected range when uncontrolled. |
|
|
673
|
+
| `onValueChange?` | `(value: DateRange) => void` | | Called once both ends are picked, with `start` on or before `end`. |
|
|
599
674
|
|
|
600
|
-
|
|
675
|
+
Also accepts all props of: `CalendarOptions`.
|
|
601
676
|
|
|
602
|
-
##
|
|
677
|
+
## SearchInput
|
|
603
678
|
|
|
604
|
-
component ·
|
|
679
|
+
component · Forms
|
|
605
680
|
|
|
606
|
-
|
|
681
|
+
Text input with a search icon and a clear button that appears once there is a value.
|
|
607
682
|
|
|
608
683
|
```tsx
|
|
609
|
-
import {
|
|
684
|
+
import { SearchInput } from '@optimum-intelligence/opti-ui';
|
|
610
685
|
```
|
|
611
686
|
|
|
612
687
|
| Prop | Type | Default | Description |
|
|
613
688
|
| --- | --- | --- | --- |
|
|
614
|
-
| `
|
|
615
|
-
| `
|
|
616
|
-
| `
|
|
617
|
-
| `
|
|
618
|
-
| `
|
|
689
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
|
|
690
|
+
| `value?` | `string` | | Current text (controlled). |
|
|
691
|
+
| `defaultValue?` | `string` | `''` | Initial text when uncontrolled. |
|
|
692
|
+
| `onValueChange?` | `(value: string) => void` | | Called with the new text on typing and with `''` on clear. |
|
|
693
|
+
| `clearLabel?` | `string` | `'Clear search'` | Accessible name of the clear button. |
|
|
694
|
+
| `icon?` | `React.ReactNode` | | Replaces the leading search icon. |
|
|
619
695
|
|
|
620
|
-
Also accepts all props of: `
|
|
696
|
+
Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
|
|
621
697
|
|
|
622
|
-
##
|
|
698
|
+
## Select
|
|
623
699
|
|
|
624
|
-
compound ·
|
|
700
|
+
compound · Forms
|
|
625
701
|
|
|
626
|
-
|
|
627
|
-
|
|
702
|
+
`<Select items={…} />` renders a complete labelled select. For full control
|
|
703
|
+
compose the parts: `Select.Root`, `Select.Trigger`, `Select.Content`,
|
|
704
|
+
`Select.Item`, `Select.Group`, `Select.GroupLabel`, `Select.Separator`.
|
|
628
705
|
|
|
629
706
|
```tsx
|
|
630
|
-
import {
|
|
707
|
+
import { Select } from '@optimum-intelligence/opti-ui';
|
|
631
708
|
```
|
|
632
709
|
|
|
633
|
-
|
|
710
|
+
| Prop | Type | Default | Description |
|
|
711
|
+
| --- | --- | --- | --- |
|
|
712
|
+
| `items` | `Array<SelectOption \| SelectOptionGroup>` | | Options, or groups of options. |
|
|
713
|
+
| `label?` | `React.ReactNode` | | Visible field label. |
|
|
714
|
+
| `description?` | `React.ReactNode` | | Help text under the trigger. |
|
|
715
|
+
| `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
|
|
716
|
+
| `placeholder?` | `React.ReactNode` | `'Select…'` | Text shown while nothing is selected. |
|
|
717
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
718
|
+
| `triggerProps?` | `Omit<SelectTriggerProps, 'size' \| 'placeholder'>` | | Props passed to the trigger button (className, style, aria-*). |
|
|
719
|
+
| `contentProps?` | `Omit<SelectContentProps, 'children'>` | | Props for the popup (side, align, className…). |
|
|
634
720
|
|
|
635
|
-
|
|
721
|
+
Also accepts all props of: `RootProps`.
|
|
636
722
|
|
|
637
|
-
###
|
|
723
|
+
### Select.Root
|
|
638
724
|
|
|
639
|
-
Base UI `
|
|
725
|
+
Base UI `Select.Root` re-exported unchanged. See https://base-ui.com/react/components/select.
|
|
640
726
|
|
|
641
|
-
###
|
|
727
|
+
### Select.Label
|
|
728
|
+
|
|
729
|
+
### Select.Trigger
|
|
730
|
+
|
|
731
|
+
The select button. Renders the value and chevron unless children are given.
|
|
642
732
|
|
|
643
733
|
| Prop | Type | Default | Description |
|
|
644
734
|
| --- | --- | --- | --- |
|
|
645
|
-
| `
|
|
646
|
-
| `
|
|
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`.
|
|
735
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
736
|
+
| `placeholder?` | `React.ReactNode` | | Placeholder shown by the default value slot. |
|
|
652
737
|
|
|
653
|
-
|
|
738
|
+
Also accepts all props of: `BaseSelect.Trigger.Props`.
|
|
654
739
|
|
|
740
|
+
### Select.Value
|
|
655
741
|
|
|
656
|
-
|
|
742
|
+
### Select.Content
|
|
657
743
|
|
|
658
|
-
|
|
744
|
+
Portal + positioner + popup + list in one.
|
|
659
745
|
|
|
746
|
+
| Prop | Type | Default | Description |
|
|
747
|
+
| --- | --- | --- | --- |
|
|
748
|
+
| `side?` | `BaseSelect.Positioner.Props['side']` | | Which side of the trigger the list opens on. |
|
|
749
|
+
| `align?` | `BaseSelect.Positioner.Props['align']` | | Alignment along that side. |
|
|
750
|
+
| `sideOffset?` | `BaseSelect.Positioner.Props['sideOffset']` | `6` | Distance from the trigger in px. |
|
|
751
|
+
| `alignItemWithTrigger?` | `boolean` | `false` | Overlap the trigger so the selected item lines up with it (macOS style). |
|
|
752
|
+
| `positionerProps?` | `BaseSelect.Positioner.Props` | | Props for the positioner element that places the popup. |
|
|
660
753
|
|
|
661
|
-
Also accepts all props of: `
|
|
754
|
+
Also accepts all props of: `BaseSelect.Popup.Props`.
|
|
662
755
|
|
|
663
|
-
###
|
|
756
|
+
### Select.Item
|
|
664
757
|
|
|
758
|
+
### Select.Group
|
|
665
759
|
|
|
666
|
-
|
|
760
|
+
### Select.GroupLabel
|
|
667
761
|
|
|
668
|
-
###
|
|
762
|
+
### Select.Separator
|
|
669
763
|
|
|
670
|
-
|
|
764
|
+
## Slider
|
|
671
765
|
|
|
672
|
-
|
|
766
|
+
component · Forms
|
|
673
767
|
|
|
768
|
+
Single value or range (pass an array) slider.
|
|
674
769
|
|
|
675
|
-
|
|
770
|
+
```tsx
|
|
771
|
+
import { Slider } from '@optimum-intelligence/opti-ui';
|
|
772
|
+
```
|
|
676
773
|
|
|
677
|
-
|
|
774
|
+
| Prop | Type | Default | Description |
|
|
775
|
+
| --- | --- | --- | --- |
|
|
776
|
+
| `label?` | `React.ReactNode` | | Visible label above the track. |
|
|
777
|
+
| `showValue?` | `boolean` | | Show the formatted value next to the label. |
|
|
778
|
+
| `thumbLabels?` | `string[]` | | Accessible labels for each thumb (needed for range sliders). |
|
|
678
779
|
|
|
679
|
-
|
|
780
|
+
Also accepts all props of: `BaseSlider.Root.Props`.
|
|
680
781
|
|
|
681
|
-
|
|
782
|
+
## Switch
|
|
682
783
|
|
|
683
|
-
|
|
784
|
+
component · Forms
|
|
684
785
|
|
|
685
|
-
|
|
786
|
+
On/off switch with optional `label` and `description`.
|
|
686
787
|
|
|
687
|
-
|
|
788
|
+
```tsx
|
|
789
|
+
import { Switch } from '@optimum-intelligence/opti-ui';
|
|
790
|
+
```
|
|
688
791
|
|
|
689
|
-
|
|
792
|
+
```tsx
|
|
793
|
+
<Switch label="Email alerts" checked={on} onCheckedChange={setOn} />
|
|
794
|
+
```
|
|
690
795
|
|
|
691
796
|
|
|
692
|
-
Also accepts all props of: `
|
|
797
|
+
Also accepts all props of: `BaseSwitch.Root.Props`, `ChoiceLabelProps`.
|
|
693
798
|
|
|
694
|
-
##
|
|
799
|
+
## Textarea
|
|
695
800
|
|
|
696
|
-
component ·
|
|
801
|
+
component · Forms
|
|
697
802
|
|
|
698
|
-
|
|
803
|
+
Multi-line text input. Use `TextareaField` for a labelled one.
|
|
699
804
|
|
|
700
805
|
```tsx
|
|
701
|
-
import {
|
|
806
|
+
import { Textarea } from '@optimum-intelligence/opti-ui';
|
|
702
807
|
```
|
|
703
808
|
|
|
704
809
|
| Prop | Type | Default | Description |
|
|
705
810
|
| --- | --- | --- | --- |
|
|
706
|
-
| `
|
|
707
|
-
| `
|
|
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. |
|
|
811
|
+
| `ref?` | `React.Ref<HTMLTextAreaElement>` | | Ref to the `<textarea>`. |
|
|
812
|
+
| `autoResize?` | `boolean` | | Grow with content up to `maxRows` (uses CSS field-sizing where supported). |
|
|
713
813
|
|
|
714
|
-
Also accepts all props of: `
|
|
814
|
+
Also accepts all props of: `React.TextareaHTMLAttributes<HTMLTextAreaElement>`.
|
|
715
815
|
|
|
716
|
-
##
|
|
816
|
+
## TextareaField
|
|
717
817
|
|
|
718
|
-
component ·
|
|
818
|
+
component · Forms
|
|
719
819
|
|
|
720
|
-
|
|
820
|
+
Labelled textarea with description and error message.
|
|
721
821
|
|
|
722
822
|
```tsx
|
|
723
|
-
import {
|
|
823
|
+
import { TextareaField } from '@optimum-intelligence/opti-ui';
|
|
724
824
|
```
|
|
725
825
|
|
|
726
826
|
| Prop | Type | Default | Description |
|
|
727
827
|
| --- | --- | --- | --- |
|
|
728
|
-
| `
|
|
828
|
+
| `ref?` | `React.Ref<HTMLTextAreaElement>` | | Ref to the `<textarea>`. |
|
|
829
|
+
| `autoResize?` | `boolean` | | Grow with content up to `maxRows` (uses CSS field-sizing where supported). |
|
|
729
830
|
|
|
730
|
-
Also accepts all props of: `
|
|
831
|
+
Also accepts all props of: `React.TextareaHTMLAttributes<HTMLTextAreaElement>`, `FieldShellProps`.
|
|
731
832
|
|
|
732
|
-
##
|
|
833
|
+
## TextField
|
|
733
834
|
|
|
734
|
-
component ·
|
|
835
|
+
component · Forms
|
|
735
836
|
|
|
736
|
-
|
|
837
|
+
Labelled input with description and error message.
|
|
737
838
|
|
|
738
839
|
```tsx
|
|
739
|
-
import {
|
|
840
|
+
import { TextField } from '@optimum-intelligence/opti-ui';
|
|
740
841
|
```
|
|
741
842
|
|
|
742
843
|
| Prop | Type | Default | Description |
|
|
743
844
|
| --- | --- | --- | --- |
|
|
744
|
-
| `size?` | `'sm' \| 'md'
|
|
745
|
-
| `
|
|
746
|
-
| `
|
|
845
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | | Control height. |
|
|
846
|
+
| `startAdornment?` | `React.ReactNode` | | Icon or text rendered inside the box, before the value. |
|
|
847
|
+
| `endAdornment?` | `React.ReactNode` | | Icon, text or button rendered inside the box, after the value. |
|
|
747
848
|
|
|
748
|
-
Also accepts all props of: `
|
|
849
|
+
Also accepts all props of: `Omit<BaseInput.Props, 'size'>`, `FieldShellProps`.
|
|
749
850
|
|
|
750
|
-
##
|
|
851
|
+
## useDateConfig
|
|
751
852
|
|
|
752
|
-
|
|
853
|
+
hook · Forms
|
|
753
854
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
`<Toolbar.Button render={<Menu.Trigger />} />`.
|
|
855
|
+
The date settings from the nearest `DateConfigProvider`. Spread it into
|
|
856
|
+
`formatDate` options to format dates the same way the pickers do.
|
|
757
857
|
|
|
758
858
|
```tsx
|
|
759
|
-
import {
|
|
859
|
+
import { useDateConfig } from '@optimum-intelligence/opti-ui';
|
|
760
860
|
```
|
|
761
861
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
### Toolbar.Button
|
|
862
|
+
Signature: `useDateConfig()`
|
|
765
863
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
### Toolbar.Separator
|
|
864
|
+
```tsx
|
|
865
|
+
const config = useDateConfig();
|
|
866
|
+
return <span>{formatDate(order.createdAt, { ...config, granularity: 'minute' })}</span>;
|
|
867
|
+
```
|
|
771
868
|
|
|
772
|
-
|
|
869
|
+
# Layout
|
|
773
870
|
|
|
774
|
-
|
|
871
|
+
## AppShell
|
|
775
872
|
|
|
776
|
-
|
|
873
|
+
component · Layout
|
|
777
874
|
|
|
778
|
-
|
|
875
|
+
Full-height layout with a fixed navbar and an internally scrolling main
|
|
876
|
+
area. Below 900px the navbar moves into a slide-in drawer, and `NavbarItem`s marked `pinned` show in a
|
|
877
|
+
tab bar (see `mobileNavPosition`).
|
|
878
|
+
Customize width with `--oui-navbar-width` and `--oui-navbar-collapsed-width`.
|
|
779
879
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
880
|
+
```tsx
|
|
881
|
+
import { AppShell } from '@optimum-intelligence/opti-ui';
|
|
882
|
+
```
|
|
783
883
|
|
|
784
884
|
```tsx
|
|
785
|
-
|
|
885
|
+
<AppShell
|
|
886
|
+
mobileBrand="OptiControl"
|
|
887
|
+
navbar={
|
|
888
|
+
<Navbar>
|
|
889
|
+
<NavbarSection>
|
|
890
|
+
<NavbarItem href="/" icon={<Home />} active pinned>Overview</NavbarItem>
|
|
891
|
+
<NavbarItem href="/fleet" icon={<Truck />} pinned>Fleet</NavbarItem>
|
|
892
|
+
</NavbarSection>
|
|
893
|
+
</Navbar>
|
|
894
|
+
}
|
|
895
|
+
>
|
|
896
|
+
<PageHeader title="Overview" />
|
|
897
|
+
</AppShell>
|
|
786
898
|
```
|
|
787
899
|
|
|
788
900
|
| Prop | Type | Default | Description |
|
|
789
901
|
| --- | --- | --- | --- |
|
|
790
|
-
| `
|
|
791
|
-
| `
|
|
792
|
-
| `
|
|
902
|
+
| `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the shell's root element. |
|
|
903
|
+
| `navbar` | `React.ReactNode` | | Navbar content (usually a `<Navbar>`). Rendered in a drawer on small screens. |
|
|
904
|
+
| `mobileBrand?` | `React.ReactNode` | | Brand shown in the mobile top bar. |
|
|
905
|
+
| `mobileActions?` | `React.ReactNode` | | Extra content on the right of the mobile top bar. |
|
|
906
|
+
| `mobileNavPosition?` | `'bottom' \| 'top'` | `'bottom'` | Where small screens show the tab bar of pinned `NavbarItem`s: below or above the main area. Both look the same; the "More" slot (see `moreTabPosition`) opens the navbar drawer. The top bar with `mobileBrand` and `mobileActions` only appears when one of them is set. Without pinned items, a top bar with a menu button is shown instead. |
|
|
907
|
+
| `menuLabel?` | `string` | `'Open navigation'` | Accessible name of the button that opens the navigation drawer on small screens. |
|
|
908
|
+
| `moreLabel?` | `string` | `'More'` | Label of the tab-bar slot that opens the navigation drawer. |
|
|
909
|
+
| `moreTabPosition?` | `'start' \| 'end'` | `'start'` | Whether the "More" slot comes before or after the pinned items in the tab bar. |
|
|
910
|
+
| `mainProps?` | `React.HTMLAttributes<HTMLElement>` | | Props for the scrolling `<main>` element. |
|
|
793
911
|
|
|
794
|
-
Also accepts all props of: `
|
|
912
|
+
Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
795
913
|
|
|
796
|
-
##
|
|
914
|
+
## Card
|
|
797
915
|
|
|
798
|
-
component ·
|
|
916
|
+
component · Layout
|
|
799
917
|
|
|
800
|
-
|
|
918
|
+
Surface that groups related content. Compose with `CardHeader` (`CardTitle`, `CardDescription`,
|
|
919
|
+
`CardActions`), `CardContent` and `CardFooter`.
|
|
801
920
|
|
|
802
921
|
```tsx
|
|
803
|
-
import {
|
|
922
|
+
import { Card } from '@optimum-intelligence/opti-ui';
|
|
804
923
|
```
|
|
805
924
|
|
|
925
|
+
```tsx
|
|
926
|
+
<Card variant="elevated">
|
|
927
|
+
<CardHeader>
|
|
928
|
+
<CardTitle>Monthly energy</CardTitle>
|
|
929
|
+
<CardDescription>Last 30 days</CardDescription>
|
|
930
|
+
</CardHeader>
|
|
931
|
+
<CardContent>…</CardContent>
|
|
932
|
+
</Card>
|
|
933
|
+
```
|
|
806
934
|
|
|
807
|
-
|
|
935
|
+
| Prop | Type | Default | Description |
|
|
936
|
+
| --- | --- | --- | --- |
|
|
937
|
+
| `variant?` | `'outlined' \| 'elevated' \| 'filled' \| 'ghost'` | `'outlined'` | `outlined` (default) uses the card border, `elevated` a soft shadow. |
|
|
938
|
+
| `padding?` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Inner spacing. Override with `--oui-card-padding`. |
|
|
939
|
+
| `interactive?` | `boolean` | `false` | Adds hover and focus states — use with `render={<a href=… />}` or a click handler. |
|
|
808
940
|
|
|
809
|
-
|
|
941
|
+
Also accepts all props of: `useRender.ComponentProps<'div', CardState>`.
|
|
810
942
|
|
|
811
|
-
|
|
943
|
+
## CardActions
|
|
812
944
|
|
|
813
|
-
|
|
945
|
+
compound · Layout
|
|
946
|
+
|
|
947
|
+
Right-aligned slot inside CardHeader for icon buttons or menus.
|
|
814
948
|
|
|
815
949
|
```tsx
|
|
816
|
-
import {
|
|
950
|
+
import { CardActions } from '@optimum-intelligence/opti-ui';
|
|
817
951
|
```
|
|
818
952
|
|
|
819
|
-
|
|
820
|
-
| --- | --- | --- | --- |
|
|
821
|
-
| `orientation?` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction of the checkboxes. |
|
|
822
|
-
|
|
823
|
-
Also accepts all props of: `BaseCheckboxGroup.Props`.
|
|
953
|
+
### CardActions.displayName
|
|
824
954
|
|
|
825
|
-
##
|
|
955
|
+
## CardContent
|
|
826
956
|
|
|
827
|
-
compound ·
|
|
957
|
+
compound · Layout
|
|
828
958
|
|
|
829
|
-
|
|
830
|
-
(chips) selection; compose the parts for anything custom.
|
|
959
|
+
Styled `<div>` (`.oui-card__content`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
831
960
|
|
|
832
961
|
```tsx
|
|
833
|
-
import {
|
|
962
|
+
import { CardContent } from '@optimum-intelligence/opti-ui';
|
|
834
963
|
```
|
|
835
964
|
|
|
836
|
-
|
|
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. |
|
|
965
|
+
### CardContent.displayName
|
|
847
966
|
|
|
848
|
-
|
|
967
|
+
## CardDescription
|
|
849
968
|
|
|
850
|
-
|
|
969
|
+
compound · Layout
|
|
851
970
|
|
|
852
|
-
|
|
971
|
+
Styled `<p>` (`.oui-card__description`). Accepts `className`, `style`, the `render` prop and all `<p>` attributes.
|
|
853
972
|
|
|
854
|
-
|
|
973
|
+
```tsx
|
|
974
|
+
import { CardDescription } from '@optimum-intelligence/opti-ui';
|
|
975
|
+
```
|
|
855
976
|
|
|
856
|
-
|
|
857
|
-
| --- | --- | --- | --- |
|
|
858
|
-
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
977
|
+
### CardDescription.displayName
|
|
859
978
|
|
|
860
|
-
|
|
979
|
+
## CardFooter
|
|
861
980
|
|
|
862
|
-
|
|
981
|
+
compound · Layout
|
|
863
982
|
|
|
864
|
-
|
|
983
|
+
Styled `<div>` (`.oui-card__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
865
984
|
|
|
866
|
-
|
|
985
|
+
```tsx
|
|
986
|
+
import { CardFooter } from '@optimum-intelligence/opti-ui';
|
|
987
|
+
```
|
|
867
988
|
|
|
868
|
-
###
|
|
989
|
+
### CardFooter.displayName
|
|
869
990
|
|
|
870
|
-
|
|
991
|
+
## CardHeader
|
|
871
992
|
|
|
872
|
-
|
|
993
|
+
compound · Layout
|
|
873
994
|
|
|
874
|
-
|
|
995
|
+
Styled `<div>` (`.oui-card__header`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
875
996
|
|
|
876
|
-
|
|
997
|
+
```tsx
|
|
998
|
+
import { CardHeader } from '@optimum-intelligence/opti-ui';
|
|
999
|
+
```
|
|
877
1000
|
|
|
878
|
-
|
|
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. |
|
|
1001
|
+
### CardHeader.displayName
|
|
884
1002
|
|
|
885
|
-
|
|
1003
|
+
## CardTitle
|
|
886
1004
|
|
|
887
|
-
|
|
1005
|
+
compound · Layout
|
|
888
1006
|
|
|
889
|
-
|
|
1007
|
+
Styled `<h3>` (`.oui-card__title`). Accepts `className`, `style`, the `render` prop and all `<h3>` attributes.
|
|
890
1008
|
|
|
891
|
-
|
|
1009
|
+
```tsx
|
|
1010
|
+
import { CardTitle } from '@optimum-intelligence/opti-ui';
|
|
1011
|
+
```
|
|
892
1012
|
|
|
893
|
-
###
|
|
1013
|
+
### CardTitle.displayName
|
|
894
1014
|
|
|
895
|
-
|
|
1015
|
+
## Grid
|
|
896
1016
|
|
|
897
|
-
|
|
1017
|
+
component · Layout
|
|
898
1018
|
|
|
899
|
-
|
|
1019
|
+
Responsive dashboard grid.
|
|
900
1020
|
|
|
901
|
-
|
|
1021
|
+
```tsx
|
|
1022
|
+
import { Grid } from '@optimum-intelligence/opti-ui';
|
|
1023
|
+
```
|
|
902
1024
|
|
|
903
|
-
|
|
1025
|
+
| Prop | Type | Default | Description |
|
|
1026
|
+
| --- | --- | --- | --- |
|
|
1027
|
+
| `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the grid element. |
|
|
1028
|
+
| `columns?` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `3` | Columns on wide screens; collapses to 2 below 1200px (for 4+) and 1 below 900px. |
|
|
1029
|
+
| `gap?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Space between grid cells. |
|
|
904
1030
|
|
|
905
|
-
|
|
1031
|
+
Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
906
1032
|
|
|
907
|
-
##
|
|
1033
|
+
## Navbar
|
|
908
1034
|
|
|
909
|
-
component ·
|
|
1035
|
+
component · Layout
|
|
910
1036
|
|
|
911
|
-
|
|
912
|
-
|
|
1037
|
+
Collapsible side navigation. Use inside `AppShell`. Compose with `NavbarHeader` (`NavbarBrand`),
|
|
1038
|
+
`NavbarSection` (`NavbarSectionLabel`, `NavbarItem`) and `NavbarFooter`.
|
|
913
1039
|
|
|
914
1040
|
```tsx
|
|
915
|
-
import {
|
|
1041
|
+
import { Navbar } from '@optimum-intelligence/opti-ui';
|
|
916
1042
|
```
|
|
917
1043
|
|
|
1044
|
+
| Prop | Type | Default | Description |
|
|
1045
|
+
| --- | --- | --- | --- |
|
|
1046
|
+
| `variant?` | `'inverse' \| 'surface'` | `'inverse'` | `inverse` (brand-colored, default) or `surface` (light panel). |
|
|
1047
|
+
| `collapsible?` | `boolean` | `true` | Shows a toggle in the top right that shrinks the navbar to an icon rail. Defaults to `true`. |
|
|
1048
|
+
| `collapsed?` | `boolean` | | Controlled collapsed state. |
|
|
1049
|
+
| `defaultCollapsed?` | `boolean` | `false` | Initial collapsed state when uncontrolled. |
|
|
1050
|
+
| `onCollapsedChange?` | `(collapsed: boolean) => void` | | Called when the user collapses or expands the navbar. |
|
|
1051
|
+
| `expandOnHover?` | `boolean` | `true` | Temporarily opens a collapsed navbar while the mouse is over it. Defaults to `true`. |
|
|
1052
|
+
| `collapseLabel?` | `string` | `'Collapse'` | Accessible names for the icon-only toggle. |
|
|
1053
|
+
| `expandLabel?` | `string` | `'Expand'` | Accessible name of the toggle while collapsed. |
|
|
918
1054
|
|
|
919
|
-
Also accepts all props of: `
|
|
1055
|
+
Also accepts all props of: `useRender.ComponentProps<'nav', NavbarState>`.
|
|
920
1056
|
|
|
921
|
-
##
|
|
1057
|
+
## NavbarBrand
|
|
922
1058
|
|
|
923
|
-
component ·
|
|
1059
|
+
component · Layout
|
|
924
1060
|
|
|
925
|
-
|
|
926
|
-
`{ start, end }` ISO dates (`"2026-03-09"`), both inclusive.
|
|
1061
|
+
Logo, title and subtitle block for the top of a `Navbar`.
|
|
927
1062
|
|
|
928
1063
|
```tsx
|
|
929
|
-
import {
|
|
1064
|
+
import { NavbarBrand } from '@optimum-intelligence/opti-ui';
|
|
930
1065
|
```
|
|
931
1066
|
|
|
932
1067
|
| Prop | Type | Default | Description |
|
|
933
1068
|
| --- | --- | --- | --- |
|
|
934
|
-
| `
|
|
935
|
-
| `
|
|
936
|
-
| `
|
|
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. |
|
|
1069
|
+
| `logo?` | `React.ReactNode` | | Logo or icon shown before the title; stays visible when the navbar is collapsed. |
|
|
1070
|
+
| `title` | `React.ReactNode` | | Product or organization name. |
|
|
1071
|
+
| `subtitle?` | `React.ReactNode` | | Smaller line under the title. |
|
|
960
1072
|
|
|
961
|
-
Also accepts all props of: `
|
|
1073
|
+
Also accepts all props of: `Omit<useRender.ComponentProps<'div'>, 'title'>`.
|
|
962
1074
|
|
|
963
|
-
##
|
|
1075
|
+
## NavbarFooter
|
|
964
1076
|
|
|
965
|
-
|
|
1077
|
+
compound · Layout
|
|
1078
|
+
|
|
1079
|
+
Styled `<div>` (`.oui-navbar__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
1080
|
+
|
|
1081
|
+
```tsx
|
|
1082
|
+
import { NavbarFooter } from '@optimum-intelligence/opti-ui';
|
|
1083
|
+
```
|
|
966
1084
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1085
|
+
### NavbarFooter.displayName
|
|
1086
|
+
|
|
1087
|
+
## NavbarGroup
|
|
1088
|
+
|
|
1089
|
+
component · Layout
|
|
1090
|
+
|
|
1091
|
+
Expandable parent row in a `Navbar` with nested `NavbarItem` sub-links. Place it in a `NavbarSection`
|
|
1092
|
+
next to other items. On a collapsed rail the sub-links are hidden and the parent shows as active when
|
|
1093
|
+
one of them is; the hover peek shows the full tree.
|
|
1094
|
+
|
|
1095
|
+
```tsx
|
|
1096
|
+
import { NavbarGroup } from '@optimum-intelligence/opti-ui';
|
|
1097
|
+
```
|
|
970
1098
|
|
|
971
1099
|
```tsx
|
|
972
|
-
|
|
1100
|
+
<NavbarSection>
|
|
1101
|
+
<NavbarGroup icon={<Truck />} label="Fleet">
|
|
1102
|
+
<NavbarItem href="/fleet/vehicles" active>Vehicles</NavbarItem>
|
|
1103
|
+
<NavbarItem href="/fleet/drivers">Drivers</NavbarItem>
|
|
1104
|
+
</NavbarGroup>
|
|
1105
|
+
</NavbarSection>
|
|
973
1106
|
```
|
|
974
1107
|
|
|
975
1108
|
| Prop | Type | Default | Description |
|
|
976
1109
|
| --- | --- | --- | --- |
|
|
977
|
-
| `
|
|
978
|
-
| `
|
|
1110
|
+
| `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the group's root element. |
|
|
1111
|
+
| `label` | `React.ReactNode` | | Text of the parent row. A string also becomes its tooltip on the collapsed rail. |
|
|
1112
|
+
| `icon?` | `React.ReactNode` | | Icon of the parent row; it stays visible when the navbar is collapsed to a rail. |
|
|
1113
|
+
| `badge?` | `React.ReactNode` | | Trailing content of the parent row, such as a count badge. |
|
|
1114
|
+
| `open?` | `boolean` | | Controlled open state. Takes over from the automatic opening on an active child. |
|
|
1115
|
+
| `defaultOpen?` | `boolean` | `true when a child item is active` | Initial open state when uncontrolled. Whenever a child item becomes `active`, the group opens. |
|
|
1116
|
+
| `onOpenChange?` | `(open: boolean) => void` | | Called when the user opens or closes the group. |
|
|
1117
|
+
| `children?` | `React.ReactNode` | | Sub-links: `NavbarItem` elements (directly or in fragments), shown indented and without icons. |
|
|
979
1118
|
|
|
980
|
-
Also accepts all props of: `
|
|
1119
|
+
Also accepts all props of: `Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>`.
|
|
981
1120
|
|
|
982
|
-
##
|
|
1121
|
+
## NavbarHeader
|
|
983
1122
|
|
|
984
|
-
|
|
1123
|
+
compound · Layout
|
|
985
1124
|
|
|
986
|
-
|
|
1125
|
+
Styled `<div>` (`.oui-navbar__header`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
987
1126
|
|
|
988
1127
|
```tsx
|
|
989
|
-
import {
|
|
1128
|
+
import { NavbarHeader } from '@optimum-intelligence/opti-ui';
|
|
990
1129
|
```
|
|
991
1130
|
|
|
992
|
-
|
|
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'>`.
|
|
1131
|
+
### NavbarHeader.displayName
|
|
1010
1132
|
|
|
1011
|
-
##
|
|
1133
|
+
## NavbarItem
|
|
1012
1134
|
|
|
1013
|
-
|
|
1135
|
+
component · Layout
|
|
1014
1136
|
|
|
1015
|
-
|
|
1016
|
-
|
|
1137
|
+
Navigation link. Renders an `<a>`; use `render={<Link to="…" />}` for a
|
|
1138
|
+
router link or `render={<button />}` for an action. Inside a `NavbarGroup` it becomes an indented sub-link.
|
|
1017
1139
|
|
|
1018
1140
|
```tsx
|
|
1019
|
-
import {
|
|
1141
|
+
import { NavbarItem } from '@optimum-intelligence/opti-ui';
|
|
1020
1142
|
```
|
|
1021
1143
|
|
|
1022
|
-
### Field.Root
|
|
1023
|
-
|
|
1024
|
-
### Field.Label
|
|
1025
|
-
|
|
1026
1144
|
| Prop | Type | Default | Description |
|
|
1027
1145
|
| --- | --- | --- | --- |
|
|
1028
|
-
| `
|
|
1146
|
+
| `icon?` | `React.ReactNode` | | Icon shown before the label; it stays visible when the navbar is collapsed to a rail. Not shown inside a `NavbarGroup`. |
|
|
1147
|
+
| `active?` | `boolean` | `false` | Marks the current page (sets aria-current). Also opens the surrounding `NavbarGroup`. |
|
|
1148
|
+
| `badge?` | `React.ReactNode` | | Trailing content such as a count badge. |
|
|
1149
|
+
| `pinned?` | `boolean` | `false` | Also shows the item in the `AppShell` mobile tab bar (icon and label). Pin up to four items; the first four in navbar order are used. Has no effect outside an `AppShell`. |
|
|
1029
1150
|
|
|
1030
|
-
Also accepts all props of: `
|
|
1151
|
+
Also accepts all props of: `useRender.ComponentProps<'a', NavbarItemState>`.
|
|
1031
1152
|
|
|
1032
|
-
|
|
1153
|
+
## NavbarSection
|
|
1033
1154
|
|
|
1034
|
-
|
|
1155
|
+
compound · Layout
|
|
1035
1156
|
|
|
1036
|
-
|
|
1157
|
+
Styled `<div>` (`.oui-navbar__section`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
1037
1158
|
|
|
1038
|
-
|
|
1159
|
+
```tsx
|
|
1160
|
+
import { NavbarSection } from '@optimum-intelligence/opti-ui';
|
|
1161
|
+
```
|
|
1039
1162
|
|
|
1040
|
-
|
|
1163
|
+
### NavbarSection.displayName
|
|
1041
1164
|
|
|
1042
|
-
##
|
|
1165
|
+
## NavbarSectionLabel
|
|
1043
1166
|
|
|
1044
|
-
compound ·
|
|
1167
|
+
compound · Layout
|
|
1045
1168
|
|
|
1046
|
-
|
|
1169
|
+
Styled `<div>` (`.oui-navbar__section-label`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
1047
1170
|
|
|
1048
1171
|
```tsx
|
|
1049
|
-
import {
|
|
1172
|
+
import { NavbarSectionLabel } from '@optimum-intelligence/opti-ui';
|
|
1050
1173
|
```
|
|
1051
1174
|
|
|
1052
|
-
###
|
|
1053
|
-
|
|
1054
|
-
### Fieldset.Legend
|
|
1175
|
+
### NavbarSectionLabel.displayName
|
|
1055
1176
|
|
|
1056
|
-
##
|
|
1177
|
+
## PageHeader
|
|
1057
1178
|
|
|
1058
|
-
component ·
|
|
1179
|
+
component · Layout
|
|
1059
1180
|
|
|
1060
|
-
|
|
1181
|
+
Page title block with optional breadcrumbs, eyebrow, description and actions.
|
|
1061
1182
|
|
|
1062
1183
|
```tsx
|
|
1063
|
-
import {
|
|
1184
|
+
import { PageHeader } from '@optimum-intelligence/opti-ui';
|
|
1064
1185
|
```
|
|
1065
1186
|
|
|
1066
1187
|
| Prop | Type | Default | Description |
|
|
1067
1188
|
| --- | --- | --- | --- |
|
|
1068
|
-
| `ref?` | `React.Ref<
|
|
1069
|
-
| `
|
|
1070
|
-
| `
|
|
1071
|
-
| `
|
|
1072
|
-
| `
|
|
1073
|
-
| `
|
|
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. |
|
|
1189
|
+
| `ref?` | `React.Ref<HTMLElement>` | | Ref to the `<header>` element. |
|
|
1190
|
+
| `breadcrumbs?` | `React.ReactNode` | | Trail shown above the title, usually `<Breadcrumbs>`. |
|
|
1191
|
+
| `eyebrow?` | `React.ReactNode` | | Small label above the title. |
|
|
1192
|
+
| `title` | `React.ReactNode` | | Page title, rendered as the page `<h1>`. |
|
|
1193
|
+
| `description?` | `React.ReactNode` | | Supporting text under the title. |
|
|
1194
|
+
| `actions?` | `React.ReactNode` | | Buttons or controls aligned to the right of the title. |
|
|
1079
1195
|
|
|
1080
|
-
Also accepts all props of: `React.HTMLAttributes<
|
|
1196
|
+
Also accepts all props of: `Omit<React.HTMLAttributes<HTMLElement>, 'title'>`.
|
|
1081
1197
|
|
|
1082
|
-
##
|
|
1198
|
+
## ScrollArea
|
|
1083
1199
|
|
|
1084
|
-
component ·
|
|
1200
|
+
component · Layout
|
|
1085
1201
|
|
|
1086
|
-
|
|
1087
|
-
`File` objects; upload them yourself and report progress through `fileState`.
|
|
1202
|
+
Scroll container with slim, themed overlay scrollbars. Set a height or max-height.
|
|
1088
1203
|
|
|
1089
1204
|
```tsx
|
|
1090
|
-
import {
|
|
1205
|
+
import { ScrollArea } from '@optimum-intelligence/opti-ui';
|
|
1091
1206
|
```
|
|
1092
1207
|
|
|
1093
1208
|
| Prop | Type | Default | Description |
|
|
1094
1209
|
| --- | --- | --- | --- |
|
|
1095
|
-
| `
|
|
1096
|
-
| `
|
|
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. |
|
|
1210
|
+
| `scrollbars?` | `'vertical' \| 'horizontal' \| 'both'` | `'vertical'` | Which scrollbars to render. |
|
|
1211
|
+
| `viewportProps?` | `BaseScrollArea.Viewport.Props` | | Props for the inner scrolling viewport, e.g. a `ref` to read the scroll position. |
|
|
1111
1212
|
|
|
1112
|
-
Also accepts all props of: `
|
|
1213
|
+
Also accepts all props of: `BaseScrollArea.Root.Props`.
|
|
1113
1214
|
|
|
1114
|
-
##
|
|
1215
|
+
## Separator
|
|
1115
1216
|
|
|
1116
|
-
component ·
|
|
1217
|
+
component · Layout
|
|
1117
1218
|
|
|
1118
|
-
|
|
1219
|
+
Thin divider line. Set `orientation="vertical"` for a vertical rule.
|
|
1119
1220
|
|
|
1120
1221
|
```tsx
|
|
1121
|
-
import {
|
|
1222
|
+
import { Separator } from '@optimum-intelligence/opti-ui';
|
|
1122
1223
|
```
|
|
1123
1224
|
|
|
1124
1225
|
|
|
1125
|
-
Also accepts all props of: `
|
|
1226
|
+
Also accepts all props of: `BaseSeparator.Props`.
|
|
1126
1227
|
|
|
1127
|
-
##
|
|
1228
|
+
## Stack
|
|
1128
1229
|
|
|
1129
|
-
|
|
1230
|
+
component · Layout
|
|
1130
1231
|
|
|
1131
|
-
|
|
1232
|
+
Flex container that spaces its children evenly, in a column or a row.
|
|
1132
1233
|
|
|
1133
1234
|
```tsx
|
|
1134
|
-
import {
|
|
1235
|
+
import { Stack } from '@optimum-intelligence/opti-ui';
|
|
1135
1236
|
```
|
|
1136
1237
|
|
|
1137
|
-
|
|
1238
|
+
| Prop | Type | Default | Description |
|
|
1239
|
+
| --- | --- | --- | --- |
|
|
1240
|
+
| `direction?` | `'column' \| 'row'` | `'column'` | `column` (default) stacks children, `row` puts them on a line. |
|
|
1241
|
+
| `gap?` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Space between children. Override with `--oui-stack-gap`. |
|
|
1242
|
+
| `align?` | `'start' \| 'center' \| 'end' \| 'stretch' \| 'baseline'` | | Cross-axis alignment. Defaults to `stretch` in a column and `center` in a row. |
|
|
1243
|
+
| `justify?` | `'start' \| 'center' \| 'end' \| 'between'` | | Main-axis distribution. |
|
|
1244
|
+
| `wrap?` | `boolean` | `false` | Let a row's children wrap onto more lines. |
|
|
1245
|
+
|
|
1246
|
+
Also accepts all props of: `useRender.ComponentProps<'div', StackState>`.
|
|
1138
1247
|
|
|
1139
|
-
##
|
|
1248
|
+
## StatCard
|
|
1140
1249
|
|
|
1141
|
-
|
|
1250
|
+
component · Layout
|
|
1142
1251
|
|
|
1143
|
-
|
|
1144
|
-
The order and the 24-hour clock are fixed; `locale` only translates the month name.
|
|
1252
|
+
KPI tile: label, large value, optional unit and trend.
|
|
1145
1253
|
|
|
1146
1254
|
```tsx
|
|
1147
|
-
import {
|
|
1255
|
+
import { StatCard } from '@optimum-intelligence/opti-ui';
|
|
1148
1256
|
```
|
|
1149
1257
|
|
|
1150
|
-
|
|
1258
|
+
| Prop | Type | Default | Description |
|
|
1259
|
+
| --- | --- | --- | --- |
|
|
1260
|
+
| `variant?` | `'outlined' \| 'elevated' \| 'filled' \| 'ghost'` | | `outlined` (default) uses the card border, `elevated` a soft shadow. |
|
|
1261
|
+
| `padding?` | `'none' \| 'sm' \| 'md' \| 'lg'` | | Inner spacing. Override with `--oui-card-padding`. |
|
|
1262
|
+
| `interactive?` | `boolean` | | Adds hover and focus states — use with `render={<a href=… />}` or a click handler. |
|
|
1263
|
+
| `label` | `React.ReactNode` | | What the number measures. |
|
|
1264
|
+
| `value` | `React.ReactNode` | | The headline figure. |
|
|
1265
|
+
| `unit?` | `React.ReactNode` | | Unit beside the value, e.g. "kWh" or "orders". |
|
|
1266
|
+
| `delta?` | `React.ReactNode` | | Change indicator, e.g. "+12.4%". |
|
|
1267
|
+
| `trend?` | `'up' \| 'down' \| 'flat'` | | Arrow direction shown next to `delta`. |
|
|
1268
|
+
| `tone?` | `'positive' \| 'negative' \| 'neutral'` | | Color of the delta. Defaults to positive for `up`, negative for `down`. |
|
|
1269
|
+
| `hint?` | `React.ReactNode` | | Supporting text under the value. |
|
|
1270
|
+
| `icon?` | `React.ReactNode` | | Icon tile shown in the top-right corner. |
|
|
1271
|
+
| `loading?` | `boolean` | | Replaces the value with a skeleton while data loads. |
|
|
1272
|
+
|
|
1273
|
+
Also accepts all props of: `useRender.ComponentProps<'div', CardState>`.
|
|
1151
1274
|
|
|
1152
|
-
|
|
1275
|
+
# Typography
|
|
1153
1276
|
|
|
1154
|
-
|
|
1277
|
+
## Eyebrow
|
|
1155
1278
|
|
|
1156
|
-
|
|
1279
|
+
component · Typography
|
|
1280
|
+
|
|
1281
|
+
Small uppercase label used above titles, in filter bars and table headers.
|
|
1157
1282
|
|
|
1158
1283
|
```tsx
|
|
1159
|
-
import {
|
|
1284
|
+
import { Eyebrow } from '@optimum-intelligence/opti-ui';
|
|
1160
1285
|
```
|
|
1161
1286
|
|
|
1162
|
-
Signature: `formatFileSize(bytes: number, locale?: string)`
|
|
1163
1287
|
|
|
1164
|
-
|
|
1288
|
+
Also accepts all props of: `useRender.ComponentProps<'span'>`.
|
|
1165
1289
|
|
|
1166
|
-
|
|
1290
|
+
## Heading
|
|
1167
1291
|
|
|
1168
|
-
|
|
1292
|
+
component · Typography
|
|
1293
|
+
|
|
1294
|
+
Heading element. `level` sets the tag (`h1`–`h6`) and the default size; `size` overrides only the look.
|
|
1169
1295
|
|
|
1170
1296
|
```tsx
|
|
1171
|
-
import {
|
|
1297
|
+
import { Heading } from '@optimum-intelligence/opti-ui';
|
|
1172
1298
|
```
|
|
1173
1299
|
|
|
1174
1300
|
| Prop | Type | Default | Description |
|
|
1175
1301
|
| --- | --- | --- | --- |
|
|
1176
|
-
| `
|
|
1177
|
-
| `
|
|
1178
|
-
| `endAdornment?` | `React.ReactNode` | | Icon, text or button rendered inside the box, after the value. |
|
|
1302
|
+
| `level?` | `HeadingLevel` | `2` | Semantic level; picks the element. |
|
|
1303
|
+
| `size?` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | | Visual size, independent of the level. |
|
|
1179
1304
|
|
|
1180
|
-
Also accepts all props of: `
|
|
1305
|
+
Also accepts all props of: `useRender.ComponentProps<'h2', HeadingState>`.
|
|
1181
1306
|
|
|
1182
|
-
##
|
|
1307
|
+
## Link
|
|
1183
1308
|
|
|
1184
|
-
component ·
|
|
1309
|
+
component · Typography
|
|
1185
1310
|
|
|
1186
|
-
|
|
1311
|
+
Text link. Pass a router link through `render`: `<Link render={<NavLink to="/fleet" />}>`.
|
|
1187
1312
|
|
|
1188
1313
|
```tsx
|
|
1189
|
-
import {
|
|
1314
|
+
import { Link } from '@optimum-intelligence/opti-ui';
|
|
1190
1315
|
```
|
|
1191
1316
|
|
|
1192
1317
|
| Prop | Type | Default | Description |
|
|
1193
1318
|
| --- | --- | --- | --- |
|
|
1194
|
-
| `
|
|
1195
|
-
| `
|
|
1196
|
-
| `
|
|
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. |
|
|
1319
|
+
| `tone?` | `'accent' \| 'muted' \| 'inherit'` | `'accent'` | `inherit` takes the color of the surrounding text. |
|
|
1320
|
+
| `underline?` | `'always' \| 'hover' \| 'none'` | `'always'` | When the underline shows. |
|
|
1321
|
+
| `external?` | `boolean` | `false` | Opens in a new tab, with a trailing icon. |
|
|
1202
1322
|
|
|
1203
|
-
Also accepts all props of: `
|
|
1323
|
+
Also accepts all props of: `useRender.ComponentProps<'a', LinkState>`.
|
|
1204
1324
|
|
|
1205
|
-
##
|
|
1325
|
+
## Text
|
|
1206
1326
|
|
|
1207
|
-
component ·
|
|
1327
|
+
component · Typography
|
|
1208
1328
|
|
|
1209
|
-
|
|
1329
|
+
Body text paragraph. Use `render={<span />}` for inline text.
|
|
1210
1330
|
|
|
1211
1331
|
```tsx
|
|
1212
|
-
import {
|
|
1332
|
+
import { Text } from '@optimum-intelligence/opti-ui';
|
|
1213
1333
|
```
|
|
1214
1334
|
|
|
1215
1335
|
| Prop | Type | Default | Description |
|
|
1216
1336
|
| --- | --- | --- | --- |
|
|
1217
|
-
| `size?` | `'sm' \| 'md' \| 'lg'` |
|
|
1218
|
-
| `
|
|
1219
|
-
| `
|
|
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. |
|
|
1337
|
+
| `size?` | `'xs' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Font size. |
|
|
1338
|
+
| `tone?` | `'default' \| 'strong' \| 'muted' \| 'subtle' \| 'accent' \| 'success' \| 'warning' \| 'danger'` | `'default'` | Color role: from `strong` to `subtle`, or a status color. |
|
|
1339
|
+
| `weight?` | `'regular' \| 'medium' \| 'semibold' \| 'bold'` | | Font weight. Inherits when omitted. |
|
|
1223
1340
|
|
|
1224
|
-
Also accepts all props of: `
|
|
1341
|
+
Also accepts all props of: `useRender.ComponentProps<'p', TextState>`.
|
|
1225
1342
|
|
|
1226
|
-
|
|
1343
|
+
# Actions
|
|
1227
1344
|
|
|
1228
|
-
|
|
1345
|
+
## Button
|
|
1229
1346
|
|
|
1230
|
-
|
|
1347
|
+
component · Actions
|
|
1348
|
+
|
|
1349
|
+
Action button. Use `render={<a href="…" />}` with `nativeButton={false}` to style a link as a button.
|
|
1231
1350
|
|
|
1232
1351
|
```tsx
|
|
1233
|
-
import {
|
|
1352
|
+
import { Button } from '@optimum-intelligence/opti-ui';
|
|
1353
|
+
```
|
|
1354
|
+
|
|
1355
|
+
```tsx
|
|
1356
|
+
<Button variant="secondary" loading={saving} onClick={save}>Save</Button>
|
|
1234
1357
|
```
|
|
1235
1358
|
|
|
1236
1359
|
| Prop | Type | Default | Description |
|
|
1237
1360
|
| --- | --- | --- | --- |
|
|
1238
|
-
| `
|
|
1239
|
-
| `
|
|
1240
|
-
| `
|
|
1241
|
-
| `
|
|
1242
|
-
| `
|
|
1243
|
-
| `toggleLabel?` | `string` | `'Show password'` | Accessible name of the show/hide button. |
|
|
1361
|
+
| `variant?` | `'primary' \| 'accent' \| 'secondary' \| 'soft' \| 'ghost' \| 'danger'` | `'primary'` | Visual emphasis. |
|
|
1362
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and padding. |
|
|
1363
|
+
| `shape?` | `'pill' \| 'rounded'` | `'pill'` | `pill` (default) or `rounded` corners. Override with `--oui-button-radius`. |
|
|
1364
|
+
| `fullWidth?` | `boolean` | | Stretch to the container width. |
|
|
1365
|
+
| `loading?` | `boolean` | | Shows a spinner and blocks interaction while keeping focus. |
|
|
1244
1366
|
|
|
1245
|
-
Also accepts all props of: `
|
|
1367
|
+
Also accepts all props of: `BaseButton.Props`.
|
|
1246
1368
|
|
|
1247
|
-
##
|
|
1369
|
+
## ContextMenu
|
|
1248
1370
|
|
|
1249
|
-
|
|
1371
|
+
compound · Actions
|
|
1250
1372
|
|
|
1251
|
-
|
|
1373
|
+
Menu opened by right click or long press on `ContextMenu.Trigger`, which wraps
|
|
1374
|
+
the target area. The item parts are the same as `Menu`'s.
|
|
1252
1375
|
|
|
1253
1376
|
```tsx
|
|
1254
|
-
import {
|
|
1377
|
+
import { ContextMenu } from '@optimum-intelligence/opti-ui';
|
|
1255
1378
|
```
|
|
1256
1379
|
|
|
1380
|
+
### ContextMenu.Root
|
|
1257
1381
|
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
## RadioGroup
|
|
1382
|
+
Base UI `ContextMenu.Root` re-exported unchanged. See https://base-ui.com/react/components/context-menu.
|
|
1261
1383
|
|
|
1262
|
-
|
|
1384
|
+
### ContextMenu.Trigger
|
|
1263
1385
|
|
|
1264
|
-
|
|
1386
|
+
Base UI `ContextMenu.Trigger` re-exported unchanged. See https://base-ui.com/react/components/context-menu.
|
|
1265
1387
|
|
|
1266
|
-
|
|
1267
|
-
import { RadioGroup } from '@optimum-intelligence/opti-ui';
|
|
1268
|
-
```
|
|
1388
|
+
### ContextMenu.Content
|
|
1269
1389
|
|
|
1270
1390
|
| Prop | Type | Default | Description |
|
|
1271
1391
|
| --- | --- | --- | --- |
|
|
1272
|
-
| `
|
|
1392
|
+
| `positionerProps?` | `BaseContextMenu.Positioner.Props` | | Props for the positioner element that places the popup. |
|
|
1273
1393
|
|
|
1274
|
-
Also accepts all props of: `
|
|
1394
|
+
Also accepts all props of: `BaseContextMenu.Popup.Props`.
|
|
1275
1395
|
|
|
1276
|
-
|
|
1396
|
+
### ContextMenu.Item
|
|
1277
1397
|
|
|
1278
|
-
|
|
1398
|
+
### ContextMenu.LinkItem
|
|
1279
1399
|
|
|
1280
|
-
|
|
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.
|
|
1400
|
+
### ContextMenu.CheckboxItem
|
|
1283
1401
|
|
|
1284
|
-
|
|
1285
|
-
import { RangeCalendar } from '@optimum-intelligence/opti-ui';
|
|
1286
|
-
```
|
|
1402
|
+
### ContextMenu.RadioGroup
|
|
1287
1403
|
|
|
1288
|
-
|
|
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`. |
|
|
1404
|
+
### ContextMenu.RadioItem
|
|
1293
1405
|
|
|
1294
|
-
|
|
1406
|
+
### ContextMenu.Group
|
|
1295
1407
|
|
|
1296
|
-
|
|
1408
|
+
### ContextMenu.GroupLabel
|
|
1297
1409
|
|
|
1298
|
-
|
|
1410
|
+
### ContextMenu.Separator
|
|
1299
1411
|
|
|
1300
|
-
|
|
1412
|
+
### ContextMenu.SubmenuRoot
|
|
1413
|
+
|
|
1414
|
+
### ContextMenu.SubmenuTrigger
|
|
1415
|
+
|
|
1416
|
+
## IconButton
|
|
1417
|
+
|
|
1418
|
+
component · Actions
|
|
1419
|
+
|
|
1420
|
+
Square button for a single icon. Defaults to the compact ghost style.
|
|
1301
1421
|
|
|
1302
1422
|
```tsx
|
|
1303
|
-
import {
|
|
1423
|
+
import { IconButton } from '@optimum-intelligence/opti-ui';
|
|
1304
1424
|
```
|
|
1305
1425
|
|
|
1306
1426
|
| Prop | Type | Default | Description |
|
|
1307
1427
|
| --- | --- | --- | --- |
|
|
1308
|
-
| `
|
|
1309
|
-
| `
|
|
1310
|
-
| `
|
|
1311
|
-
| `
|
|
1312
|
-
| `
|
|
1313
|
-
| `icon?` | `React.ReactNode` | | Replaces the leading search icon. |
|
|
1428
|
+
| `variant?` | `'primary' \| 'accent' \| 'secondary' \| 'soft' \| 'ghost' \| 'danger'` | `'ghost'` | Visual emphasis. |
|
|
1429
|
+
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and padding. |
|
|
1430
|
+
| `loading?` | `boolean` | | Shows a spinner and blocks interaction while keeping focus. |
|
|
1431
|
+
| `aria-label` | `string` | | Required: icon-only buttons need an accessible name. |
|
|
1432
|
+
| `shape?` | `'rounded' \| 'circle'` | `'rounded'` | `rounded` square (default) or `circle`. |
|
|
1314
1433
|
|
|
1315
|
-
Also accepts all props of: `
|
|
1434
|
+
Also accepts all props of: `BaseButton.Props`.
|
|
1316
1435
|
|
|
1317
|
-
##
|
|
1436
|
+
## Menu
|
|
1318
1437
|
|
|
1319
|
-
compound ·
|
|
1438
|
+
compound · Actions
|
|
1320
1439
|
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
`Select.Item`, `Select.Group`, `Select.GroupLabel`, `Select.Separator`.
|
|
1440
|
+
Dropdown menu of actions. Compose `Menu.Root` › `Menu.Trigger` + `Menu.Content` › items.
|
|
1441
|
+
For nested menus use `Menu.SubmenuRoot` › `Menu.SubmenuTrigger` + `Menu.Content`.
|
|
1324
1442
|
|
|
1325
1443
|
```tsx
|
|
1326
|
-
import {
|
|
1444
|
+
import { Menu } from '@optimum-intelligence/opti-ui';
|
|
1327
1445
|
```
|
|
1328
1446
|
|
|
1447
|
+
### Menu.Root
|
|
1448
|
+
|
|
1449
|
+
Base UI `Menu.Root` re-exported unchanged. See https://base-ui.com/react/components/menu.
|
|
1450
|
+
|
|
1451
|
+
### Menu.Trigger
|
|
1452
|
+
|
|
1453
|
+
Base UI `Menu.Trigger` re-exported unchanged. See https://base-ui.com/react/components/menu.
|
|
1454
|
+
|
|
1455
|
+
### Menu.Content
|
|
1456
|
+
|
|
1329
1457
|
| Prop | Type | Default | Description |
|
|
1330
1458
|
| --- | --- | --- | --- |
|
|
1331
|
-
| `
|
|
1332
|
-
| `
|
|
1333
|
-
| `
|
|
1334
|
-
| `
|
|
1335
|
-
| `
|
|
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…). |
|
|
1459
|
+
| `side?` | `BaseMenu.Positioner.Props['side']` | | Which side of the trigger the menu opens on. |
|
|
1460
|
+
| `align?` | `BaseMenu.Positioner.Props['align']` | `'start'` | Alignment along that side. |
|
|
1461
|
+
| `sideOffset?` | `BaseMenu.Positioner.Props['sideOffset']` | `6` | Distance from the trigger in px. |
|
|
1462
|
+
| `alignOffset?` | `BaseMenu.Positioner.Props['alignOffset']` | | Shift along the alignment axis in px. |
|
|
1463
|
+
| `positionerProps?` | `BaseMenu.Positioner.Props` | | Props for the positioner element that places the popup. |
|
|
1339
1464
|
|
|
1340
|
-
Also accepts all props of: `
|
|
1465
|
+
Also accepts all props of: `BaseMenu.Popup.Props`.
|
|
1341
1466
|
|
|
1342
|
-
###
|
|
1467
|
+
### Menu.Item
|
|
1343
1468
|
|
|
1344
|
-
Base UI `Select.Root` re-exported unchanged. See https://base-ui.com/react/components/select.
|
|
1345
1469
|
|
|
1346
|
-
|
|
1470
|
+
Also accepts all props of: `BaseMenu.Item.Props`, `ItemExtras`.
|
|
1347
1471
|
|
|
1348
|
-
###
|
|
1472
|
+
### Menu.LinkItem
|
|
1349
1473
|
|
|
1350
|
-
The select button. Renders the value and chevron unless children are given.
|
|
1351
1474
|
|
|
1352
|
-
|
|
1353
|
-
| --- | --- | --- | --- |
|
|
1354
|
-
| `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
|
|
1355
|
-
| `placeholder?` | `React.ReactNode` | | Placeholder shown by the default value slot. |
|
|
1475
|
+
Also accepts all props of: `BaseMenu.LinkItem.Props`, `Omit<ItemExtras, 'danger'>`.
|
|
1356
1476
|
|
|
1357
|
-
|
|
1477
|
+
### Menu.CheckboxItem
|
|
1358
1478
|
|
|
1359
|
-
### Select.Value
|
|
1360
1479
|
|
|
1361
|
-
|
|
1480
|
+
Also accepts all props of: `BaseMenu.CheckboxItem.Props`, `Omit<ItemExtras, 'icon' \| 'danger'>`.
|
|
1362
1481
|
|
|
1363
|
-
|
|
1482
|
+
### Menu.RadioGroup
|
|
1364
1483
|
|
|
1365
|
-
|
|
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. |
|
|
1484
|
+
Base UI `Menu.RadioGroup` re-exported unchanged. See https://base-ui.com/react/components/menu.
|
|
1372
1485
|
|
|
1373
|
-
|
|
1486
|
+
### Menu.RadioItem
|
|
1374
1487
|
|
|
1375
|
-
### Select.Item
|
|
1376
1488
|
|
|
1377
|
-
|
|
1489
|
+
Also accepts all props of: `BaseMenu.RadioItem.Props`, `Omit<ItemExtras, 'icon' \| 'danger'>`.
|
|
1378
1490
|
|
|
1379
|
-
###
|
|
1491
|
+
### Menu.Group
|
|
1380
1492
|
|
|
1381
|
-
|
|
1493
|
+
Base UI `Menu.Group` re-exported unchanged. See https://base-ui.com/react/components/menu.
|
|
1382
1494
|
|
|
1383
|
-
|
|
1495
|
+
### Menu.GroupLabel
|
|
1384
1496
|
|
|
1385
|
-
|
|
1497
|
+
### Menu.Separator
|
|
1386
1498
|
|
|
1387
|
-
|
|
1499
|
+
### Menu.SubmenuRoot
|
|
1388
1500
|
|
|
1389
|
-
|
|
1390
|
-
import { Slider } from '@optimum-intelligence/opti-ui';
|
|
1391
|
-
```
|
|
1501
|
+
Base UI `Menu.SubmenuRoot` re-exported unchanged. See https://base-ui.com/react/components/menu.
|
|
1392
1502
|
|
|
1393
|
-
|
|
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). |
|
|
1503
|
+
### Menu.SubmenuTrigger
|
|
1398
1504
|
|
|
1399
|
-
Also accepts all props of: `BaseSlider.Root.Props`.
|
|
1400
1505
|
|
|
1401
|
-
|
|
1506
|
+
Also accepts all props of: `BaseMenu.SubmenuTrigger.Props`, `Omit<ItemExtras, 'shortcut' \| 'danger'>`.
|
|
1402
1507
|
|
|
1403
|
-
|
|
1508
|
+
## SegmentedControl
|
|
1404
1509
|
|
|
1405
|
-
|
|
1510
|
+
component · Actions
|
|
1406
1511
|
|
|
1407
|
-
|
|
1408
|
-
import { Switch } from '@optimum-intelligence/opti-ui';
|
|
1409
|
-
```
|
|
1512
|
+
Single-choice switcher (e.g. Day / Week / Month). Always keeps one value selected.
|
|
1410
1513
|
|
|
1411
1514
|
```tsx
|
|
1412
|
-
|
|
1515
|
+
import { SegmentedControl } from '@optimum-intelligence/opti-ui';
|
|
1413
1516
|
```
|
|
1414
1517
|
|
|
1518
|
+
| Prop | Type | Default | Description |
|
|
1519
|
+
| --- | --- | --- | --- |
|
|
1520
|
+
| `size?` | `'sm' \| 'md'` | `'md'` | Segment height. |
|
|
1521
|
+
| `variant?` | `'segmented' \| 'outline'` | | `segmented` renders a pill track like a tab switcher; `outline` separate buttons. |
|
|
1522
|
+
| `fullWidth?` | `boolean` | | Stretch segments to fill the width. |
|
|
1523
|
+
| `options` | `SegmentedControlOption[]` | | Segments to show. |
|
|
1524
|
+
| `value?` | `string` | | Selected option `value` (controlled). |
|
|
1525
|
+
| `defaultValue?` | `string` | | Initially selected option `value` when uncontrolled. |
|
|
1526
|
+
| `onValueChange?` | `(value: string) => void` | | Called with the new `value` when the selection changes. |
|
|
1415
1527
|
|
|
1416
|
-
Also accepts all props of: `
|
|
1528
|
+
Also accepts all props of: `BaseToggleGroup.Props`.
|
|
1417
1529
|
|
|
1418
|
-
##
|
|
1530
|
+
## Toggle
|
|
1419
1531
|
|
|
1420
|
-
component ·
|
|
1532
|
+
component · Actions
|
|
1421
1533
|
|
|
1422
|
-
|
|
1534
|
+
Two-state button (bold, pin, favourite…). Inside a ToggleGroup it acts as a segment.
|
|
1423
1535
|
|
|
1424
1536
|
```tsx
|
|
1425
|
-
import {
|
|
1537
|
+
import { Toggle } from '@optimum-intelligence/opti-ui';
|
|
1426
1538
|
```
|
|
1427
1539
|
|
|
1428
1540
|
| Prop | Type | Default | Description |
|
|
1429
1541
|
| --- | --- | --- | --- |
|
|
1430
|
-
| `
|
|
1431
|
-
| `autoResize?` | `boolean` | | Grow with content up to `maxRows` (uses CSS field-sizing where supported). |
|
|
1542
|
+
| `size?` | `'sm' \| 'md'` | `'md'` | Button height. |
|
|
1432
1543
|
|
|
1433
|
-
Also accepts all props of: `
|
|
1544
|
+
Also accepts all props of: `BaseToggle.Props`.
|
|
1434
1545
|
|
|
1435
|
-
##
|
|
1546
|
+
## ToggleGroup
|
|
1436
1547
|
|
|
1437
|
-
component ·
|
|
1548
|
+
component · Actions
|
|
1438
1549
|
|
|
1439
|
-
|
|
1550
|
+
Group of `Toggle` buttons that share selection state (single or multiple).
|
|
1440
1551
|
|
|
1441
1552
|
```tsx
|
|
1442
|
-
import {
|
|
1553
|
+
import { ToggleGroup } from '@optimum-intelligence/opti-ui';
|
|
1443
1554
|
```
|
|
1444
1555
|
|
|
1445
1556
|
| Prop | Type | Default | Description |
|
|
1446
1557
|
| --- | --- | --- | --- |
|
|
1447
|
-
| `
|
|
1448
|
-
| `
|
|
1558
|
+
| `size?` | `'sm' \| 'md'` | `'md'` | Segment height. |
|
|
1559
|
+
| `variant?` | `'segmented' \| 'outline'` | `'segmented'` | `segmented` renders a pill track like a tab switcher; `outline` separate buttons. |
|
|
1560
|
+
| `fullWidth?` | `boolean` | | Stretch segments to fill the width. |
|
|
1449
1561
|
|
|
1450
|
-
Also accepts all props of: `
|
|
1562
|
+
Also accepts all props of: `BaseToggleGroup.Props`.
|
|
1451
1563
|
|
|
1452
|
-
##
|
|
1564
|
+
## Toolbar
|
|
1453
1565
|
|
|
1454
|
-
|
|
1566
|
+
compound · Actions
|
|
1455
1567
|
|
|
1456
|
-
|
|
1568
|
+
Row of controls that is a single tab stop; arrow keys move between them.
|
|
1569
|
+
Other controls join through `render`: `<Toolbar.Button render={<Toggle />} />`,
|
|
1570
|
+
`<Toolbar.Button render={<Menu.Trigger />} />`.
|
|
1457
1571
|
|
|
1458
1572
|
```tsx
|
|
1459
|
-
import {
|
|
1573
|
+
import { Toolbar } from '@optimum-intelligence/opti-ui';
|
|
1460
1574
|
```
|
|
1461
1575
|
|
|
1462
|
-
|
|
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. |
|
|
1576
|
+
### Toolbar.Root
|
|
1467
1577
|
|
|
1468
|
-
|
|
1578
|
+
### Toolbar.Button
|
|
1579
|
+
|
|
1580
|
+
### Toolbar.Link
|
|
1581
|
+
|
|
1582
|
+
### Toolbar.Group
|
|
1583
|
+
|
|
1584
|
+
### Toolbar.Separator
|
|
1585
|
+
|
|
1586
|
+
### Toolbar.Input
|
|
1469
1587
|
|
|
1470
1588
|
# Overlays
|
|
1471
1589
|
|
|
@@ -2046,7 +2164,7 @@ import { Badge } from '@optimum-intelligence/opti-ui';
|
|
|
2046
2164
|
```
|
|
2047
2165
|
|
|
2048
2166
|
```tsx
|
|
2049
|
-
<Badge tone="success"
|
|
2167
|
+
<Badge tone="success">Online</Badge>
|
|
2050
2168
|
```
|
|
2051
2169
|
|
|
2052
2170
|
| Prop | Type | Default | Description |
|
|
@@ -2054,7 +2172,6 @@ import { Badge } from '@optimum-intelligence/opti-ui';
|
|
|
2054
2172
|
| `tone?` | `'neutral' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Semantic color. |
|
|
2055
2173
|
| `variant?` | `'soft' \| 'solid' \| 'outline'` | `'soft'` | `soft` tinted, `solid` filled, `outline` bordered. |
|
|
2056
2174
|
| `size?` | `'sm' \| 'md'` | `'md'` | Badge height and text size. |
|
|
2057
|
-
| `dot?` | `boolean` | | Leading status dot. |
|
|
2058
2175
|
|
|
2059
2176
|
Also accepts all props of: `useRender.ComponentProps<'span', BadgeState>`.
|
|
2060
2177
|
|
|
@@ -2318,7 +2435,7 @@ import { Table } from '@optimum-intelligence/opti-ui';
|
|
|
2318
2435
|
| Prop | Type | Default | Description |
|
|
2319
2436
|
| --- | --- | --- | --- |
|
|
2320
2437
|
| `ref?` | `React.Ref<HTMLTableElement>` | | Ref to the `<table>`. |
|
|
2321
|
-
| `density?` | `'compact' \| 'normal' \| 'comfortable'` | `'normal'` | Row height. |
|
|
2438
|
+
| `density?` | `'compact' \| 'normal' \| 'comfortable'` | `'normal'` | Row height and cell padding. `normal` suits data-heavy screens; `comfortable` adds air for short tables. |
|
|
2322
2439
|
| `striped?` | `boolean` | | Alternating row background. |
|
|
2323
2440
|
| `hoverable?` | `boolean` | `true` | Highlight rows on hover. |
|
|
2324
2441
|
| `stickyHeader?` | `boolean` | | Keep the header visible while the wrapper scrolls (set a max height on it). |
|