import React from 'react'; import type { ForwardedRefComponent, IconOrContent } from '../../util/utility-types'; export type SelectionChipProps = { /** * CSS properties defined for the HTML element. Includes the component's CSS Custom Properties: * * - `--selection-chip__bg` * - `--selection-chip__border` * - `--selection-chip__fg` */ style?: SelectionChipCSSProperties; /** * Whether the chip is disabled or not */ isDisabled?: boolean; /** * Text used in the chip to give it a description */ label: string; /** * Content that precedes the label. Pass an EDS icon name to render a decorative * icon, or a node to render it as-is. */ leadingContent?: IconOrContent; /** * Chip types (correspond to the equivalent input types) */ type?: 'checkbox' | 'radio'; } & Pick, 'id' | 'name' | 'className' | 'checked' | 'defaultChecked' | 'onChange'>; export interface SelectionChipCSSProperties extends React.CSSProperties { /** * Custom property to customize the background color of this component (e.g., background color) */ '--selection-chip__bg'?: string; /** * Custom property to customize the border color of this component */ '--selection-chip__border'?: string; /** * Custom property to customize the foreground color of this component (e.g., text, icon, etc.) */ '--selection-chip__fg'?: string; } type SelectionChipRefProps = ForwardedRefComponent; /** * ## Usage * * A selection chip is an interactive chip that can be selected, deselected, or toggled. Use it to represent user controls or selections outside the context of a form, in place of a checkbox group, radio button group, or toggle. Common uses include filtering content and selecting multiple items. * * ### Best Practices * * * **Enable quick selection**: When you want users to choose from a limited set of related, easily digestible options, such as selecting filters or tags in search and content filtering. * * **Show multi-select options**: When users need the option to select multiple items at once, especially when toggling on/off multiple states or filters. * * **Enhance readability in tight spaces**: Selection chips help maintain readability while maximizing available screen space, especially on mobile. * * **Improve visual clarity**: When you need to show clear boundaries around items. Chips with subtle visual indicators like icons or colors can also convey context. * * **Replace dropdowns or radio buttons**: When dropdowns or radio buttons are too clunky or take up too much space. * * ## Interaction * * Unless used as a toggle, chips should always be presented as a group. * * Selection chips don't have built-in error handling. To show that something went wrong with a selection, pair the chips with an `InlineNotification` or `FieldNote` component to display the error message. * * ## Content & Accessibility * * ### Do's * * * Keep labels to 1-2 words. * * Represent one piece of info per chip. This could be a discrete thing, a grouping, category, etc. */ export declare const SelectionChip: SelectionChipRefProps; export {};