Default Image

Checkbox

Checkbox component.

import { Checkbox } from '@redshank/native';

When To Use

  • Used for selecting multiple values from several options.
  • If you use only one checkbox, it is the same as using Switch to toggle between two states. The difference is that Switch will trigger the state change directly, but Checkbox just marks the state as changed and this needs to be submitted.

Examples

Default

Default checkbox element.

Sizes

Change size to element.

Type Radio

Change aspect between `Square` and `Circle`.

Required

Required element.

Customize Colors

Customize color checkbox.

Error Variant

Set error in element.

APIs

Space Props

Api props extends from View

AttributeTypeAccepted valuesDescriptionDefault
activeColorThemeColorThemeColorActive color when value state is trueprimary
inactiveColorThemeColorThemeColorActive color when value state is falseaccents2
defaultValuebooleantrue falseDefault value for the element-
errorbooleantrue falseShow error variant-
labelstringTextRequired label for the show message-
onChangefunction(checked: boolean) => voidFunction trigger when the user press the element-
requiredbooleantrue falseIndicates if element is required-
sizeSizeRadiousTypesmall middle largeShow size of the elementmiddle
typeRadioTypecircle squareShow rounded or circle elementcircle
valuebooleantrue falseController value for the element-

Community:

We're excited to see the community adopt @redshank/native, raise issues, and provide feedback. Whether it's a feature request, bug report, or a project to showcase, please get involved!

DiscordGithub

Contributing:

PR's on @redshank/native are always welcome, please see our contribution guidelines to learn how you can contribute to this project.

Copyright © 2023 @redshank.