UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

39 lines 1.81 kB
import React from 'react'; import { DefaultProps, MantineSize } from '../../theme'; import { InputWrapperBaseProps, InputWrapperStylesNames } from '../InputWrapper/InputWrapper'; import { InputBaseProps, InputStylesNames } from '../Input/Input'; interface SelectItem { value: string; label: string; disabled?: boolean; } export declare type NativeSelectStylesNames = InputStylesNames | InputWrapperStylesNames; export interface NativeSelectProps extends DefaultProps<NativeSelectStylesNames>, InputWrapperBaseProps, Omit<InputBaseProps, 'rightSection' | 'rightSectionWidth' | 'rightSectionProps'>, Omit<React.ComponentPropsWithoutRef<'select'>, 'size'> { /** id is used to bind input and label, if not passed unique id will be generated for each input */ id?: string; /** Adds hidden option to select and sets it as selected if value is not present */ placeholder?: string; /** Data used to render options */ data: SelectItem[]; /** Style properties added to select element */ inputStyle?: React.CSSProperties; /** Props passed to root element (InputWrapper component) */ wrapperProps?: Record<string, any>; /** Get element ref */ elementRef?: React.ForwardedRef<HTMLSelectElement>; /** Input size */ size?: MantineSize; } export declare const rightSectionWidth: { xs: number; sm: number; md: number; lg: number; xl: number; }; export declare function NativeSelect({ id, className, required, label, error, style, data, placeholder, themeOverride, wrapperProps, inputStyle, description, elementRef, defaultValue, onChange, value, classNames, styles, size, ...others }: NativeSelectProps): JSX.Element; export declare namespace NativeSelect { var displayName: string; } export {}; //# sourceMappingURL=NativeSelect.d.ts.map