Inputs

Field

Label, description and validation around any control. Horizontal layout for settings rows; FieldActions puts a form's own controls on one line under its fields.

Live example

Import

Each family is its own entry point, so a page loads only what it uses.

tsx
import { Button } from "@nibapp/ui/components/button";import { Checkbox, CheckboxGroup } from "@nibapp/ui/components/checkbox";import { Field, FieldActions, FieldDescription, FieldItem, FieldRoot, Fieldset, FieldsetLegend } from "@nibapp/ui/components/field";import { Input } from "@nibapp/ui/components/input";import { Select } from "@nibapp/ui/components/select";import { Switch } from "@nibapp/ui/components/switch";import { Textarea } from "@nibapp/ui/components/textarea";

Props

Each component's own props and variants, read from its source. What it also takes from an element or a Base UI part is named below its table.

Button

PropTypeDefaultDescription
variant"primary" | "secondary" | "ghost" | "quiet" | "danger" | "danger-ghost" | "link""secondary"
primary
Neutral ink: the main call to action. Actions are ink, never the accent.
secondary
Quiet surface with a hairline — the default for most actions.
ghost
No chrome until hovered — toolbars, inline actions.
quiet
Words that are also an action, in the text's own weight and laid out from the start, so they line up with the text around them: `xs` in a line (a header's crumbs, a title that renames), `sm` a toolbar's picker, `md` a row in a list or a popover ("Open settings", a sidebar's link).
danger
Destructive confirmation.
danger-ghost
Destructive but low emphasis.
link
Inline text action.
size"xs" | "sm" | "md" | "lg""md"
blockboolean—
truncateboolean—

The button may shrink below its label's width; the label then truncates with an ellipsis.

wrapboolean—

The label wraps onto more lines and the button grows, its `leading` icon on the first line: for words that are an action and may run long in another language (a tip). One line keeps the size.

loadingbooleanfalse

Shows a spinner, keeps the button's width, and blocks interaction.

leadingReactNode—

Icon rendered before the label.

trailingReactNode—

Icon or hint (e.g. <Kbd>) rendered after the label.

disabledReasonstring | undefined—

Disables the button and says why: the reason is its tooltip and its accessible description, and the button stays focusable (`aria-disabled`) so a keyboard reaches it.

Also takes .

Checkbox

Ink checkbox with a drawn-on check. Pass `label` for the common box + text composition.

PropTypeDefaultDescription
size"sm" | "md""md"
labelReactNode—

Visible label rendered to the right; clicking it toggles the box.

descriptionReactNode—

Secondary line under the label.

Also takes the props of Base UI's Checkbox.Root, except children.

CheckboxGroup

Shares a `string[]` value across child checkboxes (each needs a `value`).

PropTypeDefaultDescription
orientation"vertical" | "horizontal""vertical"

Also takes .

Field

Label + control + description + error in one.

PropTypeDefaultDescription
labelReactNode—
hintReactNode—

Muted trailing text in the label row — "Optional", a character count…

descriptionReactNode—
errorReactNode—

Forces the field invalid and shows this message. Omit to show the browser's validation message after Base UI validates the control.

orientation"vertical" | "horizontal""vertical"

`vertical` stacks label → control → description. `horizontal` puts the copy on the left and the control on the right — the settings-row layout for switches and compact selects.

nativeLabelbooleantrue

Set to `false` for button controls (Select, Combobox trigger) so clicking the label focuses rather than presses the trigger.

children (required)ReactNode—

Also takes the props of Base UI's Field.Root, except children.

FieldActions

Under a form's fields, the controls that complete it (a role, Send): on one line while the width holds them, wrapping onto the next when it doesn't, and lined up on their controls. A field in the row keeps its label and no description, so a hint can't push the others out of line: the hint belongs to the full-width field above.

Also takes the props of a <div> element.

FieldDescription

Also takes the props of Base UI's Field.Description.

FieldItem

One option inside a checkbox or radio group that sits within a Field.

Also takes the props of Base UI's Field.Item.

FieldRoot

Groups a control with its label, description and error. Every input in the kit works inside it.

Also takes the props of Base UI's Field.Root.

Fieldset

A titled group of fields (or of checkboxes/radios via `render={<CheckboxGroup />}`).

Also takes the props of Base UI's Fieldset.Root.

FieldsetLegend

Also takes the props of Base UI's Fieldset.Legend.

Input

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"
appearance"field" | "wash" | "bare""field"

`wash`: a resting field on chrome (a sidebar's search): ink over whatever is beneath and no border until it has focus, when it takes the field's surface. Paper's own surface reads yellow over light vibrancy.

bare
`bare`: text you edit in place, inside a heading or a card (a task's title): no chrome at rest and the surrounding type (size, weight, line height), a wash on hover and focus, and the focus halo. Touch screens still get at least 16 px, so iOS doesn't zoom.
leadingReactNode—

Icon, Kbd or IconButton rendered before the text.

trailingReactNode—

Icon, Kbd, unit or IconButton rendered after the text.

invalidboolean—

Marks the input invalid outside of a <Field> (inside one, Field drives it).

classNamestring | undefined—

Classes for the outer frame (width, margins…).

inputClassNameComponentProps<typeof BaseInput>["className"]—

Classes for the inner `<input>` element.

Also takes the props of Base UI's Input, except size and className.

Select

Single-value select from a list of options: `<Select items={models} defaultValue="opus" />`.

PropTypeDefaultDescription
variant"default" | "ghost""default"
default
Framed, matches Input.
ghost
Chromeless until hovered: toolbars, inline pickers ("Last 7 days ⌄").
size"sm" | "md" | "lg""md"
blockboolean—
items (required)readonly SelectEntry<Value>[]—

Flat options, or groups of options (separated automatically).

placeholderReactNode—
leadingReactNode—

Icon before the value in the trigger.

aria-labelstring—

Required when there's no visible <Field> label.

classNamestring | undefined—

Classes for the trigger.

contentClassNamestring | undefined—
sideSelectContentProps["side"]—
alignSelectContentProps["align"]—
alignItemWithTriggerboolean—

Also takes BaseSelect.Root.Props<Value>, except items, children and multiple.

Switch

Ink toggle with a springy thumb that stretches while pressed.

PropTypeDefaultDescription
size"sm" | "md""md"
sm
16 × 28 — dense rows, menus.
md
20 × 36 — settings rows.
labelReactNode—

Visible label to the right of the switch. For settings rows prefer <Field orientation="horizontal">.

descriptionReactNode—

Also takes the props of Base UI's Switch.Root, except children.

Textarea

Multi-line text field. Auto-grows with CSS `field-sizing: content` and falls back to measuring `scrollHeight` where unsupported. Works inside <Field> for labels and validation. What a person writes takes its direction from its first letter (`dir="auto"`), so an English note reads left to right in a right-to-left interface; pass `dir` to fix it.

PropTypeDefaultDescription
variant"default" | "bare""default"
default
Framed field, same chrome as Input.
bare
No chrome: embed inside a custom container, such as a message field with its own toolbar.
size"sm" | "md" | "lg""md"
refRef<HTMLTextAreaElement> | undefined—
valuestring—
defaultValuestring—
onValueChange(value: string) => void—

Fires with the new text on every edit.

autoGrowbooleantrue

Grow with content between `minRows` and `maxRows`. Default `true`.

minRowsnumber—

Minimum visible lines. Default 3 (1 for `bare`).

maxRowsnumber12

Maximum visible lines before scrolling. Default 12.

invalidboolean—

Marks the field invalid outside of a <Field>.

Also takes the props of a <textarea> element, except ref, rows, value and defaultValue.