New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-smart-popup

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-smart-popup

simple popup created with react and typescrypt and styled components

latest
Source
npmnpm
Version
2.9.1
Version published
Weekly downloads
5
-58.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-smart-popup

this is a smart popup created by react and typeScrypt

Installation

The package can be installed via npm:

npm install react-smart-popup --save

Or via yarn:

yarn add react-smart-popup

Example

import React, { useState, useCallback } from 'react';
import { popup } from 'react-smart-popup';

const App = () => {
  const [isOpenDialog, setIsOpenDialog] = useState < boolean > false;

  const openPopupFunc = useCallback(() => {
    setIsOpenDialog(true);
  }, [setIsOpenDialog]);
  const handleSubmitFunc = useCallback(() => {
    console.log('submit');
  }, []);
  const handleCloseFunc = useCallback(() => {
    console.log('close');
  }, []);

  return (
    <div>
      <button onClick={openPopupFunc}>Open popup </button>
      <Popup
        isOpen={isOpenDialog}
        setIsOpen={setIsOpenDialog}
        handleSubmit={handleSubmitFunc}
        handleClose={handleCloseFunc}
      >
        hello world
      </Popup>
    </div>
  );
};

Props

PropertytypeDefault ValueDescription
isOpenBooleanfalsestate of popup
setIsOpenFuncchange state of popup
childrenReactNodesome children to show in popup body
handleSubmitFuncon press submit button handler
handleCloseFuncon press close button handler
closeOnPressEscapeBooleantrueclose active popup when press esc key
closeOnClickAwayBooleantrueclose popup when click outside
widthString'50%'popup width
heightString'50%'popup height
headerStringpopup header

Keywords

popup

FAQs

Package last updated on 11 Jul 2022

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