Default Image

Radio

Radio component.

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

When To Use

  • Used to select a single state from multiple options.
  • The difference from Select is that Radio is visible to the user and can facilitate the comparison of choice, which means there shouldn't be too many of them.

Examples

Default

Default radio element.

Orientation

Orientation elements.

Types

Types radio.

Sizes

Size radio.

Error variant

With manual controller error.

Customize element.

Personalize colors to radio elements.

APIs

Radio Props

Api props extends from TouchableOpacity

AttributeTypeAccepted valuesDescriptionDefault
activeColorThemeColorThemeColorActive color of the elementinputColor
inactiveColorThemeColorThemeColorInactive color of the elementinputColor
labelstringTextRequired text to show in option-
onPressfunction(value: NumberStringValue) => voidonPress function trigger-
sizeSizeTypesmall middle largeSize of the radiomiddle
typeRadioTypecircle squareCircle or square variantcircle
valueNumberStringValueNumberStringValueValue of the controller input-

Radio Group Props

Api props extends from View

AttributeTypeAccepted valuesDescriptionDefault
activeColorThemeColorThemeColorActive color of the elementinputColor
alignAlignTypehorizontal verticalOrientation typehorizontal
inactiveColorThemeColorThemeColorInactive color of the elementinputColor
defaultValueNumberStringValueNumberStringValueDefault Value for element-
errorbooleantrue falseShow error variant-
onChangefunction(value: NumberStringValue) => voidOn change function trigger-
textErrorstringText StringMessage of the error, set with error prop in true-
valueNumberStringValueNumberStringValueValue of the controller input-
sizeSizeTypesmall middle largeSize of the radiomiddle
typeRadioTypecircle squareCircle or square variantcircle

NumberStringValue

type NumberStringValue = 'string' | 'number'

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.