Checkbox
The cornerstone of any UI component is probably the checkbox. Pretty Checkbox support checkoxes with a wide range of usage. Be sure to checkout the basic concepts guide for more info!
Basic Checkbox
Our basic checkbox can take on three different shapes: square, p-curve
, p-round
Colors, Icon, and Animations
Checkbox supports colors, icons, animations.
There are five animations classes available that can be added to the root div: p-smooth
, p-pulse
, p-tada
, p-jelly
, and p-rotate
.
Indeterminate
Pretty checkbox supports indeterminate states, too although you'll need to use a little javascript to make this happen:
Indeterminates with React
One way we can make this work is by exposing an indeterminate
prop and passing a ref
to the HTMLInputElement
, the main point here is we want our effect to run whenever indeterminate
changes:
Indeterminates with React Class
Not on the hooks train yet ๐ ? No biggie. Just remember we can register side effects in componentDidMount
since it's called whenever props or state changes ๐