1.1.0 • Published 2 years ago
@elbaz888/ebz-react-library v1.1.0
ebz-react-library
Open-source React components and custom hooks build with TypeScript.
If you’re new to TypeScript and React, checkout this handy cheatsheet
Install
npm i @elbaz888/ebz-react-library
Components
Here are the available UI components :
Modal (with 'dialog' element)
To create a new modal instance, import the component and his associated custom hook.
import { useModal } from '@elbaz888/ebz-react-library'
import { Modal } from '@elbaz888/ebz-react-library'
and use it in a functionnal component :
// import hooks you need before the render
const { showModal, hideModal, toggleModal } = useModal()
<button onClick={toggleModal}> Toggle me </button>
<Modal isOpened={isOpened} onClose={onClose} modalContent="Your content here." />
Full documentation and demo in Storybook doc