Reference
Nodes
Components
Input

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

PropisVisible
Typeboolean
Defaulttrue

Whether or not this node is visible.

Enabled

PropisEnabled
Typeboolean
Defaulttrue

Whether or not this node is enabled.

Tooltip

Proptooltip
Typestring
Defaultundefined

The tooltip text to display when hovered or focused over this node.

Top

Proptop
Typenumber
Default1

The position of the node from the top side of the grid (grid-row-start).

Left

Propleft
Typenumber
Default1

The position of the node from the left side of the grid (grid-column-start).

Width

Propwidth
Typestring
Default232px

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

PropminWidth
Typestring
Defaultundefined

The minimum width of the node. When this node is in a grid layout, this property is ignored.

Max Width

PropmaxWidth
Typestring
Defaultundefined

The maximum width of the node. When this node is in a grid layout, this property is ignored.

Height

Propheight
Typestring
Default64px

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

PropminHeight
Typestring
Defaultundefined

The minimum height of the node. When this node is in a grid layout, this property is ignored.

Max Height

PropmaxHeight
Typestring
Defaultundefined

The minimum height of the node. When this node is in a grid layout, this property is ignored.

Overflow

Propoverflow
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the horizontal and vertical axes for content that is larger than its container.

Overflow X

PropoverflowX
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the horizontal axis for content that is larger than its container.

Overflow Y

PropoverflowY
TypeOverflow ('auto' | 'visible' | 'hidden' | 'scroll')
Defaultauto

The strategy used to handle overflow in the vertical axis for content that is larger than its container.

Custom Styles

Propstyles
Typestring
Default::component { }

Custom CSS styles to be applied to the node. Use element.styles to refer to the current node.

Object Fit

PropobjectFit
TypeObjectFit ('none' | 'contain' | 'cover' | 'fill' | 'scale-down')
Defaultcover

The strategy used to set how the content of a replaced element should be resized to fit its container.

Field Name

PropformFieldName
Typestring
Defaultundefined

Defines the key for this input in the body of the submitted form.

Label

Proplabel
Typestring
DefaultEnter value

The label to be displayed alongside the input.

Label Style

ProplabelStyle
TypeLabelStyle ('left' | 'top' | 'hidden' | 'right')
Defaulttop

The display style of the label next to the input.

Label Width

ProplabelWidth
Typestring
Default35%

The width of the label.

Type

Proptype
TypeHTMLInputType ('text' | 'email' | 'number' | 'password' | 'textarea')
Defaulttext

The HTML type value for the input element.

Value

Propvalue
Typestring
Defaultundefined

The current value of the input element.

Placeholder

Propplaceholder
Typestring
Defaultundefined

The placeholder value to display when no text has been entered.

Required

PropisRequired
Typeboolean
Defaultfalse

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

PropisClearable
Typeboolean
Defaultfalse

Whether or not the input can be cleared.

Prefix

Propprefix
Typestring
Defaultundefined

The text to display before the user's input text. This text will not be considered part of the value.

Prefix Color

PropprefixColor
Typestring
Defaulttext.muted

The color of the prefix.

Suffix

Propsuffix
Typestring
Defaultundefined

The text to display after the user's input text. This text will not be considered part of the value.

Suffix Color

PropsuffixColor
Typestring
Defaulttext.muted

The color of the suffix

Left Accessory

PropaccessoryLeft
TypeAccessoryType ('none' | 'button' | 'icon')
Defaultnone

The accessory to display on the left side of the input control.

Left Accessory Icon

PropaccessoryLeftIcon
Typestring
Defaultundefined

The icon to display as the left accessory.

Left Accessory Label

PropaccessoryLeftLabel
Typestring
DefaultClick

The text to display on the left accessory.

Left Accessory Color

PropaccessoryLeftColor
Typestring
Defaulttext.muted

The color of the left accessory.

Right Accessory

PropaccessoryRight
TypeAccessoryType ('none' | 'button' | 'icon')
Defaultnone

The accessory to display on the right side of the input control.

Right Accessory Icon

PropaccessoryRightIcon
Typestring
Defaultundefined

The icon to display as the right accessory.

Right Accessory Label

PropaccessoryRightLabel
Typestring
DefaultClick

The text to display on the right accessory.

Right Accessory Color

PropaccessoryRightColor
Typestring
Defaulttext.muted

The color of the right accessory.

Font Size

PropfontSize
TypeFontSize ('xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl')
Defaultmd

The font size of the input text. This can either be CSS measurement values like 12px or theme tokens like md.

Text Align

ProptextAlign
TypeTextAlign ('left' | 'right' | 'center')
Defaultleft

The alignment of the text within the input element.

Background Color

PropbackgroundColor
Typestring
Defaultinput.background

The background color of the input.

Label Color

ProplabelColor
Typestring
Defaulttext.primary

The color of the label text.

Input Color

PropinputColor
Typestring
Defaulttext.primary

The color of the input text.

Placeholder Color

PropplaceholderColor
Typestring
Defaultinput.placeholder

The color of the placeholder text.

Event Handlers

On Click

HandlerinputNode.onClick

Called when the user clicks the node. Use this event to trigger downstream actions when this node is clicked.

On Double Click

HandlerinputNode.onDoubleClick

Called when the user double clicks the node. Use this event to trigger downstream actions when this node is double clicked.

On Hover

HandlerinputNode.onHover

Called when the user hovers on the node. Use this event to trigger downstream actions when this node is hovered.

On Leave

HandlerinputNode.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

HandlerinputNode.onFocus

Called when the user focuses the node. Use this event to trigger downstream actions when this node is focused.

On Blur

HandlerinputNode.onBlur

Called when the user blurs the node. Use this event to trigger downstream actions when this node is blurred.