Hex Core JS
    Preparing search index...

    Type Alias NumberFieldProps<FV>

    NumberFieldProps: FieldProps<FV, NumberFieldValue> & {
        format?: FieldFormatFunction<NumberFieldValue>;
        Input?: (props: NumberFieldInputProps) => JSX.Element | null;
        inputFormat?: (value: NumberFieldValue) => string;
        lowerBound?: number;
        max?: number;
        min?: number;
        placeholder?: string;
        step?: number;
        type?: NumberInputType;
        unit?: number;
        upperBound?: number;
        validationUnit?: number;
    } & Partial<ClassNameProps & StyleProps>

    Type Parameters

    Type Declaration

    • Optionalformat?: FieldFormatFunction<NumberFieldValue>

      Format function for the value. Controls how the value should be formatted when displayed in smaller contexts where only strings are allowed.

    • OptionalInput?: (props: NumberFieldInputProps) => JSX.Element | null

      The input component to use when editing.

    • OptionalinputFormat?: (value: NumberFieldValue) => string

      A function to format the value in the input into a standardized format. Only updates the value in the input on mount and blur of the input. Not to be confused with format, which is used when the field is in display mode.

    • OptionallowerBound?: number

      Lower bound (exclusive) allowed for values (validation).

    • Optionalmax?: number

      Maximum for values (validation).

    • Optionalmin?: number

      Minimum for values (validation).

    • Optionalplaceholder?: string

      Placeholder text to display in the input when the value is blank.

    • Optionalstep?: number

      The stepping interval when using the arrow keys (up/down) to increment/decrement the value. Note that holding the shift key uses a step of ten times the given step.

    • Optionaltype?: NumberInputType

      The type of number field.

    • Optionalunit?: number

      The underlying unit of the field. Can be used, for example, to enter values in the tenths, dozens, hundreds (e.g. to display as dollars but underlying value is cents), thousands, or millions.

      Validation and step values should be given as raw values ignoring the unit.

    • OptionalupperBound?: number

      Upper bound (exclusive) allowed for values (validation).

    • OptionalvalidationUnit?: number

      Unit (divisibility) for validation (validation). Checks that the value is divisible by the given validationUnit. For integer validation, set validationUnit to 1.

      Unrelated to the unit prop.