In Review

Text Input

The TextInput component is used to allow users to enter single-line text, with options to adjust the width dynamically using halfFluid, fullFluid, or characterWidth. It can be used with prefixes, suffixes, and error states for flexible form input scenarios.

Variants

Default

<label
  for="input-id"
  class="gi-text-md gi-mb-1 gi-block gi-mb-2">
  Label
</label>
<div class="gi-flex gi-items-center ">
  <input
    id="input-id"
    data-testid="textbox"
    type="text"
    autocomplete="on"
    class="gi-border-gray-950 gi-w-1/2 gi-flex-initial gi-border-sm gi-border-solid gi-box-border gi-h-10 gi-mt-0 gi-p-1 gi-z-1 xs:gi-text-md gi-text-sm gi-leading-10 xs:!gi-leading-5 gi-focus-state-outline gi-focus-state-border gi-focus-state-outline gi-focus-state-border"
  />
</div>
{{ govieTextInput({
  "label": {
    "content": "Label",
    "for": "character-width-input"
  },
  "halfFluid": true,
  "characterWidth": 20,
  "id": "character-width-input"
}) }}
import { TextInput } from "@govie-ds/react";

<TextInput
  error={{
    text: ''
  }}
  halfFluid
  hint={{
    text: ''
  }}
  id="text-input-id"
  label={{
    htmlFor: 'text-input-id',
    text: 'Input Label'
  }}
/>

Usage

Best Practices

When to Use This Component

When Not to Use This Component

Status

Figma Library
Considering
Local HTML
Stable
Global HTML
Beta
Global React
Beta