Skip to main content

Checkbox

A component enabling the user to switch between a checked and unchecked state.

Code Example

import { Checkbox, Glass } from "@coconut-xr/apfel-kruemel";

export default function Checkboxes() {
return (
<Glass borderRadius={32} padding={16} flexDirection="column" gapRow={16}>
<Checkbox defaultSelected={false} />
<Checkbox defaultSelected={true} />
</Glass>
);
}

Sandbox

Params

NameTypeAttributesDescription
selectedbooleanoptional / default: falseIf true, the checkbox is checked
defaultSelectedbooleanoptionalThe default checked state
onSelectedChange(value: boolean) => voidoptionalCallback fired when the selected state is changed.