UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

29 lines 1.38 kB
import React from 'react'; import { DefaultProps, MantineNumberSize, MantineSize } from '../../theme'; import useStyles from './Switch.styles'; export declare const SWITCH_SIZES: Record<MantineSize, { width: number; height: number; }>; export declare type SwitchStylesNames = keyof ReturnType<typeof useStyles>; export interface SwitchProps extends DefaultProps<SwitchStylesNames>, Omit<React.ComponentPropsWithoutRef<'input'>, 'type' | 'size'> { /** Id is used to bind input and label, if not passed unique id will be generated for each input */ id?: string; /** Switch label */ label?: React.ReactNode; /** Switch checked state color from theme, defaults to theme.primaryColor */ color?: string; /** Predefined size value */ size?: MantineSize; /** Predefined border-radius value from theme.radius or number for border-radius in px */ radius?: MantineNumberSize; /** Props spread to wrapper element */ wrapperProps?: Record<string, any>; /** Get element ref */ elementRef?: React.ForwardedRef<HTMLInputElement>; } export declare function Switch({ className, color, label, id, style, size, radius, themeOverride, wrapperProps, elementRef, children, classNames, styles, ...others }: SwitchProps): JSX.Element; export declare namespace Switch { var displayName: string; } //# sourceMappingURL=Switch.d.ts.map