@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
37 lines • 1.69 kB
TypeScript
import React from 'react';
import { DefaultProps, MantineSize } from '../../theme';
import useStyles from './InputWrapper.styles';
export declare type InputWrapperStylesNames = keyof ReturnType<typeof useStyles>;
export interface InputWrapperBaseProps {
/** Input label, displayed before input */
label?: React.ReactNode;
/** Input description, displayed after label */
description?: React.ReactNode;
/** Displays error message after input */
error?: React.ReactNode;
/** Adds red asterisk on the right side of label */
required?: boolean;
/** Props spread to label element */
labelProps?: Record<string, any>;
/** Props spread to description element */
descriptionProps?: Record<string, any>;
/** Props spread to error element */
errorProps?: Record<string, any>;
}
export interface InputWrapperProps extends DefaultProps<typeof useStyles>, InputWrapperBaseProps, React.ComponentPropsWithoutRef<'div'> {
/** Input that should be wrapped */
children: React.ReactNode;
/** htmlFor label prop */
id?: string;
/** Render label as label with htmlFor or as div */
labelElement?: 'label' | 'div';
/** Controls all elements font-size */
size?: MantineSize;
/** Static css selector base */
__staticSelector?: string;
}
export declare function InputWrapper({ className, style, label, children, required, id, error, description, themeOverride, labelElement, labelProps, descriptionProps, errorProps, classNames, styles, size, __staticSelector, ...others }: InputWrapperProps): JSX.Element;
export declare namespace InputWrapper {
var displayName: string;
}
//# sourceMappingURL=InputWrapper.d.ts.map