@cc-test2/clickoutside

1.0.9 • Public • Published

clickoutside

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save @cc-test2/clickoutside

Usage

import React, { Component } from 'react'
import {Box, Button, Code, Grid, Text, useDisclosure} from "@chakra-ui/core";
import ClickOutside from "@cc-test2/clickoutside";

const ExampleComponent = () => {
    const {isOpen, onOpen, onClose} = useDisclosure();
    return (
         <>
           {
               isOpen ?
                   <ClickOutside handleAction={onClose}>
                       <Box rounded='md' bg='red.400' color='white' p={4}>
                           Click outside this button to close it</Box>
                   </ClickOutside> :
                   <Button variantColor={'blue'} onClick={onOpen}>Open Box</Button>
           }
         </>)
}

License

MIT © CodeCraft

Readme

Keywords

none

Package Sidebar

Install

npm i @cc-test2/clickoutside

Weekly Downloads

0

Version

1.0.9

License

MIT

Unpacked Size

7.78 kB

Total Files

7

Last publish

Collaborators

  • lordapollo