Chip API

API documentation for Chip component

Chip#

Props#

Defines valid properties in Chip component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: ChipInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: ChipInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<ChipPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: ChipInstance) => ReactNode)
null
The children to render.
onRemove(event: useChipRemoveEvent) => void
null
Callback fired when the chip is removed.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in Chip component.

nametypedefaultdescription
visibleboolean
null
The visibility state of the chip.

Exposes#

Defines the methods and properties exposed by Chip component.

nametypedefaultdescription
stateuseChipState
null
The state of the useChip.
close(event: SyntheticEvent<HTMLElement>) => void
null
Closes the chip.
removeIconProps{ onKeyDown: (event: KeyboardEvent<HTMLElement>) => void }
null
Props for the remove icon.

Interfaces#

Defines passthrough(pt) options of Chip component.

nametypedefaultdescription
rootChipPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
iconChipPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the icon's DOM element.
imageChipPassThroughType<HTMLAttributes<HTMLImageElement>>
null
Used to pass attributes to the image's DOM element.
labelChipPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the label's DOM element.
removeIconChipPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the remove icon's DOM element.

Types#

Instance of Chip component.

values
ComponentInstance<ChipProps, ChipState, ChipExposes>

ChipIcon#

Props#

Defines valid properties in ChipIcon component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: ChipIconInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: ChipIconInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<ChipIconPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: ChipIconInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by ChipIcon component.

nametypedefaultdescription
chipChipInstance
null
The Chip component instance.

Interfaces#

Defines passthrough(pt) options of ChipIcon component.

nametypedefaultdescription
rootChipIconPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of ChipIcon component.

values
ComponentInstance<ChipIconProps, ChipIconState, ChipIconExposes>

ChipLabel#

Props#

Defines valid properties in ChipLabel component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: ChipLabelInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: ChipLabelInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<ChipLabelPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: ChipLabelInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by ChipLabel component.

nametypedefaultdescription
chipChipInstance
null
The Chip component instance.

Interfaces#

Defines passthrough(pt) options of ChipLabel component.

nametypedefaultdescription
rootChipLabelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of ChipLabel component.

values
ComponentInstance<ChipLabelProps, ChipLabelState, ChipLabelExposes>

ChipImage#

Props#

Defines valid properties in ChipImage component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: ChipImageInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: ChipImageInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<ChipImagePassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: ChipImageInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by ChipImage component.

nametypedefaultdescription
chipChipInstance
null
The Chip component instance.

Interfaces#

Defines passthrough(pt) options of ChipImage component.

nametypedefaultdescription
rootChipImagePassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of ChipImage component.

values
ComponentInstance<ChipImageProps, ChipImageState, ChipImageExposes>

ChipRemoveIcon#

Props#

Defines valid properties in ChipRemoveIcon component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: ChipRemoveIconInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: ChipRemoveIconInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<ChipRemoveIconPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: ChipRemoveIconInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by ChipRemoveIcon component.

nametypedefaultdescription
chipChipInstance
null
The Chip component instance.

Interfaces#

Defines passthrough(pt) options of ChipRemoveIcon component.

nametypedefaultdescription
rootChipRemoveIconPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of ChipRemoveIcon component.

values
ComponentInstance<ChipRemoveIconProps, ChipRemoveIconState, ChipRemoveIconExposes>

useChip#

Props#

Defines valid properties in useChip.

nametypedefaultdescription
onRemove(event: useChipRemoveEvent) => void
null
Callback fired when the chip is removed.

State#

Defines valid state in useChip.

nametypedefaultdescription
visibleboolean
null
The visibility state of the chip.

Exposes#

Defines the methods and properties exposed by useChip.

nametypedefaultdescription
stateuseChipState
null
The state of the useChip.
close(event: SyntheticEvent<HTMLElement>) => void
null
Closes the chip.
removeIconProps{ onKeyDown: (event: KeyboardEvent<HTMLElement>) => void }
null
Props for the remove icon.

Events#

Event fired when the chip's remove icon is clicked.

nametypedescription
originalEventEThe original event that triggered the change.

Types#

Instance of useChip headless.

values
HeadlessInstance<useChipProps, useChipState, useChipExposes>