CheckboxCard
Presents a descriptive checkbox choice with native form behavior and a visible selection indicator.
See it and copy it
Framework example
Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
View CheckboxCard code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.---
import {
CheckboxCard,
CheckboxGroup
} from '@santi020k/lumen-astro'
---
<CheckboxGroup legend="Stay informed">
<CheckboxCard
checked
description="A monthly summary of new features and improvements."
label="Product updates"
name="card-notifications"
value="product"
>Delivered monthly</CheckboxCard>
<CheckboxCard
description="Tips for creating consistent interfaces with your team."
label="Design resources"
name="card-notifications"
value="resources"
variant="soft"
/>
<CheckboxCard
description="Your workspace administrator manages these notifications."
disabled
label="Security notices"
name="card-notifications"
value="security"
/>
</CheckboxGroup>import {
CheckboxCard,
CheckboxGroup
} from '@santi020k/lumen-react'
export const Example = () => (
<>
<CheckboxGroup legend="Stay informed">
<CheckboxCard
defaultChecked
description="A monthly summary of new features and improvements."
label="Product updates"
name="card-notifications"
defaultValue="product"
>Delivered monthly</CheckboxCard>
<CheckboxCard
description="Tips for creating consistent interfaces with your team."
label="Design resources"
name="card-notifications"
defaultValue="resources"
variant="soft"
/>
<CheckboxCard
description="Your workspace administrator manages these notifications."
disabled
label="Security notices"
name="card-notifications"
defaultValue="security"
/>
</CheckboxGroup>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<fieldset>
<legend>Workspace preferences</legend>
<lumen-checkbox-card variant="soft">
<label>
<input type="checkbox" name="workspace" value="personal" checked aria-labelledby="checkbox-label" aria-describedby="checkbox-description">
<span data-slot="selection-card-content">
<span data-slot="selection-card-label" id="checkbox-label">Personal workspace</span>
<span data-slot="selection-card-description" id="checkbox-description">A focused space for your own projects.</span>
<span data-slot="selection-card-addon">One member</span>
</span>
</label>
</lumen-checkbox-card>
</fieldset>Choose your target
Add this component
Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.
pnpm add @santi020k/lumen-astrolumen add CheckboxCardpnpm add @santi020k/lumen-reactlumen add CheckboxCard --target reactpnpm add @santi020k/lumen-elementslumen add CheckboxCard --target elementsAPI reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
| Attribute | Values | Default | Description |
|---|---|---|---|
| label, description | string / ReactNode | label required | Provides the visible label and optional associated description. |
| variant | "outline" | "soft" | "outline" | Sets the unselected surface; selection remains visible through the native indicator and border. |
| icon / icon slot | ReactNode / Astro named slot | - | Adds decorative content before the label. Keep children and icons non-interactive. |
| children / default slot | phrasing content | - | Adds supplementary metadata below the description. |
| invalid | boolean | false | Sets aria-invalid on the input. Associate error text using aria-describedby. |
| name, value, checked, disabled, required, form | native input attributes | - | Passes native form attributes to the checkbox input. React also accepts defaultChecked. |
| label > input | native child contract | required | Provide a direct label containing a checkbox input and selection-card content slots. Set input state and ARIA on that native control. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |
Keyboard interactions
Keyboard behavior provided by native HTML controls.
| Key | Action |
|---|---|
| Tab | Focus the native checkbox. |
| Space | Toggle the focused choice. |