React Modal
America's next top modal.
Quick Start
Installation
$ yarn add @trbl/react-modal
Composition
import React from 'react';
import { asModal, ModalContainer, ModalProvider, ModalToggler } from '@trbl/react-modal';
const MyModal = asModal(() => return <div>My Modal</div>, 'demo-modal');
const App = () => {
return (
<ModalProvider>
<ModalToggler slug="demo-modal">
...
</ModalToggler>
<MyModal />
<ModalContainer />
<ModalProvider>
)
}
export default App;
Demo
To demo locally, clone the repo and
$ yarn
$ yarn dev
$ open http://localhost:3000
Documentation
All available props can be found via the references below:
Contribution
Help us, or let us help you help us.
License
MIT Copyright (c) TRBL, LLC