Skip to content

stealkiller06/expo-radio-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published