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.

105 lines (97 loc) 3.05 kB
import * as React from 'react'; import { OverridableStringUnion } from '@mui/types'; import { SxProps } from '@mui/system'; import { Theme } from '..'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ChipClasses } from './chipClasses'; export interface ChipPropsVariantOverrides {} export interface ChipPropsSizeOverrides {} export interface ChipPropsColorOverrides {} export interface ChipTypeMap<P = {}, D extends React.ElementType = 'div'> { props: P & { /** * The Avatar element to display. */ avatar?: React.ReactElement; /** * This prop isn't supported. * Use the `component` prop if you need to change the children structure. */ children?: null; /** * Override or extend the styles applied to the component. */ classes?: Partial<ChipClasses>; /** * If `true`, the chip will appear clickable, and will raise when pressed, * even if the onClick prop is not defined. * If `false`, the chip will not appear clickable, even if onClick prop is defined. * This can be used, for example, * along with the component prop to indicate an anchor Chip is clickable. * Note: this controls the UI and does not affect the onClick event. */ clickable?: boolean; /** * The color of the component. It supports those theme colors that make sense for this component. * @default 'default' */ color?: OverridableStringUnion< 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning', ChipPropsColorOverrides >; /** * Override the default delete icon element. Shown only if `onDelete` is set. */ deleteIcon?: React.ReactElement; /** * If `true`, the component is disabled. * @default false */ disabled?: boolean; /** * Icon element. */ icon?: React.ReactElement; /** * The content of the component. */ label?: React.ReactNode; /** * Callback fired when the delete icon is clicked. * If set, the delete icon will be shown. */ onDelete?: React.EventHandler<any>; /** * The size of the component. * @default 'medium' */ size?: OverridableStringUnion<'small' | 'medium', ChipPropsSizeOverrides>; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps<Theme>; /** * The variant to use. * @default 'filled' */ variant?: OverridableStringUnion<'filled' | 'outlined', ChipPropsVariantOverrides>; }; defaultComponent: D; } /** * Chips represent complex entities in small blocks, such as a contact. * * Demos: * * - [Chips](https://mui.com/components/chips/) * * API: * * - [Chip API](https://mui.com/api/chip/) */ declare const Chip: OverridableComponent<ChipTypeMap>; export type ChipProps< D extends React.ElementType = ChipTypeMap['defaultComponent'], P = {}, > = OverrideProps<ChipTypeMap<P, D>, D>; export default Chip;