Radio
Radio controls are pretty much essential for any application. PCR makes it easy to add stylish radio controls to your application ๐
#
Shapes, Variants, & StatesThere's no "one size fits all" for input controls like Radio.
Thankfully, PCR allows you to represent Radio in various ways via the shape
and variant
prop
for pre-bundled fun. See the shapes
docs for more details.
SyntaxError: Unexpected token (1:8) 1 : return () ^
#
Disabled & LockedOf course disabled
is supported, but there's also a secondary state called locked
.
See the states docs for more details.
SyntaxError: Unexpected token (1:8) 1 : return () ^
#
ScalabilityOut of the box, PCR offers a bigger
prop to make all input controls just a tad bit larger.
For more fine-grained control check out the size docs.
SyntaxError: Unexpected token (1:8) 1 : return () ^
#
UncontrolledRadio
forwards refs
to the input element ๐.
See the uncontrolled component docs for more info.
SyntaxError: Unexpected token (1:8) 1 : return () ^
#
ControlledPCR exposes helpful state hooks to make managing state a breeze. For radio you should use useRadioState
.
See the controlled component docs for more info.
#
Boolean RadiosLike checkbox, Radio
supports boolean modes for simple yes/no options:
SyntaxError: Unexpected token (1:8) 1 : return () ^
#
Named RadiosTypically Radio
will have a value
associated with the control. Unlike checkbox, Radio
works with single controls and does not store named results in an array.
SyntaxError: Unexpected token (1:8) 1 : return () ^