Checkbox React Component

Checkbox React component represents Checkbox component.

Checkbox Components

There are following components included:

  • Checkbox / F7Checkbox

Checkbox Properties

PropTypeDefaultDescription
<Checkbox> properties
checkedbooleanDefines whether the checkbox input is checked or not
defaultCheckedbooleanDefines whether the checkbox input is checked or not, for the case if it is uncontrolled component
namestring
number
Checkbox input name
valuestring
number
boolean
Checkbox input value
disabledbooleanDefines whether the checkbox input is disabled
readonlybooleanDefines whether the checkbox input is readonly

Checkbox Events

EventDescription
<Checkbox> events
changeEvent will be triggered when checkbox state changed

Checkboxes List

Checkboxes List is not a separate component, but just a particular case of using <List>, <ListItem>.

<List>
  <!-- Additional "checkbox" prop to enable checkbox list item -->
  <ListItem checkbox value="check_1" checked title="Checkbox 1"></ListItem>
  <ListItem checkbox value="check_2" title="Checkbox 2"></ListItem>
</List>

Examples

<BlockTitle>Inline</BlockTitle>
<Block strong>
  <p>Lorem <Checkbox name="checkbox-1"></Checkbox> ipsum dolor sit amet, consectetur adipisicing elit. Alias beatae illo nihil aut eius commodi sint eveniet aliquid eligendi <Checkbox name="checkbox-2" defaultChecked></Checkbox> ad delectus impedit tempore nemo, enim vel praesentium consequatur nulla mollitia!</p>
</Block>

<BlockTitle>Checkbox Group</BlockTitle>
<List>
  <ListItem checkbox title="Books" name="demo-checkbox" defaultChecked></ListItem>
  <ListItem checkbox title="Movies" name="demo-checkbox"></ListItem>
  <ListItem checkbox title="Food" name="demo-checkbox"></ListItem>
  <ListItem checkbox title="Drinks" name="demo-checkbox"></ListItem>
</List>

<BlockTitle>With Media Lists</BlockTitle>
<List mediaList>
  <ListItem
    checkbox
    defaultChecked
    name="demo-media-checkbox"
    title="Facebook"
    after="17:14"
    subtitle="New messages from John Doe"
    text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
  ></ListItem>
  <ListItem
    checkbox
    name="demo-media-checkbox"
    title="John Doe (via Twitter)"
    after="17:11"
    subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
    text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
  ></ListItem>
  <ListItem
    checkbox
    name="demo-media-checkbox"
    title="Facebook"
    after="16:48"
    subtitle="New messages from John Doe"
    text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
  ></ListItem>
  <ListItem
    checkbox
    name="demo-media-checkbox"
    title="John Doe (via Twitter)"
    after="15:32"
    subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
    text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
  ></ListItem>