Skip to content

Checkbox

A checkbox is an input control that allows a user to select one or more options from a number of choices.

Code

Variants

certara-checkbox is best used inside a certara-form-group.

Label
Help or instructional text goes here Optional help link
Disabled Disabled selected
<certara-checkbox name="example" layout="stacked">Label
<div slot="help">
Help or instructional text goes here
<certara-link target="_blank" icon="arrow-up-right-from-square" href="https://help.pinnacle21.net/en/articles/5157972-how-do-i-configure-studies">Optional help link</certara-link>
</div>
</certara-checkbox>
<certara-checkbox name="example2" layout="stacked" disabled>Disabled</certara-checkbox>
<certara-checkbox name="example3" layout="stacked" disabled checked >Disabled selected</certara-checkbox>

certara-checkbox

Properties

PropertyAttributeDescriptionTypeDefault
checkedcheckedbooleanfalse
disableddisabledbooleanfalse
indeterminateindeterminatebooleanfalse
inputTypeinput-typeInternal prop to make a radio button. Best to use the certara-radio component directly"checkbox" | "radio"'checkbox'
layoutlayoutLayout options for stacked or inline checkboxes"inline" | "stacked"'inline'
namenamestringundefined
sizesize"md" | "sm"'md'
valuevalueany'on'

Events

EventDescriptionType
certaraBlurStandard event emitted when checkbox is blurredCustomEvent<void>
certaraChangeStandard event emitted when checkbox is toggledCustomEvent<CheckboxChangeEventDetail<any>>
certaraFocusStandard event emitted when checkbox is focusedCustomEvent<void>

Slots

SlotDescription
Content for the label
"error"Error text that sits below the label
"help"Help text that sits below the label

Dependencies

Used by

Depends on

Graph

graph TD;
certara-checkbox --> certara-help-block
certara-dropdown-checkbox --> certara-checkbox
certara-radio --> certara-checkbox
style certara-checkbox fill:#f9f,stroke:#333,stroke-width:4px

In Practice

Checkboxes should:

  • Work independently from each other. Selecting one checkbox shouldn’t change the selection status of another checkbox in the list. The exception is when a checkbox is used to make a bulk selection of multiple items.
  • Be framed positively. For example, say “Show file path for uploaded data” instead of “Hide file path for uploaded data”.
  • Always have a label when used to activate or deactivate a setting.
  • Be listed according to a logical order, whether it’s alphabetical, numerical, time-based, or some other clear system.
  • Link to more information or include a subtitle as required to provide more explanation. Don’t rely on tooltips to explain a checkbox.

Content guidelines

Labels

  • Keep checkbox labels short and descriptive.
  • Start all checkbox labels with a capital letter.
  • Don’t include punctuation after checkbox labels.

Accessibility

Keyboard support

  • Move focus to each checkbox using the tab key (or shift + tab when tabbing backwards).
  • To interact with the checkbox when it has keyboard focus, press the space key.

Design resources

View component in Figma