ui/LabeledIcon
Provides unstyled LabeledIcon components to be customized by a theme or application.
Members
Section titled “Members ”LabeledIcon Component
Section titled “LabeledIcon   Component ”An icon component with a label without any behaviors applied to it.
Usage:
<LabeledIcon icon="star" labelPosition="after">
Favorite
</LabeledIcon> Extends:
ui/LabeledIconui/LabeledIcon.LabeledIconBase
Wrapped with:
ui/LabeledIconui/LabeledIcon.LabeledIconDecorator
LabeledIconBase Component
Section titled “LabeledIconBase   Component ”An icon component with a label.
Properties
children
Section titled “children”The label.
This accepts strings, DOM, and Components, if you need more elaborate features. It may be
positioned using labelPosition.
Called with a reference to the root component.
When using ui/LabeledIconui/LabeledIcon.LabeledIcon, the ref prop is forwarded to this
component as componentRef.
Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component.
The following classes are supported:
labeledIcon- The root component classicon- The icon component classiconCell- Applied to theiconComponentdirectly, like.icon. Ificonin a React component, this class is applied to the container of the icon, rather than the icon itself.label- The label component classinline- Applied when the inline prop is setabove- Applied when the labelPosition prop is set to aboveafter- Applied when the labelPosition prop is set to afterbefore- Applied when the labelPosition prop is set to beforebelow- Applied when the labelPosition prop is set to belowleft- Applied when the labelPosition prop is set to leftright- Applied when the labelPosition prop is set to right
disabled
Section titled “disabled”Disables the component and becomes non-interactive.
Default: falseFlip the icon horizontally, vertically or both.
The icon.
This will be passed as children to the iconComponent, unless you supply a React
element (like JSX) to this prop, directly or via the <icon> slot.
iconComponent
Section titled “iconComponent”The component used to render the icon.
This will receive the icon prop as children and should handle it appropriately. This
prop is ignored in the case of a component being passed into the icon prop. It will
also receive the flip and size props as set on the component.
inline
Section titled “inline”Enables this component to be used in an "inline" context.
This is useful for when you have several of these components in a row and are not using a ui/Layoutui/Layout or flex-box configuration.
Default: falseThe position of the label in relation to the icon element.
Allowed values include:
'below' (default),
'above',
'left',
'right',
'before', and
'after'.
The 'before' and 'after' values automatically swap sides when in an RTL locale context.
Default: 'below'The size of the icon.
Applies the CSS class which can be customized by /docs/developer-guide/theming//docs/developer-guide/theming/.
LabeledIconDecorator Higher-Order Component
Section titled “LabeledIconDecorator   Higher-Order Component ”A higher-order component that adds ui/Slottableui/Slottable.Slottable support to ui/LabeledIconui/LabeledIcon.LabeledIconBase
Includes:
ui/Slottableui/Slottable.Slottable