@kopexa/chip
Version:
A Chip is a small block of essential information that represent an input, attribute, or action.
33 lines (30 loc) • 1.13 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { SlotsToClasses, ChipSlots, ChipVariantProps } from '@kopexa/theme';
import { ComponentProps } from 'react';
type BaseProps = {
/**
* Element to be rendered in the left side of the chip.
* this props overrides the `avatar` prop.
*/
startContent?: React.ReactNode;
/**
* Element to be rendered in the right side of the chip.
* if you pass this prop and the `onClose` prop, the passed element
* will have the close button props and it will be rendered instead of the
* default close button.
*/
endContent?: React.ReactNode;
classNames?: SlotsToClasses<ChipSlots>;
/**
* A Status text to be displayed in the chip.
* This is usually used to display a status like "active", "inactive", etc.
*/
status?: React.ReactNode;
/**
* Callback fired when the chip is closed.
*/
onClose?: () => void;
};
type ChipProps = ComponentProps<"div"> & BaseProps & ChipVariantProps;
declare const Chip: (props: ChipProps) => react_jsx_runtime.JSX.Element;
export { Chip, type ChipProps };