@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
51 lines • 2.39 kB
TypeScript
import React from 'react';
import { DefaultProps, MantineNumberSize, MantineSize } from '../../theme';
import useStyles from './Input.styles';
export declare const INPUT_VARIANTS: readonly ["default", "filled", "unstyled"];
export declare const INPUT_SIZES: {
xs: number;
sm: number;
md: number;
lg: number;
xl: number;
};
export declare type InputVariant = typeof INPUT_VARIANTS[number];
export declare type InputStylesNames = Exclude<keyof ReturnType<typeof useStyles>, InputVariant>;
export interface InputBaseProps {
/** Sets border color to red and aria-invalid=true on input element */
invalid?: boolean;
/** Adds icon on the left side of input */
icon?: React.ReactNode;
/** Right section of input, similar to icon but on the right */
rightSection?: React.ReactNode;
/** Width of right section, is used to calculate input padding-right */
rightSectionWidth?: number;
/** Props spread to rightSection div element */
rightSectionProps?: Record<string, any>;
/** Properties spread to root element */
wrapperProps?: Record<string, any>;
/** Sets aria-required=true on input element */
required?: boolean;
/** Input border-radius from theme or number to set border-radius in px */
radius?: MantineNumberSize;
/** Defines input appearance, defaults to default in light color scheme and filled in dark */
variant?: 'default' | 'filled' | 'unstyled';
/** Static css selector base */
__staticSelector?: string;
/** Will input have multiple lines? */
multiline?: boolean;
}
export interface InputProps extends InputBaseProps, DefaultProps<typeof useStyles> {
}
export declare function Input<T extends React.ElementType = 'input', U extends HTMLElement = HTMLInputElement>({ component, className, invalid, required, variant, icon, style, rightSectionWidth, rightSection, rightSectionProps, radius, size, themeOverride, wrapperProps, elementRef, classNames, styles, __staticSelector, multiline, ...others }: InputProps & Omit<React.ComponentPropsWithoutRef<T>, 'size'> & {
/** Element or component that will be used as root element */
component?: T;
/** Input size */
size?: MantineSize;
/** Get element ref */
elementRef?: React.ForwardedRef<U>;
}): JSX.Element;
export declare namespace Input {
var displayName: string;
}
//# sourceMappingURL=Input.d.ts.map