1.0.8 • Published 3 years ago

expo-radio-button v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

PropertyDescription
selectedCurrent value selected
size(integer) Radio button size
containerStyleContainer Style
radioStyleRadio Button Style
radioBackgrounddefault blue

Events RadioButtonGroup

PropertyDescription
onSelectedmethod called when pressed

Properties RadioButtonItem

PropertyDescription
valueoption value
label(string or JSX.element)
styleView Style

License

MIT

Free Software, Hell Yeah!

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago