Browse Components

Components

Input

Text inputs allow your users to enter letters, numbers and symbols on a single line.

DesignUsageAccessibilityUpdates

Purpose

Collect short text

Use text inputs for single-line values such as names, references, and search terms.

Show validation clearly

Built-in states help users see errors, warnings, and successful entries.

Keep guidance near the field

Labels, hint text, and feedback stay close to the input they explain.

Anatomy

1

Label

2

Leading icon

3

Hint text

4

Prefix

5

Value

6

Password icon

7

Suffix

8

Trailing icon

9

Action - Icon button

10

Input container

Configuration

Hint text

Use hint text to clarify the expected value.

Default. Use when the label alone is enough.

Input type

Use the appropriate type so the browser can apply the right keyboard and validation.

Standard single-line text input.

Placeholder

Provide a placeholder hint for the kind of value to enter.

Empty input with no inline helper.

Icon

Use the icon slot to add a leading icon for visual context.

Default input without a leading icon.

Read-only

Display a value that the user can read and copy but not edit.

Default editable input.

Disabled

Disable the input to prevent it from being edited or focused.

Default interactive state.

Validation feedback

Show error styling and a feedback message when the input is invalid.

No feedback is shown.

Prefix and suffix

Prefix and suffix text add fixed context to the value users enter.

Use when the unit or symbol is part of understanding the value.

Character count and length

Use character count with minimum or maximum length requirements when input length matters.

Use character count to help users stay within a length limit.

Required

Mark an input as required when the form cannot be completed without a value.

Use optional inputs only when the value is not needed.

Loading and valid

Inputs can show asynchronous checking and successful validation states.

Use loading while checking a value against a service.

Slots

Trailing icon and action slots add contextual controls to the input.

Use a trailing icon for a passive visual cue or status icon.

Number constraints

Number inputs support minimum, maximum, and step constraints.

Use min, max, and step when numeric values must stay within a known range.

Structure

Design tokens used

Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.

CategoryTokenValueWhere it's usedGapsgds-gap-sm12pxSpacing between items of the form control rowsgds-gap-xs8pxSpacing between items of the form control suffixSizesgds-dimension-160Minimum width of items inside the componentsgds-icon-size-mdSize of the interactive icon inside the inputBordersgds-form-border-radius-mdCorner radius of items inside the componentOutlinesgds-form-outline-focusFocus outline of the sgds icon when keyboard-focused

Usage

When to use

  • Use input for short, direct responses such as search terms, names, or reference values.
  • Use it when users know what they need to type and the expected value is brief.

When not to use

  • Do not use input for longer responses that need multiple lines.
  • Do not rely on placeholder text in place of a clear field label.

Best practices

Use a clear, persistent label

Always pair the input with a visible label so users know what to enter, even after they have typed.

Do not rely on placeholder text as the only label

Placeholder text disappears once users type. Keep the label visible above the field at all times.

Match the input type to the value being collected

Use type=email, type=number, or type=password so the browser provides the right keyboard and validation.

Do not use type=number for identifiers like NRIC or phone numbers

type=number strips leading zeros and exposes spinners that do not fit IDs. Use type=text and validate.

Accessibility considerations

Built-in accessibility

  • Inputs render native input controls and connect labels, hint text, and feedback to the control.
  • The component supports disabled, readonly, required, invalid, and feedback states.

Labels and content

  • Use a visible label that tells users what to enter.
  • Place format requirements in hint text before validation happens.

Focus and interaction

  • Focus should move to the input before any suffix or supporting controls.
  • Keep validation feedback close to the input it describes.

Keyboard interaction

KeyInteractionTabMoves focus from the input to the next focusable element.Shift+TabMoves focus to the previous interactive element.Text keysEnters or edits the input value.

Updates

DateVersionDescription03 Feb 2026v3.9.0Fix/input default value not captured in #538.18 Dec 2025v3.6.0New datetime-local type in #488.06 Oct 2025v3.5.0New custom validation with `noValidate` prop @clukhei in #400.29 Aug 2025v3.3.0Styling updates to readonly input in #298.27 Jun 2025v3.0.6Fix/bug in input touch validation in #247.

Roadmap

Planned itemStatusTargetFuture enhancements for inputPlannedTBD

Feedback

Have suggestions or feedback?

Share them with us on Slack → #ask-sgds-v3

Bug Reports

Found a bug or issue?

Report it on GitHub Issues → sgds/components/input

Singapore Government Design System

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Past VersionsSGDS v1SGDS v2