interface CommonProps {
    ariaLabel?: string;
    customAttribute?: {
        attribute: string;
        value: string | number;
    };
    disabled?: boolean;
    elevation?: 0 | 1 | 2;
    id?: string;
    label: string;
    loading?: boolean;
    onClick?: ((event: MouseEvent<HTMLElement, MouseEvent>) => void);
    ref?: Ref<HTMLButtonElement>;
    selected?: boolean;
    startIcon?: string | ComponentClass<Omit<SVGProps<SVGSVGElement>, "ref"> & {
        ref?: null | ((instance: null | SVGSVGElement) => void | (() => VoidOrUndefinedOnly)) | RefObject<SVGSVGElement>;
    }, any> | FunctionComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & {
        ref?: null | ((instance: null | SVGSVGElement) => void | (() => VoidOrUndefinedOnly)) | RefObject<SVGSVGElement>;
    }>;
    sx?: SxProps<Theme>;
}

Properties

ariaLabel?: string

Aria label attribute for enhanced accessibility.

customAttribute?: {
    attribute: string;
    value: string | number;
}

Add this for testing. Clickable and requested subcomponents will get suffixed with "-[ComponentName]".

disabled?: boolean

If true, the component is disabled.

elevation?: 0 | 1 | 2

Elevation of the chip. Used primarily in dark mode to handle modals and layers.

id?: string
label: string

The label text.

loading?: boolean

If true, displays a loading skeleton instead of the chip content.

onClick?: ((event: MouseEvent<HTMLElement, MouseEvent>) => void)

Callback fired when chip is clicked.

ref?: Ref<HTMLButtonElement>

Ref forwarding to access the DOM element of the chip.

selected?: boolean

If true, shows the chip in a visually selected state.

startIcon?: string | ComponentClass<Omit<SVGProps<SVGSVGElement>, "ref"> & {
    ref?: null | ((instance: null | SVGSVGElement) => void | (() => VoidOrUndefinedOnly)) | RefObject<SVGSVGElement>;
}, any> | FunctionComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & {
    ref?: null | ((instance: null | SVGSVGElement) => void | (() => VoidOrUndefinedOnly)) | RefObject<SVGSVGElement>;
}>

Leading icon in the chip. Will be overwritten when in selected state.

sx?: SxProps<Theme>

Custom styles applied to the chip.