@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
79 lines (78 loc) • 2.58 kB
TypeScript
import React from 'react';
import { SCTagType } from '@selfcommunity/types';
import { ChipClasses } from '@mui/material/Chip/chipClasses';
import { OverridableStringUnion } from '@mui/types';
import { SxProps } from '@mui/system';
import { Theme } from '@mui/material';
import { ChipPropsSizeOverrides, ChipPropsVariantOverrides } from '@mui/material/Chip/Chip';
export interface TagChipProps {
className?: string;
/**
* Overrides or extends 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.
* @default true
*/
clickable?: boolean;
/**
* If `true`, the chip will appear disposable, and will raise when pressed,
* even if the onDelete prop is not defined.
* If `false`, the chip will not appear disposable, even if onDelete prop is defined.
* This can be used, for example, along with the component prop to indicate an anchor Chip is disposable.
* @default true
*/
disposable?: boolean;
/**
* 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.
*/
onClick?: React.EventHandler<any>;
/**
* 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>;
/**
* The tag to use.
* @default null
*/
tag: SCTagType;
/**
* Use ellipsis to truncate tag
* @default false
*/
ellipsis?: boolean;
}
export default function TagChip(props: TagChipProps): JSX.Element;