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

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

  • 0.3.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ButtonGroup

[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

Getting started

  • Import

    import { ButtonGroup } from '@dooboo-ui/native';
    
  • 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 24 Nov 2019

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