Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hixme/modal

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hixme/modal

Hixme Modal

  • 1.1.4
  • npm
  • Socket score

Version published
Weekly downloads
86
increased by115%
Maintainers
3
Weekly downloads
 
Created
Source

Mr. Modal

Implementation of a global modal component with the react-modal package for use within the Hixme ecosystem.

Usage

The implementation is a bit different compared to the current modal:

import { MrModal } from '@hixme/modal'

<MrModal>
  { Your modal content }
</MrModal>

After creating your modals, you will need to pass them to your <MrModalManager /> component, located at your project's root.

// In project root
import TestModal from '/modal/path/here'

<MrModalManager 
  appElementId='app-element-node'
  modals={{
    TEST: TestModal,
  }}
/>

Important: In the modals object, the key is your modal string constant and the value is your modal component itself.

Additionally, you can supply the MrModalManager with your own appElement ID. This is the ID which needs to be assigned to the element wrapping the rest of your application.


To open the modal, you'll need to dispatch the setView action, passing in the string constant you've defined for your modal.

dispatch(setView(YOUR_MODAL))

Styling

Currently, the default style is a full screen modal. This can be overwritten by providing the <MrModal /> component with a style object.

style: {
  content: {
    ...contentStyles
  },
  overlay: {
    ...overlayStyles
  },
}

Keywords

FAQs

Package last updated on 05 Jan 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc