Skip to main content

InputField

An input box with an associated label, error message, and context help. See also:

Features

Live example

Result
Loading...
Live Editor
<div
  style={{ display: "inline-flex", flexDirection: "column", alignItems: "end" }}
>
  <InputField
    label="Label:"
    placeholder="Placeholder"
    contextHelp="Context help"
  />
  <br />
  <InputField
    label="Error:"
    validationState="error"
    placeholder="Error shown on hover"
    validationMessage="Error message"
  />
  <br />
  <InputField
    label="Warning:"
    validationState="warning"
    placeholder="Warning shown on hover"
    validationMessage="Warning message"
  />
  <br />

  <InputField label="Label above:" labelPlacement="above" />
</div>

Label Alignment

Use LabeledControlsAlignmentProvider to align InputField with other labeled controls, according to the design guidelines.

Result
Loading...
Live Editor
<LabeledControlsAlignmentProvider>
  <div
    style={{
      display: "flex",
      flexDirection: "column",
      gap: "1rem",
      width: 400,
    }}
  >
    <InputField label="Host name:" />
    <ComboBox label="Port number:">
      <Item key="80">80</Item>
    </ComboBox>
  </div>
</LabeledControlsAlignmentProvider>