GC Design System Components
Home Start to use Page templates overview Basic page Components overview Breadcrumbs Button Card Checkboxes Container Date input Date modified Details Error message Error summary Fieldset File uploader Footer Grid Header Heading Icon Input Language toggle Link Notice Pagination Radios Screenreader-only Search Select Side navigation Signature Stepper Text Textarea Theme and topic menu Top navigation CSS shortcuts overview Reset styles Responsive layout State Box sizing Container sizing Display Overflow Position Visibility Font Font family Font size Font style Font weight Line height Link colour Link size Link text decoration List style Text align Text colour Text overflow Text transform Word break Margin Padding Align content Align items Align self Flex Flex direction Flex grow Flex shrink Flex wrap Gap Grid columns Grid rows Justify content Justify items Justify self Order Place content Place items Place self Background colour Border colour Border radius Border style Border width Icon names Icon size Image Cursor Pointer events Transition Styles overview Design tokens Colour tokens Spacing tokens Typography tokens Contact us Get involved Find a demo

Input
<gcds-input>

Also called: text input, input field.

An input is a space to enter short-form information in response to a question or instruction.

Input component preview

Take a look at what inputs do to see if they fit the problem you're solving for. Then select the best input type for the use case you need to meet.

Problems inputs solve

Use an input to gather single-line information from a person when you're expecting a person will write:

  • An individual or unique response.
  • A short freeform response.
  • A response that needs constraints around text length or the format of the response.
  • Essential identifying or contact information.
  • A date they already know, like a date of birth (for selection of an unknown date, use a date picker).

Note: Only collect information you're authorized to handle and be sure to safeguard it to Government of Canada standards.


Text areas for multi-line freeform responses.

Date selectors when you want someone to choose a not-yet-known date, like for appointment scheduling.


Choose an input type

Set the input type based on how the input will validate the values a person enters. The input type attribute accepts the following options:

Text input uses

  • Use when no other specfic input type is available for single-line entry.
  • To collect a person's name, in most cases by full name.
  • Instead of the number input, for things like estimates that can have non-numerical values.

Email input

  • For email address collection.
  • To require an email address format.

Password input

  • For password collection and validation.
  • To set specific password constraints.

Tip: Communicate any password constraints in the hint text for the input so the person choosing the password knows exactly what the rules are.

Number input

To reject values that are non numerical.

Tip: When you set a constraint, like a numerical range, use hint text to relay a precise instruction.

Search input

To collect search queries.

URL input

To collect a URL, like a web address or domain name.

Help us improve

Have questions or a request? Give feedback on our contact form.

Something's wrong? Raise it through GitHub with an account. You'll have access to the team's direct responses, progress made on your issue, and issues raised by others.

Give feedback Report an issue on GitHub
2025-05-06