Socket
Socket
Sign inDemoInstall

@bearei/react-modal

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bearei/react-modal

Base modal components that support React and React native


Version published
Maintainers
1
Created
Source

react-modal

Base modal components that support React and React native

Installation

yarn add @bearei/react-modal --save

Parameters

NameTypeRequiredDescription
visiblebooleanModal visible state
defaultVisiblebooleanThe default visible state for the modal
loadingbooleanWhether the modal is loading
titleReactNodeModal title
headerReactNodeModal header
footerReactNodeModal footer
contentReactNodeModal content
sizesmall medium largeModal size
paddingbooleanSet the content area to fill
closeIconReactNodeModal close button icon
disabledModalClosebooleanDisable modal layer close
onVisible(options: ModalOptions) => voidThis function is called when the modal visible state changes
onClose(options: ModalOptions) => voidThis function is called when the modal is closed
onClick(options: React.MouseEvent) => voidThis function is called when modal is clicked
onTouchEnd(options: React.TouchEvent) => voidThis function is called when the modal is pressed
onPress(options: GestureResponderEvent) => voidThis function is called when the modal is pressed -- react native
renderHeader(props: ModalHeaderProps) => ReactNodeRender the modal header
renderFooter(props: ModalFooterProps) => ReactNodeRender the modal footer
renderMain(props: ModalMainProps) => ReactNodeRender the modal main
renderContainer(props: ModalContainerProps) => ReactNodeRender the modal container

Use

import React from 'React';
import ReactDOM from 'react-dom';
import Modal from '@bearei/react-modal';

const modal = (
  <Modal
    renderMain={({ ...props }) => <div {...props}>"modal"</div>}
    renderContainer={({ id, children }) => <div data-id={id}>{children}</div>}
  />
);

ReactDOM.render(modal, container);

Keywords

FAQs

Package last updated on 22 Feb 2023

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