Input Component
Inputs are common form controls that allow the user to enter text values using their keyboard. This node roughly corresponds to the HTML input
and textarea
elements.
You'll often find inputs in forms that prompt for open-ended information from the user.
Properties
Visible
Prop | isVisible |
---|---|
Type | boolean |
Default | true |
Whether or not this node is visible.
Enabled
Prop | isEnabled |
---|---|
Type | boolean |
Default | true |
Whether or not this node is enabled.
Tooltip
Prop | tooltip |
---|---|
Type | string |
Default | undefined |
The tooltip text to display when hovered or focused over this node.
Top
Prop | top |
---|---|
Type | number |
Default | 1 |
The position of the node from the top side of the grid (grid-row-start
).
Left
Prop | left |
---|---|
Type | number |
Default | 1 |
The position of the node from the left side of the grid (grid-column-start
).
Width
Prop | width |
---|---|
Type | string |
Default | 232px |
The width of the node. When this node is in a grid layout, this should be done using unitless grid column units (specifying 4
will become grid-column-end: span 4
). When this node is in a stack layout, the width can be specified using CSS units (e.g. 100px
or 100%
), or be left unitless to be treated as flex-grow for the node.
Min Width
Prop | minWidth |
---|---|
Type | string |
Default | undefined |
The minimum width of the node. When this node is in a grid layout, this property is ignored.
Max Width
Prop | maxWidth |
---|---|
Type | string |
Default | undefined |
The maximum width of the node. When this node is in a grid layout, this property is ignored.
Height
Prop | height |
---|---|
Type | string |
Default | 64px |
The height of the node. When this node is in a grid layout, this should be done using unitless grid row units (specifying 4
will become grid-row-end: span 4
). When this node is in a stack layout, the height can be specified using CSS units (e.g. 100px
or 100%
), or be left unitless to be treated as flex-grow for the node.
Min Height
Prop | minHeight |
---|---|
Type | string |
Default | undefined |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Max Height
Prop | maxHeight |
---|---|
Type | string |
Default | undefined |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Overflow
Prop | overflow |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the horizontal and vertical axes for content that is larger than its container.
Overflow X
Prop | overflowX |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the horizontal axis for content that is larger than its container.
Overflow Y
Prop | overflowY |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the vertical axis for content that is larger than its container.
Custom Styles
Prop | styles |
---|---|
Type | string |
Default | ::component { } |
Custom CSS styles to be applied to the node. Use element.styles
to refer to the current node.
Object Fit
Prop | objectFit |
---|---|
Type | ObjectFit ('none' | 'contain' | 'cover' | 'fill' | 'scale-down') |
Default | cover |
The strategy used to set how the content of a replaced element should be resized to fit its container.
Field Name
Prop | formFieldName |
---|---|
Type | string |
Default | undefined |
Defines the key for this input in the body of the submitted form.
Label
Prop | label |
---|---|
Type | string |
Default | Enter value |
The label to be displayed alongside the input.
Label Style
Prop | labelStyle |
---|---|
Type | LabelStyle ('left' | 'top' | 'hidden' | 'right') |
Default | top |
The display style of the label next to the input.
Label Width
Prop | labelWidth |
---|---|
Type | string |
Default | 35% |
The width of the label.
Type
Prop | type |
---|---|
Type | HTMLInputType ('text' | 'email' | 'number' | 'password' | 'textarea') |
Default | text |
The HTML type
value for the input element.
Value
Prop | value |
---|---|
Type | string |
Default | undefined |
The current value of the input element.
Placeholder
Prop | placeholder |
---|---|
Type | string |
Default | undefined |
The placeholder value to display when no text has been entered.
Required
Prop | isRequired |
---|---|
Type | boolean |
Default | false |
Whether or not this input is required. This is a visual flag that updates the corresponding accessibility properties. It is up to the app developer to enforce the requirement.
Clearable
Prop | isClearable |
---|---|
Type | boolean |
Default | false |
Whether or not the input can be cleared.
Prefix
Prop | prefix |
---|---|
Type | string |
Default | undefined |
The text to display before the user's input text. This text will not be considered part of the value
.
Prefix Color
Prop | prefixColor |
---|---|
Type | string |
Default | text.muted |
The color of the prefix.
Suffix
Prop | suffix |
---|---|
Type | string |
Default | undefined |
The text to display after the user's input text. This text will not be considered part of the value
.
Suffix Color
Prop | suffixColor |
---|---|
Type | string |
Default | text.muted |
The color of the suffix
Left Accessory
Prop | accessoryLeft |
---|---|
Type | AccessoryType ('none' | 'button' | 'icon') |
Default | none |
The accessory to display on the left side of the input control.
Left Accessory Icon
Prop | accessoryLeftIcon |
---|---|
Type | string |
Default | undefined |
The icon to display as the left accessory.
Left Accessory Label
Prop | accessoryLeftLabel |
---|---|
Type | string |
Default | Click |
The text to display on the left accessory.
Left Accessory Color
Prop | accessoryLeftColor |
---|---|
Type | string |
Default | text.muted |
The color of the left accessory.
Right Accessory
Prop | accessoryRight |
---|---|
Type | AccessoryType ('none' | 'button' | 'icon') |
Default | none |
The accessory to display on the right side of the input control.
Right Accessory Icon
Prop | accessoryRightIcon |
---|---|
Type | string |
Default | undefined |
The icon to display as the right accessory.
Right Accessory Label
Prop | accessoryRightLabel |
---|---|
Type | string |
Default | Click |
The text to display on the right accessory.
Right Accessory Color
Prop | accessoryRightColor |
---|---|
Type | string |
Default | text.muted |
The color of the right accessory.
Font Size
Prop | fontSize |
---|---|
Type | FontSize ('xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl') |
Default | md |
The font size of the input text. This can either be CSS measurement values like 12px
or theme tokens like md
.
Text Align
Prop | textAlign |
---|---|
Type | TextAlign ('left' | 'right' | 'center') |
Default | left |
The alignment of the text within the input element.
Background Color
Prop | backgroundColor |
---|---|
Type | string |
Default | input.background |
The background color of the input.
Label Color
Prop | labelColor |
---|---|
Type | string |
Default | text.primary |
The color of the label text.
Input Color
Prop | inputColor |
---|---|
Type | string |
Default | text.primary |
The color of the input text.
Placeholder Color
Prop | placeholderColor |
---|---|
Type | string |
Default | input.placeholder |
The color of the placeholder text.
Event Handlers
On Click
Handler | inputNode.onClick |
---|
Called when the user clicks the node. Use this event to trigger downstream actions when this node is clicked.
On Double Click
Handler | inputNode.onDoubleClick |
---|
Called when the user double clicks the node. Use this event to trigger downstream actions when this node is double clicked.
On Hover
Handler | inputNode.onHover |
---|
Called when the user hovers on the node. Use this event to trigger downstream actions when this node is hovered.
On Leave
Handler | inputNode.onLeave |
---|
Called when the user is not hovering over the node. Use this event to trigger downstream actions when this node is no longer hovered.
On Focus
Handler | inputNode.onFocus |
---|
Called when the user focuses the node. Use this event to trigger downstream actions when this node is focused.
On Blur
Handler | inputNode.onBlur |
---|
Called when the user blurs the node. Use this event to trigger downstream actions when this node is blurred.