ui/ Icon Button
An Icon that acts like a Button.
You may specify an image or a font-based icon by setting the children to either the path
to the image or a string from an iconList. This is unstyled,
but can easily be extended and customized by a theme or application.
import IconButton from '@enact/ui/IconButton';Members
IconButtonComponent
A minimally styled, but interactive, Button ready for customization by a theme.
Example:
<IconButton size="small">
plus
</IconButton>import IconButton from '@enact/ui/IconButton';IconButtonBaseComponent
A ui-styled button without any behavior.
import {IconButtonBase} from '@enact/ui/IconButton';Properties
This is the root component used to render the button and will receive all props except
icon.The component used to render the icon.
This component will receive the
flipandsizeproperty set on theIconButtonas well as theiconclass to customize its styling.Additional children that follow the icon.
If
iconisn't specified butchildrenis,childrenis used as the icon's value.Called with a reference to the root component.
When using ui/IconButton.IconButton, the
refprop is forwarded to this component ascomponentRef.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:
iconButton- The root component classicon- The icon component classlarge- Applied whensizeprop is'large'small- Applied whensizeprop is'small'pressed- Applied whenpressedprop istrue
Disables IconButton.
When
true, the button is shown as disabled and does not generateonClickevents.Default: falseFlip the icon horizontally, vertically or both.
The icon displayed within the IconButton.
If not specified,
childrenis used as the icon value instead.Applies the
pressedCSS class.Default: falseApplies the
selectedCSS class.Default: falseThe size of the button.
Applies the CSS class which can be customized by theming.
IconButtonDecoratorHigher-Order Component
A higher-order component that adds universal button behaviors to an IconButtonBase.
import {IconButtonDecorator} from '@enact/ui/IconButton';