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

@dooboo-ui/native-button

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dooboo-ui/native-button

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

  • 0.3.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Button

Npm Version Downloads

[Button] component that can be used inside product. Has basic features like loading state, disabled state and also has ability to put img to left-hand which is used very often.

image

Props

necessarytypesdefault
testIDstring
styleViewStyle
textStyleTextStyle
darkboolean
invertedboolean
isLoadingboolean
isDisabledboolean
iconLeftReactElement
iconRightReactElement
indicatorColorstring'#ffffff'
activeOpacitynumber0.5
childrenstringReactElement
textstring
onClickfunc

Installation

yarn add @dooboo-ui/native

or

yarn add @dooboo-ui/native-button

Getting started

  • Import

    import { Button } from '@dooboo-ui/native';
    
  • Usage

    • with StyleSheet
    import Button from '@dooboo-ui/native';
    
    <Button
      testID="sampleButton"
      style={{
        width: 136,
        height: 60,
        borderWidth: 1,
      }}
      theme={{
        ...theme,
        backgroundColor: 'black',
        borderColor: 'red',
        fontColor: 'blue',
      }}
      onClick={(): void => {}}
    >
      Sample button
    </Button>;
    
    • with styled-components
    import { Button } from '@dooboo-ui/native';
    // or
    import Button from '@dooboo-ui/native-button';
    
    const SampleButton = styled(Button)`
      width: 136px;
      height: 60px;
      background-color: black;
      border-color: red;
      border-width: 1px;
    `;
    
    <SampleButton testID="sampleButton" onClick={(): void => {}}>
      Sample button
    </SampleButton>;
    
    const SampleText = styled.Text`
      color: white;
    `;
    
    <SampleButton testID="sampleButton" onClick={(): void => {}}>
      <SampleText>Sample button</SampleText>
    </SampleButton>;
    
    import Button, { ThemeType } from '@dooboo-ui/native';
    
    const SampleButton: StyledComponent<
      // If 'theme' prop is used, should specify 'ThemeType' for the 'StyledComponent'.
      typeof Button,
      ThemeType,
      {},
      never,
    > = styled(Button)`
      width: 136px;
      height: 60px;
      border-width: 1px;
    `;
    
    <SampleButton
      testID="sampleButton"
      theme={{
        // ThemeType
        ...theme,
        backgroundColor: 'black',
        borderColor: 'red',
        fontColor: 'blue',
      }}
      onClick={(): void => {}}
    >
      Sample button
    </SampleButton>;
    
    function Page(props: Props) {
      return (
        <Container>
          <Button testID="btn" isLoading={false} onClick={() => {}}>
            😀 😎 👍 💯
          </Button>
          <Button
            style={{
              marginVertical: 40,
            }}
            isDisabled={true}
            onClick={() => {}}
          >
            This is disabled!!
          </Button>
          <Button
            testID="btnGoogle"
            iconLeft={<Image source={IC_GOOGLE} />}
            isLoading={googleLoading}
            indicatorColor="#023059"
            onClick={() => {
              setGoogleLoading(true);
              const timeout = setTimeout(() => {
                setGoogleLoading(false);
                clearTimeout(timeout);
              }, 2000);
            }}
          >
            GOOGLE SIGN IN
          </Button>
          <Button
            testID="btnFacebook"
            iconLeft={<Image source={IC_FACEBOOK} />}
            indicatorColor="#023059"
            isLoading={facebookLoading}
            style={{
              marginTop: 40,
              backgroundColor: '#ccc',
              borderWidth: 0.5,
              borderRadius: 0,
            }}
            onClick={() => {
              setFacebookLoading(true);
              const timeout = setTimeout(() => {
                setFacebookLoading(false);
                clearTimeout(timeout);
              }, 2000);
            }}
          >
            FACEBOOK SIGN IN
          </Button>
        </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