Skip to Content
Nextra 4.0 is released 🎉

Checkbox

The Checkbox component provides a pixel-art styled checkbox control for selecting options in a retro-inspired interface.
It supports labels, custom colors, themes, disabled state, and different visual types—allowing you to create expressive and nostalgic checkbox interactions while maintaining full flexibility and accessibility.


Checkbox basic example


<Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} />

Checkbox type


<Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} /> <Checkbox label="I agree to the terms" name="agreement" type="inline" onChange={mockFunction} />

Checkbox default checked


<Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} defaultChecked />

Checkbox no label


<Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} noLabel />

Checkbox disabled


<Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} disabled />

Checkbox custom color


<Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} backgroundColor="#05EB57" />

Checkbox styles


<Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} checkboxStyle="dark" /> <div className="p-5 bg-black"> <Checkbox label="I agree to the terms" name="agreement" type="main" onChange={mockFunction} checkboxStyle="light" /> </div>

đź”§ Props

PropTypeDefaultDescription
labelstring—The text label displayed next to the Checkbox.
typeCheckboxType—Determines the visual style of the Checkbox (main, inline).
namestring—A unique name identifier for the Checkbox input.
defaultCheckedbooleanfalseSets the initial checked state of the Checkbox.
noLabelbooleanfalseHides the label when set to true.
backgroundColorstringundefinedSets a custom background color for the checkbox checkmark.
classNamestringundefinedAdds additional CSS classes for custom styling.
checkboxStyleCheckboxStyle"dark"Applies a predefined PixelartUI style or theme to the Checkbox.
disabledbooleanfalseDisables the Checkbox when set to true.
onChange(e: React.ChangeEvent<HTMLInputElement>) => voidundefinedCallback fired when the Checkbox value changes.
Last updated on