UNPKG

@mui/material

Version:

Quickly build beautiful React apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

90 lines (83 loc) 2.57 kB
import { SxProps } from '@mui/system'; import { OverridableStringUnion } from '@mui/types'; import { Theme } from '..'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; import { ToggleButtonClasses } from './toggleButtonClasses'; export interface ToggleButtonPropsSizeOverrides {} export interface ToggleButtonPropsColorOverrides {} export type ToggleButtonTypeMap< P = {}, D extends React.ElementType = 'button', > = ExtendButtonBaseTypeMap<{ props: P & { /** * The content of the component. */ children?: React.ReactNode; /** * Override or extend the styles applied to the component. */ classes?: Partial<ToggleButtonClasses>; /** * The color of the button when it is in an active state. * @default 'standard' */ color?: OverridableStringUnion< 'standard' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning', ToggleButtonPropsColorOverrides >; /** * If `true`, the component is disabled. * @default false */ disabled?: boolean; /** * If `true`, the keyboard focus ripple is disabled. * @default false */ disableFocusRipple?: boolean; /** * If `true`, the button will take up the full width of its container. * @default false */ fullWidth?: boolean; /** * If `true`, the button is rendered in an active state. */ selected?: boolean; /** * The size of the component. * The prop defaults to the value inherited from the parent ToggleButtonGroup component. * @default 'medium' */ size?: OverridableStringUnion<'small' | 'medium' | 'large', ToggleButtonPropsSizeOverrides>; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps<Theme>; /** * The value to associate with the button when selected in a * ToggleButtonGroup. */ value: NonNullable<unknown>; }; defaultComponent: D; }>; /** * * Demos: * * - [Toggle Button](https://mui.com/components/toggle-button/) * * API: * * - [ToggleButton API](https://mui.com/api/toggle-button/) * - inherits [ButtonBase API](https://mui.com/api/button-base/) */ declare const ToggleButton: ExtendButtonBase<ToggleButtonTypeMap>; export type ToggleButtonProps< D extends React.ElementType = ToggleButtonTypeMap['defaultComponent'], P = {}, > = OverrideProps<ToggleButtonTypeMap<P, D>, D>; export default ToggleButton;