API reference: @salmonui/inputs/text-field
TextFieldPropsinterface
import type { TextFieldProps } from '@salmonui/inputs/text-field';interface TextFieldProps extends TextBaseProps, NativeInput {
readonly type?: 'text' | 'password' | 'email' | 'tel' | 'url' | 'search' | undefined;
readonly ref?: Ref<HTMLInputElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
typeoptional | readonly type?: 'text' | 'password' | 'email' | 'tel' | 'url' | 'search' | undefined; | Input type; numbers use |
refoptional | readonly ref?: Ref<HTMLInputElement> | undefined; | The native |
labeloptionalinherited | label?: ReactNode; | |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) | ReactNode; | Error text (or a function of the errors) shown while the field is invalid. |
invalidoptionalinherited | invalid?: boolean; | Forces the error state. |
validationoptionalinherited | validation?: FieldValidation; | Rules in the Data Grid vocabulary. |
validateOnoptionalinherited | validateOn?: ValidateOn; | When errors appear; default the |
sizeoptionalinherited | size?: FieldSize; | Metric set. Default |
valueoptionalinherited | value?: string; | |
defaultValueoptionalinherited | defaultValue?: string; | |
onValueChangeoptionalinherited | onValueChange?: ((value: string, details: TextChangeDetails) => void); | |
clearableoptionalinherited | clearable?: boolean; | Shows a clear button while there is a value; Escape clears too. |
startAdornmentoptionalinherited | startAdornment?: ReactNode; | |
endAdornmentoptionalinherited | endAdornment?: ReactNode; | |
localeTextoptionalinherited | localeText?: TextFieldLocaleText; | |
classNameoptionalinherited | className?: string; | Root class and style (the input gets every other prop). |
styleoptionalinherited | style?: CSSProperties; | |
classNamesoptionalinherited | classNames?: { readonly group?: string; readonly input?: string; readonly label?: string; readonly description?: string; readonly error?: string; }; | Part classes: |