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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQAumujy5kXaOKurr6zgTP2krHrFVXi2kj8seRYrlvq2GssUjReh5MiVpQbLFQNy9HsmcasqpBNVsXytWTw0ZDjA=

Input

import * as Input from '@dxos/react-ui/Input';

Input holds the controls of a form: text fields, checkboxes, switches and sliders, and the frame they sit in. Field gives a control its label, help text and error, and Select picks one value from a list.

import * as
import Field
Field
from '@dxos/react-ui/Field';
import * as
import Icon
Icon
from '@dxos/react-ui/Icon';
import * as
import Input
Input
from '@dxos/react-ui/Input';
import * as
import Layout
Layout
from '@dxos/react-ui/Layout';
import * as
import Select
Select
from '@dxos/react-ui/Select';
export const
const Inputs: () => React.JSX.Element
Inputs
= () => (
<
import Layout
Layout
.
const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

One-axis layout box: the primitive that replaces hand-written flex … wrapper divs.

gap is restricted to the named steps of the theme spacing ramp (see

Gap

), which is the point of the prop — an off-ramp gap-2/gap-3 literal in a container is the drift it prevents. Anything the props don't cover (padding, sizing, overflow, colour) goes through classNames; the component deliberately grows no padding or colour props, since components own their own spacing.

There is no implicit align. Row-centering is the common case, but defaulting it would silently restyle any consumer relying on the CSS stretch initial value.

Use asChild to project the layout onto a semantic element (<header>, <ul>, <a>).

@example

<Flex column gap='sm'>…</Flex>
<Flex gap='sm' justify='end'>…</Flex>
<Flex center classNames='h-full text-fg-subtle' role='status'>{t('empty.message')}</Flex>

Flex
column?: boolean | undefined

Stack on the block axis instead of the inline axis.

column
gap?: Layout.Gap | undefined
gap
='form'>
<
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
<
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

Label
>Name</
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

Label
>
<
import Input
Input
.
const Root: React.ForwardRefExoticComponent<Omit<Input.RootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLInputElement>>
export Root

Text input at control size; inside a Field.Root it takes the field's id, label and description wiring. With start or end it renders a ControlFrame holding the adornments and a bare input; data-testid and classes then go to the frame, the ref to the input.

Root
placeholder?: string | undefined
placeholder
='Ada Lovelace' />
</
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
<
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
<
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

Label
>Email</
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

Label
>
<
import Input
Input
.
const Root: React.ForwardRefExoticComponent<Omit<Input.RootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLInputElement>>
export Root

Text input at control size; inside a Field.Root it takes the field's id, label and description wiring. With start or end it renders a ControlFrame holding the adornments and a bare input; data-testid and classes then go to the frame, the ref to the input.

Root
type?: React.HTMLInputTypeAttribute | undefined
type
='email'
'start'?: React.ReactNode

Leading content inside the control row (an Icon, or short text such as a currency).

start
={<
import Icon
Icon
.
const Icon: React.ForwardRefExoticComponent<Omit<Omit<React.SVGProps<SVGSVGElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
icon: string;
label?: string;
hue?: Icon.IconHue;
valence?: Icon.IconValence;
tone?: Icon.IconTone;
spin?: boolean;
size?: Size;
} & React.RefAttributes<SVGSVGElement>>
Icon
icon: string
icon
='ph--envelope--regular' />}
/>
</
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
<
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
<
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

Label
>Role</
import Field
Field
.
const Label: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
srOnly?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Label

Names the control; while the root is required it ends with the required indicator, unless a RequiredIndicator among its children places the mark itself.

Label
>
<
import Select
Select
.
const Root: React.ForwardRefExoticComponent<Omit<Omit<SelectRootProps<Select.Option>, "collection" | "positioning">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
items: Select.Option[];
positioning?: Select.Positioning;
} & React.RefAttributes<HTMLDivElement>>
export Root

Ark select over a flat option list (grouped in the popup with ItemGroup); the root takes no box so its trigger is laid out as the parent's child. multiple keeps the popup open while choosing. The popup is at least as wide as the trigger and grows to fit its widest option, up to the viewport's width.

Root
items: Select.Option[]
items
={
const ROLES: Select.Option[]
ROLES
}>
<
import Select
Select
.
const Trigger: React.ForwardRefExoticComponent<Omit<Omit<SelectTriggerProps, "children">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
placeholder?: string;
loading?: boolean;
fixed?: boolean;
tag?: boolean;
icon?: string;
} & React.RefAttributes<HTMLButtonElement>>
export Trigger

Shows the chosen option (its icon when exactly one is chosen; multiple lists the labels) and a caret.

Trigger
placeholder?: string | undefined
placeholder
='Choose a role' />
<
import Select
Select
.
const Content: React.ForwardRefExoticComponent<Omit<SelectContentProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
size?: Size;
container?: React.RefObject<HTMLElement | null>;
} & React.RefAttributes<HTMLDivElement>>
export Content

Portalled listbox at level='popup', scrolling in a thin ScrollArea whose viewport is the listbox itself.

Content
>
{
const ROLES: Select.Option[]
ROLES
.
Array<SelectOption>.map<React.JSX.Element>(callbackfn: (value: Select.Option, index: number, array: Select.Option[]) => React.JSX.Element, thisArg?: any): React.JSX.Element[]

Calls a defined callback function on each element of an array, and returns an array that contains the results.

@param ― callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

@param ― thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

map
((
item: Select.Option
item
) => (
<
import Select
Select
.
const Item: React.ForwardRefExoticComponent<Omit<Omit<SelectItemProps, "children" | "item">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
item: Select.Option;
children?: React.ReactNode;
} & React.RefAttributes<HTMLDivElement>>
export Item

A block-tall row: without children, the option's icon, its label and the check shown while it is selected.

Item
React.Attributes.key?: React.Key | null | undefined
key
={
item: Select.Option
item
.
value: string
value
}
item: Select.Option
item
={
item: Select.Option
item
} />
))}
</
import Select
Select
.
const Content: React.ForwardRefExoticComponent<Omit<SelectContentProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
size?: Size;
container?: React.RefObject<HTMLElement | null>;
} & React.RefAttributes<HTMLDivElement>>
export Content

Portalled listbox at level='popup', scrolling in a thin ScrollArea whose viewport is the listbox itself.

Content
>
</
import Select
Select
.
const Root: React.ForwardRefExoticComponent<Omit<Omit<SelectRootProps<Select.Option>, "collection" | "positioning">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
items: Select.Option[];
positioning?: Select.Positioning;
} & React.RefAttributes<HTMLDivElement>>
export Root

Ark select over a flat option list (grouped in the popup with ItemGroup); the root takes no box so its trigger is laid out as the parent's child. multiple keeps the popup open while choosing. The popup is at least as wide as the trigger and grows to fit its widest option, up to the viewport's width.

Root
>
</
import Field
Field
.
const Root: React.ForwardRefExoticComponent<Omit<FieldRootProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
validationValence?: Field.Valence;
layout?: "stack" | "row" | "inline";
level?: Layout.Level;
span?: Layout.Span;
tone?: "muted";
} & React.RefAttributes<HTMLDivElement>>
export Root

A part, not a container (decision 13): a flex stack in the content track with the label above its control.

Root
>
<
import Input
Input
.
const Checkbox: React.ForwardRefExoticComponent<Omit<Omit<CheckboxRootProps, "children">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
label?: React.ReactNode;
'aria-label'?: string;
} & React.RefAttributes<HTMLLabelElement>>
export Checkbox

Ark checkbox with its box at control size; the root is a block-tall row so it lines up with other controls.

Checkbox
label?: React.ReactNode

Visible label beside the box; without one pass aria-label.

label
='Send an invitation'
defaultChecked?: CheckedState | undefined

The initial checked state of the checkbox when rendered. Use when you don't need to control the checked state of the checkbox.

defaultChecked
/>
<
import Input
Input
.
const Switch: React.ForwardRefExoticComponent<Omit<Omit<SwitchRootProps, "children">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
label?: React.ReactNode;
'aria-label'?: string;
indeterminate?: boolean;
} & React.RefAttributes<HTMLLabelElement>>
export Switch

Ark switch with an icon-tall track; the root is a block-tall row so it lines up with other controls. In a Toolbar its input joins the roving focus.

Switch
label?: string | (string & React.ReactElement<unknown, string | React.JSXElementConstructor<any>>) | (string & Iterable<React.ReactNode>) | (string & React.ReactPortal) | (string & Promise<AwaitedReactNode>) | undefined

Specifies the localized strings that identifies the accessibility elements and their states

Visible label beside the track; without one pass aria-label.

label
='Notifications' />
</
import Layout
Layout
.
const Flex: React.ForwardRefExoticComponent<Omit<Layout.FlexProps & {
asChild?: boolean;
}, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>

One-axis layout box: the primitive that replaces hand-written flex … wrapper divs.

gap is restricted to the named steps of the theme spacing ramp (see

Gap

), which is the point of the prop — an off-ramp gap-2/gap-3 literal in a container is the drift it prevents. Anything the props don't cover (padding, sizing, overflow, colour) goes through classNames; the component deliberately grows no padding or colour props, since components own their own spacing.

There is no implicit align. Row-centering is the common case, but defaulting it would silently restyle any consumer relying on the CSS stretch initial value.

Use asChild to project the layout onto a semantic element (<header>, <ul>, <a>).

@example

<Flex column gap='sm'>…</Flex>
<Flex gap='sm' justify='end'>…</Flex>
<Flex center classNames='h-full text-fg-subtle' role='status'>{t('empty.message')}</Flex>

Flex
>
);
Part What it is
Input.Root A text input
Input.Textarea A multi-line text input
Input.Number A number input, with steppers
Input.Password A password input, with a button to show it
Input.Pin A code of several single-character boxes
Input.Date An input for a date, a time, or both
Input.Checkbox A checkbox. label sets its visible label
Input.Switch An on/off switch. label sets its visible label, and indeterminate shows a mixed state
Input.Slider A value on a range
Input.Frame The frame a control sits in, for building a control of your own

Input.Root takes the props of an <input>, plus:

Prop Type Effect
start ReactNode Shows content before the text, such as an icon or a currency
end ReactNode Shows content after the text, such as a unit or an icon button
copyable boolean Adds a button that copies the value. It replaces end
variant 'default' | 'subdued' | 'mono' Sets the look. subdued drops the well, and mono is for keys and ids
noAutoFill boolean Asks password managers not to offer to fill the input, such as for a search box

Inside a Field.Root, a control takes the field’s id, label and description, so it needs no aria-label.