Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@trbl/react-modal
Advanced tools
Readme
A highly configurable, a11y-enabled library for creating dialogs, drawers, popups, popovers, mega-menus, light-boxes, etc, etc, etc. Modals...with fancy names. This library is agnostic in both structure and style. You decide what it does, how it works, how it looks...and ultimately what its called.
Get creative with your setup. Create a modal from anywhere with Modal or asModal. Interact with a modal from anywhere with useModal or withModal — or quickly control them with ModalToggler. Integrate into existing apps, retrofit existing components, and have fun.
Shipped fully accessible. ModalProvider, asModal, and ModalToggler strictly follow the WAI-ARIA guidelines on modal dialogs. You can also customize anything.
Leave your content put. Stop lifting state and drilling props, or throwing into Redux. Render ModalContainer anywhere in your app as a descendent of the ModalProvider to have your modal portal into. Also helpful in dealing with CSS stacking contexts.
Control any modal with the URL. Share direct links, open on load, or navigate with the back button. Opt-in to use the history API. Using Next.js, Gatsby, or some other framework? Easily use those routers instead.
Applies no visual style, but encourages you to do so. Target any element and any state without additional legwork. BEM classes come shipped. Transition classes too, using react-transition-group. Build literally any modal experience, and start challenging your designers for a change.
Take complete control over the DOM. Things like custom markup, accessibility, or additional event handling. Everything beyond core functionality is extendable.
$ npm i @trbl/react-modal
$ # or
$ yarn add @trbl/react-modal
import React from 'react';
import {
Modal,
ModalContainer,
ModalProvider,
ModalToggler
} from '@trbl/react-modal';
const App = () => (
<ModalProvider>
<Modal slug="modal1">
...
</Modal>
<ModalToggler slug="modal1">
...
</ModalToggler>
<ModalContainer />
<ModalProvider>
);
export default App;
For working examples, see the demo app.
$ git clone git@github.com:trouble/react-modal.git
$ yarn
$ yarn dev
$ open http://localhost:3000
Help us, or let us help you help us.
MIT Copyright (c) TRBL, LLC
FAQs
America's next top modal.
The npm package @trbl/react-modal receives a total of 2 weekly downloads. As such, @trbl/react-modal popularity was classified as not popular.
We found that @trbl/react-modal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.