moonstone/ Toggle Button
Provides a Moonstone-themed toggle button component and behaviors.
import ToggleButton from '@enact/moonstone/ToggleButton';Members
ToggleButtonComponent
A toggleable button.
By default, ToggleButton maintains the state of its selected property.
Supply the defaultSelected property to control its initial value. If you
wish to directly control updates to the component, supply a value to selected at creation time
and update it in response to onToggle events.
import ToggleButton from '@enact/moonstone/ToggleButton';ToggleButtonBaseComponent
A stateless Button that can be toggled by changing its
selected property.
import {ToggleButtonBase} from '@enact/moonstone/ToggleButton';Properties
The background-color opacity of this button.
Values:
'translucent','lightTranslucent','transparent'
The string to be displayed as the main content of the toggle button.
If
toggleOffLabeland/ortoggleOnLabelare provided, they will be used for the respective states.Disables the button.
Default: falseEnforces 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: trueApplies a pressed visual effect.
Indicates the button is 'on'.
Default: falseThe size of the button.
A
'small'button will have a larger tap target than its apparent size to allow it to be clicked more easily.Default: 'large'Button text displayed in the 'off' state.
If not specified,
childrenwill be used for 'off' button text.Default: ''Button text displayed in the 'on' state.
If not specified,
childrenwill be used for 'on' button text.Default: ''