jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
45 lines (44 loc) • 1.44 kB
TypeScript
/**
* @file index.tsx
*
* @fileoverview Chip component. Renders a chip component.
*/
import * as React from 'react';
export interface ChipProps {
/**
* The chipId is an id passed to the chip so it can be returned properly to the parent when removed.
*/
chipId: string;
/**
* The content to be displayed inside the chip element.
*
* @default "null"
*/
children: React.ReactNode | string;
/**
* The theme props is passed automatically to the component via styled components.
*
* @default null
*/
theme?: any;
/**
* The style for the chip. The color of the chip element will be changed accordingly.
*
* @default "default"
*/
chipStyle?: 'primary' | 'secondary' | 'default';
/**
* The event that gets fired when a chip is removed.
* Will pass the chipId back to the parent so it knows whats being removed.
*
* @default "null"
*/
onRemove?(chipId: string): void;
}
/**
* The chip is a label style element that can be used to show information in a supporting manner. It has the option to be toggled off in case
* its information one wants to be available to remove. It can be used to show facets that are selected or other information
* that supports some sort of "state" for the UI.
*/
export declare const Chip: ({ chipStyle, chipId, children, onRemove }: ChipProps) => JSX.Element;
export default Chip;