@syncfusion/react-buttons
Version:
Syncfusion React Buttons package is a feature-rich collection of UI components including Button, CheckBox, RadioButton, Switch, Chip, and more for building modern, interactive React applications.
132 lines (131 loc) • 3.16 kB
TypeScript
import { HTMLAttributes } from 'react';
import * as React from 'react';
/**
* Represents the variant types for the Chip component.
*/
export type ChipVariant = 'Filled' | 'Outlined';
/**
* Represents the color types for the Chip component.
*/
export type ChipColor = 'Primary' | 'Info' | 'Error' | 'Success' | 'Warning';
/**
* Represents the model for the Chip component.
*
*/
export interface ChipBaseProps {
/**
* Specifies the text content for the Chip.
*
* @default -
*/
text?: string;
/**
* Defines the value of the Chip.
*
* @default -
*/
value?: string | number;
/**
* Specifies the icon CSS class or React node for the avatar in the Chip.
*
* @default -
*/
avatar?: React.ReactNode;
/**
* Specifies the leading icon CSS class or React node for the Chip.
*
* @default -
*/
leadingIcon?: React.ReactNode;
/**
* Specifies the trailing icon CSS or React node for the Chip.
*
* @default -
*/
trailingIcon?: React.ReactNode;
/**
* Specifies whether the Chip component is disabled or not.
*
* @default false
*/
disabled?: boolean;
/**
* Specifies the leading icon url for the Chip.
*
* @default -
*/
leadingIconUrl?: string;
/**
* Specifies the trailing icon url for the Chip.
*
* @default -
*/
trailingIconUrl?: string;
/**
* Specifies whether the Chip is removable.
*
* @default false
*/
removable?: boolean;
/**
* Specifies the variant of the Chip, either 'filled' or 'outlined'.
*
* @default 'filled'
*/
variant?: ChipVariant;
/**
* Specifies the color of the Chip, one of 'Primary', 'Info', 'Error', 'Success', or 'Warning'.
*
* @default -
*/
color?: ChipColor;
}
/**
* Represents the props for the Chip component.
*
* @ignore
*/
export interface ChipProps extends ChipBaseProps {
/**
* Event handler for the delete action.
*
* @event onDelete
*/
onDelete?: (event: ChipDeleteEvent) => void;
}
/**
* Represents the arguments for the delete event of a Chip.
*/
export interface ChipDeleteEvent {
/**
* Specifies the data associated with the deleted Chip.
*/
data: ChipBaseProps;
/**
* Specifies the event that triggered the delete action.
*/
event: React.MouseEvent | React.KeyboardEvent;
}
/**
* Represents the interface for the Chip component.
*/
export interface IChip extends ChipProps {
/**
* Specifies the Chip component element.
*
* @private
*/
element?: HTMLDivElement | null;
}
type ChipComponentProps = ChipProps & HTMLAttributes<HTMLDivElement>;
/**
* The Chip component represents information in a compact form, such as entity attribute, text, or action.
*
* ```typescript
* import { Chip } from "@syncfusion/react-buttons";
*
* <Chip color="Primary" removable={true}>Anne</Chip>
* ```
*/
export declare const Chip: React.ForwardRefExoticComponent<ChipComponentProps & React.RefAttributes<IChip>>;
export default Chip;