Command palette

@yasinsensoy/native

React Native · Components

RadioGroup

A single-choice option list (the same options API as RadioGroup on web).

3 exports

Import

import { RadioGroup } from "@yasinsensoy/native";

RadioGroup

component

A single-choice option list (the same options API as RadioGroup on web). The circle is 16 px and the selected inner dot 8 px; the same on both platforms.

RadioGroup(props: RadioGroupProps<V>): ReactElement<unknown, string | JSXElementConstructor<any>>

Examples

<RadioGroup
  label="Delivery"
  options={[{ value: "shipping", label: "Shipping" }, { value: "pickup", label: "Pick up in store" }]}
  value={delivery}
  onValueChange={setDelivery}
/>

RadioOption

interface

An option of RadioGroup.

NameTypeDescription
valueVValue.
labelReactNodeDisplay name.
description?ReactNodeDescription below the name.
disabled?booleanThis option is disabled.

Props of RadioGroup.

Extends: FieldProps

NameTypeDefaultDescription
ref?Ref<ViewRef>Ref of the underlying native element.
optionsreadonly RadioOption<V>[]Options.
value?V | nullSelected value (controlled).
defaultValue?V | nullInitially selected value (uncontrolled).
onValueChange?(value: V) => voidWhen the selection changes.
orientation?"vertical" | "horizontal""vertical"Layout direction.
style?StyleProp<ViewStyle>Container style.