• Skip to the menu
  • Skip to the main content
Back
Logo Ipedis

COMPONENTS

Checkbox-list

A checkbox is a component that allows users to make a selection from a set of options. Typically presented as a small square box, it can be either checked (selected) or unchecked (not selected). Checkboxes are commonly used in forms and settings where users can indicate their choices or preferences. They are particularly useful for options that are not mutually exclusive, allowing multiple selections from a group of choices. When a checkbox is selected, a checkmark or a tick (✓) appears inside the box, visually indicating the user's choice.

Demo

Code

Documentation

Installation

Follow these steps to install and use the ip-checkbox-list component in your project.

Step 1

Install the ip-checkbox-list component as a dependency in your project:

npm install ip-checkbox-list

Step 2

Import the module in your script file:

 

Usage

To use this component, add the properties as attributes.

Properties

Property Attribute Necessity Description Type Default
optionsoptionsRequired An array of objects used to pass options as checkboxes. stringUndefined
ididRequired L'identifiant du champ pour l’accessibilité. stringUndefined
defaultCheckeddefault-checkedOptional Sets the checkbox to checked by default. booleanfalse
disableddisabledOptional Disable the checkbox, preventing any interaction. booleanfalse
legendlegendOptional The legend for the list of checkboxes stringUndefined

Example:

Customization

We have a set of predefined variables used to customize the checkbox:

  • --primary-color
  • --secondary-color
  • --font-size
  • --checkbox-size
To update the values, use the following CSS:

Listening to Events

To listen to events emitted by the ip-checkbox and ip-checkbox-list components, open your browser's console. Event details will be displayed in the console when checkboxes are modified.

Example JavaScript Code


              
  • Privacy and cookie policy Opens in a new window
  • Legal Notice Opens in a new window
  • Ipedis.com Opens in a new window