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

COMPONENTS

Simple Checkbox

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

Check me !

Code

Documentation

Installation

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

Step 1

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

npm install ip-checkbox

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
idid Required The ID of the input for accessibility stringUndefined
namename Required The name of the input for accessibility stringUndefined
defaultCheckeddefault-checked Optional Sets the checkbox to checked by default booleanfalse
disableddisabled Optional Disables the checkbox booleanfalse

Content

A predefined label slot is available to display the label text before the checkbox. The content placed in this slot will be rendered inside the component's tag.

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