Skip to main content

Inputs

Input

Props

NameTypeDefaultDescription
namestring-Input's name being registered.
placeholderstring''Placeholder text displayed in the input.
showErrorbooleantrueDetermines if errors should be displayed. (Particularly needed is you dont want to show validation error in the field)
isDisabledbooleanfalseDisables the input field when true.
typestring'text'Specifies the type of input (e.g., text, password).
idstring-The unique identifier for the input field.
maxLengthnumber-Maximum number of characters allowed.
endAdornmentReactNode<></>A React component displayed at the end of the input.
dataTestIdstring''A data-testid attribute for testing purposes.
labelstring-The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
labelConfigobject{ labelClassName: {}, labelTextClassName: {} }Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
idstring-The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
tooltipstring''Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
dependsOnFieldobject{ fieldName: '', value: [] }Defines dependencies on another field (To show or hide this component,based on state of some field), specifying the field name and expected value(s). If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.

Config example

const inputConfig = {
type: 'input',
data: {
id: 'username',
name: 'username',
label: 'Username *',
type: 'text',
placeholder: 'Enter your username',
dataTestId: 'username-input',
labelConfig: {
labelClassName: { fontWeight: 'bold' },
labelTextClassName: { fontSize: '14px', color: 'gray' }
},
tooltip: 'Your unique username for logging in. Use 3-20 characters.',
dependsOnField: { fieldName: 'hasAccount', value: [true] }
}
}

Masked input

Props

NameTypeDefaultDescription
namestring-Input's name being registered.
placeholderstring''Placeholder text displayed in the input.
showErrorbooleantrueDetermines if errors should be displayed. (Particularly needed is you dont want to show validation error in the field)
isDisabledbooleanfalseDisables the input field when true.
idstring-The unique identifier for the input field.
maxLengthnumber-Maximum number of characters allowed.
maskCharstring-Character to cover unfilled editable parts of mask.
maskstring-Pattern or template for input masking.
dataTestIdstring''A data-testid attribute for testing purposes.
labelstring-The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
labelConfigobject{ labelClassName: {}, labelTextClassName: {} }Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
idstring-The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
tooltipstring''Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
dependsOnFieldobject{ fieldName: '', value: [] }Defines dependencies on another field (To show or hide this component,based on state of some field), specifying the field name and expected value(s). If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.

Config example

const maskedInputConfig = {
type: 'masked-input',
data: {
id: 'maskedInput',
name: 'phoneNumber',
label: 'Phone Number *',
placeholder: '(999) 999-9999',
mask: '(999) 999-9999',
dataTestId: 'phone-number-input',
tooltip: 'Enter your phone number in the format: (123) 456-7890',
labelConfig: {
labelClassName: { fontWeight: 'bold' },
labelTextClassName: { fontSize: '14px', color: 'gray' }
}
}
}

Password

Props

NameTypeDefaultDescription
namestring-Input's name being registered.
placeholderstring''Placeholder text displayed in the input.
showErrorbooleantrueDetermines if errors should be displayed. (Particularly needed is you dont want to show validation error in the field)
isDisabledbooleanfalseDisables the input field when true.
typestring'text'Specifies the type of input (e.g., text, password).
idstring-The unique identifier for the input field.
maxLengthnumber-Maximum number of characters allowed.
endAdornmentReactNode<></>A React component displayed at the end of the input.
dataTestIdstring''A data-testid attribute for testing purposes.
labelstring-The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
labelConfigobject{ labelClassName: {}, labelTextClassName: {} }Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
idstring-The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
tooltipstring''Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
dependsOnFieldobject{ fieldName: '', value: [] }Defines dependencies on another field (To show or hide this component,based on state of some field), specifying the field name and expected value(s). If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.

Config example

const passwordInputConfig = {
type: 'password',
data: {
id: 'password',
name: 'password',
label: 'Password *',
type: 'password',
placeholder: 'Enter your password',
dataTestId: 'password-input',
tooltip:
'Password must be 8-32 characters and include at least one number and one special character.',
labelConfig: {
labelClassName: { fontWeight: 'bold' },
labelTextClassName: { fontSize: '14px', color: 'gray' }
}
}
}

Textarea

Props

NameTypeDefaultDescription
namestring-Input's name being registered.
placeholderstring''Placeholder text displayed in the input.
showErrorbooleantrueDetermines if errors should be displayed. (Particularly needed is you dont want to show validation error in the field)
isDisabledbooleanfalseDisables the input field when true.
typetextarea'textarea'Input type should be set to textarea
idstring-The unique identifier for the input field.
maxLengthnumber-Maximum number of characters allowed.
endAdornmentReactNode<></>A React component displayed at the end of the input.
dataTestIdstring''A data-testid attribute for testing purposes.
labelstring-The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
labelConfigobject{ labelClassName: {}, labelTextClassName: {} }Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
idstring-The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
tooltipstring''Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
dependsOnFieldobject{ fieldName: '', value: [] }Defines dependencies on another field (To show or hide this component,based on state of some field), specifying the field name and expected value(s). If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.

Config example

{
type: 'textarea',
data: {
id: 'projectDescription',
name: 'projectDescription',
label: 'Project Description',
placeholder: 'Describe the project details',
type: 'textarea'
}
}