Input Format
Defines a string expression that constrains user input to ensure data integrity by preventing user errors.
Installation
Install
yarn add @iag/chroma-react-ui.components
Import
import { InputFormat } from '@iag/chroma-react-ui.components';
Accessibility
Accessibility Documentation(opens in new window)Currency
Currency No Decimals
Percentage
Credit Card
Phone number
BSB
Time
Postcode
Date
Date Reduced
Disabled
Valid
Error
Properties
Name
Description
- classNamestring
- decimalScalenumbernumber of decimal places allowed
- decimalSeparatorstringShould you wish to change from the default "."
- disabledbooleanSet the input to disabled
- errorbooleanIndicates whether the input is in error
- formatstringthe pattern (using #) to use for formatting eg. a credit card is "#### #### #### ####"
- idstringHTML id attribute for the component
- isNumericStringbooleanIf value is passed as string representation of numbers (unformatted) then this should be passed as true
- placeholderstringplacholder text to display in the input
- maskstring[]If mask defined, component will show non entered placed with masked value
- maxLengthnumberSet the maximum characters allowed in the input
- onChange*(event: ChangeEvent<HTMLInputElement>, value: string) => voidCallback function for the onChange event
- prefixstringcharacters to display before the input text
- suffixstringcharacters to display after the input text
- thousandSeparatorbooleanShould the string display a thousands separator comma
- validbooleanIndicates whether the input is valid
- valuestring | numberThe current value of the input