moonstone/FormCheckboxItem

Exports FormCheckboxItemBase and FormCheckboxItem (default) components.

import FormCheckboxItem from '@enact/moonstone/FormCheckboxItem';

Members

FormCheckboxItemComponent

FormCheckboxItem is the composed version of FormCheckboxItemBase which adds the Toggleable High Order Component to support interactivity of the component. FormCheckboxItem has two states: true (selected) & false (unselected). It uses a check icon to represent its selected state.

By default, FormCheckboxItem 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 FormCheckboxItem from '@enact/moonstone/FormCheckboxItem';

FormCheckboxItemBaseComponent

FormCheckboxItemBase is a stateless component that is an extension of Item that supports toggleableability. It has two states: true (selected) & false (unselected). It uses a check icon to represent its selected state. This differs from CheckboxItemBase, only visually, in its handling of Spotlight focus. This item receives focus, but the entire element does not appear focused, relying on its child element FormCheckbox to reflect that state.

import {FormCheckboxItemBase} from '@enact/moonstone/FormCheckboxItem';
Properties
children
String

The string to be displayed as the main content of the checkbox item.

disabled
Boolean

When true, applies a disabled style and the control becomes non-interactive.

Default: false
iconPosition
String

Specifies on which side (before or after) of the text the icon appears.

Default: 'before'
inline
Boolean

When true, an inline visual effect is applied to the button.

Default: false
onToggle
Function

The handler to run when the checkbox item is toggled.

selected
Boolean

When true, a check mark icon is applied to the button.

value
StringNumber

The value that will be sent to the onToggle handler.

Default: ''
ArrayBooleanFunctionModuleNumberObjectString