/** * * Chip represents people using icons, labels and images. * * [Live Demo](https://www.primereact.org/chip) * * @module chip * */ import * as React from 'react'; import { IconType, PassThroughType, TemplateType } from '../utils'; export declare type ChipPassThroughType = PassThroughType; /** * Custom passthrough(pt) option method. */ export interface ChipPassThroughMethodOptions { props: ChipProps; state: ChipState; } /** * Custom passthrough(pt) options. * @see {@link ChipProps.pt} */ export interface ChipPassThroughOptions { /** * Uses to pass attributes to the root's DOM element. */ root?: ChipPassThroughType>; /** * Uses to pass attributes to the image's DOM element. */ image?: ChipPassThroughType>; /** * Uses to pass attributes to the icon's DOM element. */ icon?: ChipPassThroughType | React.HTMLAttributes>; /** * Uses to pass attributes to the label' DOM element. */ label?: ChipPassThroughType>; /** * Uses to pass attributes to the removeIcon's DOM element. */ removeIcon?: ChipPassThroughType | React.HTMLAttributes>; } /** * Defines current inline state in Chip component. */ export interface ChipState { /** * Current visible state as a boolean. * @defaultValue true */ visible: boolean; } /** * Defines valid properties in Chip component. In addition to these, all properties of HTMLDivElement can be used in this component. * @group Properties */ export interface ChipProps extends Omit, HTMLDivElement>, 'ref'> { /** * Defines the text to display. */ label?: string; /** * Defines the icon to display. */ icon?: IconType | undefined; /** * Defines the image to display. */ image?: string | undefined; /** * Whether to display a remove icon. * @defaultValue false */ removable?: boolean | undefined; /** * Icon of the remove element. */ removeIcon?: IconType | undefined; /** * Template of an item. */ template?: TemplateType | undefined; /** * It specifies an alternate text for an image, if the image cannot be displayed. */ imageAlt?: string | undefined; /** * This event is triggered if an error occurs while loading an image file. * @param {React.SyntheticEvent} event - Browser event. */ onImageError?(event: React.SyntheticEvent): void; /** * Callback to invoke when a chip is removed. * @param {React.MouseEvent} event - Browser event. */ onRemove?(event: React.MouseEvent): void; /** * Used to get the child elements of the component. * @readonly */ children?: React.ReactNode | undefined; /** * Uses to pass attributes to DOM elements inside the component. * @type {ChipPassThroughOptions} */ pt?: ChipPassThroughOptions; } /** * **PrimeReact - Chip** * * _Chip represents people using icons, labels and images._ * * [Live Demo](https://www.primereact.org/chip/) * --- --- * ![PrimeReact](https://primefaces.org/cdn/primereact/images/logo-100.png) * * @group Component */ export declare class Chip extends React.Component { /** * Used to get container element. * @return {HTMLDivElement} Container element */ public getElement(): HTMLDivElement; }