moonstone/ Button
Moonstone styled button components and behaviors.
import Button from '@enact/moonstone/Button';Members
ButtonComponent
A button component, ready to use in Moonstone applications.
Usage:
<Button
backgroundOpacity="translucent"
color="blue"
>
Press me!
</Button>import Button from '@enact/moonstone/Button';ButtonBaseComponent
A button component.
This component is most often not used directly but may be composed within another component as it is within Button.
import {ButtonBase} from '@enact/moonstone/Button';Properties
The background opacity of this button.
Valid values are:
'translucent','lightTranslucent', and'transparent'.
The color of the underline beneath button's content.
Accepts one of the following color names, which correspond with the colored buttons on a standard remote control:
'red','green','yellow','blue'.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:
button- The root class namebg- The background node of the buttonlarge- Applied to asize='large'buttonselected- Applied to aselectedbuttonsmall- Applied to asize='small'button
Specifies on which side (
'before'or'after') of the text the icon appears.Default: 'before'Enforces a minimum width on the Button.
NOTE: This property's default is
trueand must be explicitly set tofalseto allow the button to shrink to fit its contents.Default: trueThe size of the button.
Default: 'small'
ButtonDecoratorHigher-Order Component
Applies Moonstone specific behaviors to Button components.
import {ButtonDecorator} from '@enact/moonstone/Button';