API reference: @salmonui/inputs/masked-field
MaskedFieldPropsinterface
import type { MaskedFieldProps } from '@salmonui/inputs/masked-field';interface MaskedFieldProps extends FieldCommonProps, NativeInput {
readonly mask: string;
readonly tokens?: MaskTokens | undefined;
readonly placeholderChar?: string | undefined;
readonly placeholder?: string | undefined;
readonly value?: string | undefined;
readonly defaultValue?: string | undefined;
readonly onValueChange?: ((value: string, details: MaskedChangeDetails) => void) | undefined;
readonly submitValue?: 'raw' | 'masked' | undefined;
readonly clearable?: boolean | undefined;
readonly startAdornment?: ReactNode;
readonly endAdornment?: ReactNode;
readonly localeText?: MaskedFieldLocaleText | undefined;
readonly className?: string | undefined;
readonly style?: CSSProperties | undefined;
readonly classNames?: {
readonly group?: string;
readonly input?: string;
readonly label?: string;
readonly description?: string;
readonly error?: string;
} | undefined;
readonly ref?: Ref<HTMLInputElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
labeloptionalinherited | label?: ReactNode; | |
descriptionoptionalinherited | description?: ReactNode; | |
mask | readonly mask: string; | The mask; an empty mask is plain text. |
tokensoptional | readonly tokens?: MaskTokens | undefined; | Custom mask characters: allowed characters or a RegExp per character. |
placeholderCharoptional | readonly placeholderChar?: string | undefined; | Shown in empty positions. Default |
placeholderoptional | readonly placeholder?: string | undefined; | Shown while the field is empty and not focused. |
valueoptional | readonly value?: string | undefined; | Raw value: entered characters without literals or placeholders. |
defaultValueoptional | readonly defaultValue?: string | undefined; | |
onValueChangeoptional | readonly onValueChange?: ((value: string, details: MaskedChangeDetails) => void) | undefined; | |
submitValueoptional | readonly submitValue?: 'raw' | 'masked' | undefined; | What the hidden named input submits. Default |
clearableoptional | readonly clearable?: boolean | undefined; | |
startAdornmentoptional | readonly startAdornment?: ReactNode; | |
endAdornmentoptional | readonly endAdornment?: ReactNode; | |
localeTextoptional | readonly localeText?: MaskedFieldLocaleText | undefined; | |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
classNamesoptional | readonly classNames?: {
readonly group?: string;
readonly input?: string;
readonly label?: string;
readonly description?: string;
readonly error?: string;
} | undefined; | |
refoptional | readonly ref?: Ref<HTMLInputElement> | undefined; | The visible native |
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 |