API reference: @salmonui/inputs/signature-pad
SignaturePadPropsinterface
import type { SignaturePadProps } from '@salmonui/inputs/signature-pad';interface SignaturePadProps extends FieldCommonProps {
readonly value?: string | null | undefined;
readonly defaultValue?: string | null | undefined;
readonly onValueChange?: ((value: string | null, details: SignatureChangeDetails) => void) | undefined;
readonly strokeColor?: string | undefined;
readonly minStrokeWidth?: number | undefined;
readonly maxStrokeWidth?: number | undefined;
readonly velocity?: number | undefined;
readonly backgroundColor?: string | undefined;
readonly backgroundImage?: string | undefined;
readonly height?: number | string | undefined;
readonly toolbar?: boolean | undefined;
readonly fontFamily?: string | undefined;
readonly name?: string | undefined;
readonly form?: string | undefined;
readonly required?: boolean | undefined;
readonly disabled?: boolean | undefined;
readonly readOnly?: boolean | undefined;
readonly localeText?: SignaturePadLocaleText | undefined;
readonly id?: string | undefined;
readonly dir?: 'ltr' | 'rtl' | 'auto' | undefined;
readonly className?: string | undefined;
readonly style?: CSSProperties | undefined;
readonly classNames?: {
readonly label?: string;
readonly surface?: string;
readonly canvas?: string;
readonly toolbar?: string;
readonly description?: string;
readonly error?: string;
} | undefined;
readonly ref?: Ref<SignaturePadApi> | undefined;
}
| Name | Signature | Description |
|---|---|---|
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 |
valueoptional | readonly value?: string | null | undefined; | Controlled signature as a data URL ( |
defaultValueoptional | readonly defaultValue?: string | null | undefined; | |
onValueChangeoptional | readonly onValueChange?: ((value: string | null, details: SignatureChangeDetails) => void) | undefined; | After a stroke, undo, redo, clear, load, typed text or reset, with the PNG data URL ( |
strokeColoroptional | readonly strokeColor?: string | undefined; | Default |
minStrokeWidthoptional | readonly minStrokeWidth?: number | undefined; | Default 0.5. |
maxStrokeWidthoptional | readonly maxStrokeWidth?: number | undefined; | Default 2.5. |
velocityoptional | readonly velocity?: number | undefined; | Velocity filter weight 0..1; higher follows speed changes faster. Default 0.7. |
backgroundColoroptional | readonly backgroundColor?: string | undefined; | Canvas fill. Default none (transparent). |
backgroundImageoptional | readonly backgroundImage?: string | undefined; | Image drawn under the strokes, stretched to the pad. Same-origin or CORS-enabled. |
heightoptional | readonly height?: number | string | undefined; | Pad height (CSS length or px). Default 160. |
toolbaroptional | readonly toolbar?: boolean | undefined; | Shows the Clear button and the "type your name" toggle. Default true. |
fontFamilyoptional | readonly fontFamily?: string | undefined; | Font of typed text. Default |
nameoptional | readonly name?: string | undefined; | Submits the PNG data URL (empty when there is no signature). |
formoptional | readonly form?: string | undefined; | |
requiredoptional | readonly required?: boolean | undefined; | |
disabledoptional | readonly disabled?: boolean | undefined; | |
readOnlyoptional | readonly readOnly?: boolean | undefined; | |
localeTextoptional | readonly localeText?: SignaturePadLocaleText | undefined; | |
idoptional | readonly id?: string | undefined; | |
diroptional | readonly dir?: 'ltr' | 'rtl' | 'auto' | undefined; | |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
classNamesoptional | readonly classNames?: {
readonly label?: string;
readonly surface?: string;
readonly canvas?: string;
readonly toolbar?: string;
readonly description?: string;
readonly error?: string;
} | undefined; | |
refoptional | readonly ref?: Ref<SignaturePadApi> | undefined; |