PrimitivesView source

Checkbox

A native checkbox. Reliable, familiar, and keyboard accessible.

Installation

Run the source CLI from a Blocks UI checkout. This package is not published to npm.

node packages/cli/index.js add checkbox

Or copy the source files above. Include tokens.css and base.css once in your project.

Usage

Use semantic HTML and the shared foundation styles. Interactive primitives also export a decorate function.

<div class="checkbox"><input type="checkbox" id="terms" name="terms"><label for="terms">I agree to the terms and conditions.</label></div>

Variants

Choose a variant in the live preview. Add its class to the authored block.

default

Accessibility & behavior

Semantic HTML, visible focus states, shared contrast-aware tokens, and responsive styles provide an accessible foundation. Preserve labels and heading hierarchy when customizing.

Multiple instances are supported. Layouts adapt to smaller viewports. No npm dependencies are required at runtime.

AEM usage

Primitives belong inside authored blocks, not as nested EDS blocks. Copy their styles and markup into the parent block implementation.

Compatibility

Standalone verified. EDS markup compatible. Live AEM integration has not been verified.

Edit this example on GitHub

Search documentation

Search the docs, components, and blocks. Use Tab to select a result.