7.1.0 • Published 2 months ago

react-use-disclosure v7.1.0

Weekly downloads
147
License
MIT
Repository
github
Last release
2 months ago

useDisclosure

Node CI

useDiclosure is a React custom hook to perform common open/close behavior on modals, tooltips etc.

🔧 Installation

# Using yarn.
yarn add react-use-disclosure

# Using npm.
npm install react-use-disclosure

🔎 Usage

As useDisclosure return an object, you can get the key that you want:

// At the top of your file.
import { useDisclosure } from "react-use-disclosure";

// Then, in your component.
const {
  isOpen: isModalOpen,
  open: openModal,
  close: closeModal
} = useDisclosure();

const { isOpen: isTooltipOpen, toggle: toggleTooltip } = useDiclosure(true);

// For the example, but the default value is false.
const { isOpen, open, close, toggle } = useDisclosure(false);
7.1.0

2 months ago

7.0.0

4 months ago

6.2.1

10 months ago

6.2.0

10 months ago

6.1.0

1 year ago

6.0.0

2 years ago

5.2.0

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

4.0.0

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

1.5.0

3 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago