Tag API

API documentation for Tag component

Tag#

Props#

Defines valid properties in Tag component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TagInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TagInstance) => 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<TagPassThrough>
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: TagInstance) => ReactNode)
null
The children to render.
severity"secondary" | "info" | "success" | "warn" | "danger" | "contrast"
null
Severity type of the tag.
roundedboolean
false
Whether the corners of the tag are rounded.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Interfaces#

Defines passthrough(pt) options of Tag component.

nametypedefaultdescription
rootTagPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.
iconTagPassThroughType<HTMLAttributes<HTMLElement>>
null
Used to pass attributes to the icon's DOM element.
labelTagPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the label's DOM element.

Types#

Instance of Tag component.

values
ComponentInstance<TagProps, TagState, TagExposes>

Props#

Defines valid properties in Tag component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TagInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TagInstance) => 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<TagPassThrough>
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: TagInstance) => ReactNode)
null
The children to render.
severity"secondary" | "info" | "success" | "warn" | "danger" | "contrast"
null
Severity type of the tag.
roundedboolean
false
Whether the corners of the tag are rounded.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Interfaces#

Defines passthrough(pt) options of Tag component.

nametypedefaultdescription
rootTagPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.
iconTagPassThroughType<HTMLAttributes<HTMLElement>>
null
Used to pass attributes to the icon's DOM element.
labelTagPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the label's DOM element.

Types#

Instance of Tag component.

values
ComponentInstance<TagProps, TagState, TagExposes>

TagIcon#

Props#

Defines valid properties in TagIcon component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TagIconInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TagIconInstance) => 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<TagIconPassThrough>
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: TagIconInstance) => 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 TagIcon component.

nametypedefaultdescription
tagTagInstance
null
The Tag component instance.

Interfaces#

Defines passthrough(pt) options of TagIcon component.

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

Types#

Instance of TagIcon component.

values
ComponentInstance<TagIconProps, TagIconState, TagIconExposes>

TagLabel#

Props#

Defines valid properties in TagLabel component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TagLabelInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TagLabelInstance) => 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<TagLabelPassThrough>
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: TagLabelInstance) => 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 TagLabel component.

nametypedefaultdescription
tagTagInstance
null
The Tag component instance.

Interfaces#

Defines passthrough(pt) options of TagLabel component.

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

Types#

Instance of TagLabel component.

values
ComponentInstance<TagLabelProps, TagLabelState, TagLabelExposes>

useTag#

Types#

Instance of useTag headless.

values
HeadlessInstance<useTagProps, useTagState, useTagExposes>