@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
39 lines • 2.05 kB
TypeScript
import React from 'react';
import { DefaultProps } from '../../theme';
import { TextInput } from '../TextInput/TextInput';
import { InputStylesNames } from '../Input/Input';
import { InputWrapperStylesNames } from '../InputWrapper/InputWrapper';
import useStyles from './NumberInput.styles';
export declare type InnerNumberInputStylesNames = keyof ReturnType<typeof useStyles>;
export declare type NumberInputStylesNames = InputStylesNames | InputWrapperStylesNames | InnerNumberInputStylesNames;
export interface NumberInputHandlers {
increment(): void;
decrement(): void;
}
export interface NumberInputProps extends DefaultProps<NumberInputStylesNames>, Omit<React.ComponentPropsWithoutRef<typeof TextInput>, 'rightSection' | 'rightSectionProps' | 'rightSectionWidth' | 'onChange' | 'value' | 'classNames' | 'styles'> {
/** onChange input handler for controlled variant, note that input event is not exposed */
onChange?(value: number): void;
/** Input value for controlled variant */
value?: number;
/** Maximum possible value */
max?: number;
/** Minimal possible value */
min?: number;
/** Number by which value will be incremented/decremented with controls and up/down arrows */
step?: number;
/** Removes increment/decrement controls */
hideControls?: boolean;
/** Amount of digits after the decimal point */
precision?: number;
/** Default value for uncontrolled variant only */
defaultValue?: number;
/** Prevent value clamp on blur */
noClampOnBlur?: boolean;
/** Get increment/decrement handlers */
handlersRef?: React.ForwardedRef<NumberInputHandlers>;
}
export declare function NumberInput({ disabled, themeOverride, elementRef, value, onChange, min, max, step, onBlur, onFocus, hideControls, radius, variant, precision, defaultValue, noClampOnBlur, handlersRef, classNames, styles, size, ...others }: NumberInputProps): JSX.Element;
export declare namespace NumberInput {
var displayName: string;
}
//# sourceMappingURL=NumberInput.d.ts.map