New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dooboo-ui/native-button-group

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dooboo-ui/native-button-group

[![Npm Version](http://img.shields.io/npm/v/@dooboo-ui/native-button-group.svg?style=flat-square)](https://npmjs.org/package/@dooboo-ui/native-button-group) [![Downloads](http://img.shields.io/npm/dm/@dooboo-ui/native-button-group.svg?style=flat-square)](

  • 0.7.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ButtonGroup

Npm Version Downloads

[ButtonGroup] is an ios section like component. You can have as may selectors as you want.

ButtonGroup

Props

necessarytypesdefault
testIDstring
containerStyleStyleProp<ViewStyle>
styleStyleProp<ViewStyle>
viewStyleStyleProp<ViewStyle>
selectedViewStyleStyleProp<ViewStyle>
textStyleStyleProp<TextStyle>
selectedTextStyleStyleProp<TextStyle>
datastring[]['Option 1', 'Option 2']
onPress(i: number) => void

Installation

yarn add @dooboo-ui/native

or

yarn add @dooboo-ui/native-button-group

Getting started

  • Import

    import { ButtonGroup } from '@dooboo-ui/native';
    // or
    import ButtonGroup from '@dooboo-ui/native-button-group';
    
  • Usage

    function Page(props: Props) {
      const data = ['Option 1', 'Option 2', 'Option 3', 'Option 4'];
    
      const [option, setOption] = useState('Option 1');
    
      const selectOption = (index: number) => {
        setOption(data[index]);
        switch (index) {
          case 0:
            setOption('Option 1');
            break;
          case 1:
            setOption('Option 2');
            break;
        }
      };
    
      return (
        <Container>
          <ButtonGroup
            testID="BTN_GROUP"
            style={{ marginTop: 40 }}
            onPress={(index: number) => selectOption(index)}
            data={data}
          />
          <View
            style={{
              flex: 1,
              justifyContent: 'center',
              alignItems: 'center',
            }}
          >
            <Text
              style={{
                fontSize: 32,
              }}
            >
              {option}
            </Text>
          </View>
        </Container>
      );
    }
    

Keywords

FAQs

Package last updated on 26 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc