Skip to main content

Check and Radios

The Check component provides a unified interface for rendering checkbox, radio button, and switch controls. It supports controlled and uncontrolled states, disabled state, inline layout, custom values, and Bootstrap-compatible utility props.

Import​

import { Form } from "@promethey/bsui";

Note

Check inherits all utility props supported by the Prime component, including layout, spacing, typography, colors, borders, sizing, positioning, and other Bootstrap utility APIs.

Basic usage​

Checkbox​

The default type is checkbox.

Checked​

Use defaultChecked to define the initial checked state.

Radio​

Use type="radio" for mutually exclusive options.

Switch​

Use type="switch" to render a Bootstrap switch control.

Disabled​

Use the disabled prop to prevent user interaction.

Inline​

Use the inline prop to display controls horizontally.

Controlled​

Use checked and onChange for controlled components.

Custom value​

Use the value prop to specify the submitted form value.

Utility props​

All utility props provided by Prime are supported.

API​

Check​

PropTypeDefaultDescription
labelstring—Text label associated with the control.
idstringgeneratedUnique identifier for the input element.
namestringnullForm field name.
type"checkbox" | "radio" | "switch""checkbox"Determines control type.
defaultCheckedbooleanfalseInitial checked state.
checkedboolean—Controlled checked state.
disabledbooleanfalseDisables the control.
valuestringnullValue submitted with the form.
onChangefunctionnullCalled when checked state changes.
inlinebooleanfalseDisplays control inline.
classNamestring | objectnullAdditional CSS classes.
styleobjectnullInline styles.

Check.Control​

PropTypeDefaultDescription
idstringnullInput identifier.
namestringnullInput name.
type"checkbox" | "radio" | "switch""checkbox"Input type.
defaultCheckedbooleanfalseInitial checked state.
checkedboolean—Controlled checked state.
disabledbooleanfalseDisables input.
valuestringnullInput value.
onChangefunctionnullChange handler.

Check.Label​

PropTypeDefaultDescription
childrenReactNode—Label content.
htmlForstringnullAssociates label with input.
classNamestringnullAdditional CSS classes.
styleobjectnullInline styles.