Skip to main content

Checkbox

A checkbox widget is a user interface component that allows users to select one or multiple options from a set. Represented by a small square, it can be checked or unchecked and generally has an associated text label.

src/main.tsx

import { WCheckbox } from "@cedro/ui/checkbox.ui";
import { WContainer, WSpacer } from "@cedro/ui/container.ui";
import { createWidget } from "@cedro/ui/widget.builder";

export default createWidget(
<WContainer orientation="vertical">
<WSpacer />
<WContainer orientation="horizontal" fixedSize={45} padding={5}>
<WSpacer />
<WCheckbox text="Switch One" checked />
<WCheckbox text="Switch Two" />
<WCheckbox text="Switch Three" />
<WSpacer />
</WContainer>
<WSpacer />
</WContainer>
);

Properties

The Checkbox widget inherits from ToggleButton class → Has all ToggleButton properties.

Constructor

ParameterTypeRequiredDescription
idstringyesThe id of the widget
textstringyesThe label of the widget
parentWidgetnoThe parent of the widget. Default is null