For AI agents: the complete documentation index is at llms.txt. Markdown versions are available by appending .md or sending Accept: text/markdown.
Reflex Logo
Docs Logo
Library

/

Forms

/

Checkbox

Checkbox

Basic Example

The on_change trigger is called when the checkbox is clicked.

false

The input prop is used to set the checkbox as a controlled component.

Example Form

Results:

{}
Expand

API Reference

rx.checkbox

A checkbox component with a label.

rx.checkbox("Basic Checkbox",
size="1",
variant="classic",
color_scheme="tomato",
high_contrast=False,
disabled=False,
)
size
variant
color_scheme
high_contrast
disabled

Props

PropTypeDescription
text
str

The text label for the checkbox.

spacing
"0""1""2""3""4""5""6""7""8""9"

The gap between the checkbox and the label.

size
"1""2""3"

The size of the checkbox "1" - "3".

as_child
bool

Change the default rendered element for the one passed as a child, merging their props and behavior.

variant
"classic""surface""soft"

Variant of checkbox: "classic" | "surface" | "soft".

color_scheme
"tomato""red""ruby""crimson""pink""plum""purple""violet""iris""indigo""blue""cyan""teal""jade""green""grass""brown""orange""sky""mint""lime""yellow""amber""gold""bronze""gray"

Override theme color for checkbox.

high_contrast
bool

Whether to render the checkbox with higher contrast color against background.

default_checked
bool

Whether the checkbox is checked by default.

checked
bool

Whether the checkbox is checked.

disabled
bool

Whether the checkbox is disabled.

required
bool

Whether the checkbox is required.

name
str

The name of the checkbox control when submitting the form.

value
str

The value of the checkbox control when submitting the form.

Event Triggers

See the full list of default event triggers
TriggerDescription
on_changeFired when the checkbox is checked or unchecked.
Built with Reflex