Agriculture Design System
Beta
Design System for the Export Service

Password input

The password input component allows users to securely enter a password. The text is obscured by default, but can be revealed by pressing the ‘Show password’ checkbox.

View in FigmaView in StorybookView in Github
import { ... } from '@ag.ds-next/react/password-input';

Usage

Password input components can be imported via the password-input entrypoint in the @ag.ds-next/react package.

For example:

import { ... } from '@ag.ds-next/react/password-input';

Props

PasswordInput Props
PropTypeDescription
labelstring
Describes the purpose of the field.
autoComplete?string
autoFocus?boolean
block?boolean
If true, the field will stretch to the fill the width of its container.
disabled?boolean
hideOptionalLabel?boolean
If true, "(optional)" will never be appended to the label.
hint?string
Provides extra information about the field.
id?string
invalid?boolean
If true, the invalid state will be rendered.
maxLength?number
maxWidth?"md" | "lg" | "xl"
The maximum width of the field.
message?string
Message to show when the field is invalid.
name?string
onBlur?FocusEventHandler<HTMLInputElement>
onChange?ChangeEventHandler<HTMLInputElement>
onFocus?FocusEventHandler<HTMLInputElement>
ref?Ref<HTMLInputElement>
required?boolean
If false, "(optional)" will be appended to the label.
value?string | number | readonly string[]

Source

You can view the full source code for this package on Github.