Revel
GitHub
GitHub
  • Overview

    • Getting started
    • FAQ
    • Release notes
  • Foundations

    • Meet the standard
    • Accessibility
    • Internationalization
    • Information hierarchy
    • Speed
  • Design

    • Visual principles
    • Colors
    • Space
    • Icons
    • Typography
  • Design tokens
  • Style helpers
  • Content

    • Express your ideas
    • Actionable language
    • Inclusive and accessible language
    • Alternative text
    • Grammar and mechanics
      • Basics
      • Capitalization
      • Dates and units of measurement
      • Punctuation
  • Components

    • Alert
    • Avatar
    • Badge
    • Button
    • Button group
    • Checkbox
    • Date Input
      • dates
      • datetimes
      • ranges
    • Field group
    • File upload
    • Flex
    • Grid
    • Icon
    • Image
    • Input
    • Loader
    • Modal
    • Month picker
    • Pagination
    • Popper
    • Radio
    • Repeater
    • Select
    • Tabs
    • Tile
    • Toast
    • Toggle
  • Directives

    • Click outside
    • Tooltip

Checkbox

The r-checkbox component is another basic element for user input. A checkbox is used to choose between two opposite states, often to select/deselect items or enable/disable actions.

Usage

Use checkboxes to provide a binary choice. For example to offer a choice about performing an action or not. It is considered “on” when it is checked, and “off” when it’s not.

Examples

Use one checkbox to offer one binary choice. You can also have caption to descript the option in more details.

checkbox-single.vue

You can use checkboxes as a group on related options.

checkbox-group.vue

You also can use the checkboxes in nested group. There is also fuzzy option to show partial selecting for children.

checkbox-nested.vue
checkbox-disabled.vue

API

Props

NameTypeDefaultDescription
labelstring''

Label for the checkbox

idstring() => nanoid()

Unique id of the checkbox

captionstringundefined

A text to describe the checkbox

modelValueunion, string, number, boolean, Arrayfalse

Actual parent model for the component

valueunion, string, boolean'on'

Used to decide if checkbox is selected. If this value exists in the v-model (array) or equals it, the checkbox shows as checked.

fuzzybooleanfalse

Semi-selected state

disabledbooleanfalse

Disable checkbox

validateNullable, ValidationStatenull

Validation result sent by Vuelidate

Slots

NameDescription
label

Holds the checkbox label and can contain HTML.

Events

NameDescription
update:modelValue

Copy writing rules

  • Use the imperative voice for checkbox labels.
  • Do not use terminal punctuation for checkbox labels.
  • Maintain parallel construction for lists of related checkbox labels.
Edit this page
Last Updated: 7/6/23, 6:53 AM
Contributors: Alberto Gualis, Peyman Eskandari, Cesar Level, John Hannagan, Weetbix
Prev
Button group
Next
Date Input