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
Checkinherits all utility props supported by thePrimecomponent, 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​
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Text label associated with the control. |
id | string | generated | Unique identifier for the input element. |
name | string | null | Form field name. |
type | "checkbox" | "radio" | "switch" | "checkbox" | Determines control type. |
defaultChecked | boolean | false | Initial checked state. |
checked | boolean | — | Controlled checked state. |
disabled | boolean | false | Disables the control. |
value | string | null | Value submitted with the form. |
onChange | function | null | Called when checked state changes. |
inline | boolean | false | Displays control inline. |
className | string | object | null | Additional CSS classes. |
style | object | null | Inline styles. |
Check.Control​
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | null | Input identifier. |
name | string | null | Input name. |
type | "checkbox" | "radio" | "switch" | "checkbox" | Input type. |
defaultChecked | boolean | false | Initial checked state. |
checked | boolean | — | Controlled checked state. |
disabled | boolean | false | Disables input. |
value | string | null | Input value. |
onChange | function | null | Change handler. |
Check.Label​
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Label content. |
htmlFor | string | null | Associates label with input. |
className | string | null | Additional CSS classes. |
style | object | null | Inline styles. |