Input.InputBox

View Source

A base component used in Input as well as SegmentedControl, Select, and TokenInput.

Props

Accepts StackView props.

Changes background color of the input. Both theme colors and html values are supported.

childrenReactNode

Typically accepts a form control like input or Input.InputField.

disabledboolean

Adds disabled styling. Please note this does not disable functionality and the respective child component should handle disabling interactions.

Uses an even amount of padding based on the vertical padding of the computed size prop.

Which child index should be focused when the focus method is called.

Determines if a child should be focused when InputBox receives focus. This is mostly useful for the Input and TokenInput components. Other components like Select set this to false.

idstring | number

Used to identify an input.

Adds a spacing prop to the internal StackView based on the padding size calculated from size prop.

innerRefRefCallback

Gain access to the internal ref

isLoadingboolean

Renders a Spinner at the end of the input box. Overrides renderRight and onClear when provided.

nakedboolean

Removes stroke or background styling.

onClear(event?: MouseEvent<HTMLButtonElement>) => void
readOnlyboolean
renderLeftunknown | ReactElement

Allows rendering any content inside the beginning of the input box.

renderRightunknown | ReactElement

Allows rendering any content inside the end of the input box.

Applies dropshadow while focusing on an input. (Defaults to true).

size'xs' | 'sm' | 'md' | 'lg' | 'xl'

Size of the input padding, font-size, and line-height. Based on theming sizes.

state'error' | 'success'

State of the input. Useful for responding to user input and showing error and success states.

subduedboolean

Applies subdued styling when using InputBox as a secondary element.

tabIndexnumber

Determines where in the tab order the input should be placed for focused. (Defaults to -1).