Skip to main content
Version: 1.0.3

Checkbox

Overview

The checkbox component allows users to select one or more items from a set, or toggle between two states.

Preview



Installation

ignix add component checkbox

Usage

Import the component:

import { Checkbox } from '@mindfiredigital/ignix-ui';

Basic Checkbox

import React from 'react';
import { Checkbox } from '@mindfiredigital/ignix-ui';
function BasicCheckbox() {
const [checked, setChecked] = React.useState(false);

return (
<Checkbox
checked={checked}
onChange={setChecked}
label="Accept terms and conditions"
/>
);
}

Controlled

The checkbox can be used in both controlled and uncontrolled modes:

// Controlled
function ControlledCheckbox() {
const [checked, setChecked] = React.useState(false);

return (
<Checkbox
checked={checked}
onChange={setChecked}
label="Controlled checkbox"
/>
);
}

Examples

Basic Checkbox

With Label

All Variants

All Sizes

Checkbox Group



Selected: option1

Animation Variants

Props

PropTypeDefaultDescription
variant'default' | 'primary' | 'success' | 'warning' | 'danger' | 'outline' | 'subtle' | 'glass' | 'neon''default'The visual style of the checkbox
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'The size of the checkbox
labelstring-Optional label text
labelPosition'left' | 'right''right'Position of the label relative to the checkbox
errorstring-Error message to display
disabledbooleanfalseWhether the checkbox is disabled
animationVariant'none' | 'bounce' | 'scale' | 'pulse' | 'glow' | 'shake' | 'flip' | 'nina''none'Animation style for interactions
checkedboolean-Controlled checked state
defaultCheckedboolean-Default checked state for uncontrolled usage
onChange(checked: boolean) => void-Callback when checked state changes
asChildbooleanfalseMerge props onto child element
classNamestring-Additional CSS classes to apply