expo-radio-button

1.0.8 • Public • Published

expo-radio-button

Build Status

expo-radio-button is a beautiful and flexible radio button component

DEMO

Installation

npm i expo-radio-button --save
yarn add expo-radio-button

Example

import React, { useState } from "react";
import { Text, View } from "react-native";
import RadioButtonGroup, { RadioButtonItem } from "expo-radio-button";
export default function App() {
  const [current, setCurrent] = useState("test");

  return (
    <View style={{ marginTop: 50 }}>
      <RadioButtonGroup
        containerStyle={{ marginBottom: 10 }}
        selected={current}
        onSelected={(value) => setCurrent(value)}
        radioBackground="green"
      >
        <RadioButtonItem value="test2" label="Example with string" />
        <RadioButtonItem
          value="test"
          label={
            <Text style={{ color: "red" }}>Example passing React Element</Text>
          }
        />
      </RadioButtonGroup>
    </View>
  );
}

Properties RadioButtonGroup

Property Description
selected Current value selected
size (integer) Radio button size
containerStyle Container Style
radioStyle Radio Button Style
radioBackground default blue

Events RadioButtonGroup

Property Description
onSelected method called when pressed

Properties RadioButtonItem

Property Description
value option value
label (string or JSX.element)
style View Style

License

MIT

Free Software, Hell Yeah!

Package Sidebar

Install

npm i expo-radio-button

Weekly Downloads

767

Version

1.0.8

License

MIT

Unpacked Size

6.6 kB

Total Files

4

Last publish

Collaborators

  • stealkiller