Socket
Socket
Sign inDemoInstall

@tryferos/popups

Package Overview
Dependencies
8
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @tryferos/popups

Provides you with popup components to use in your React app.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Popup & Toast Handler and Layout Component

Install the package for npm here.

Source code on Github.

This is a react component delivering customizable Popups Layout that you can use in your projects, which also adds types support using Typescript.

You can create your own Popups and add them to the popup list.

VERSION 1.1 You can create your own Toasts and add them to the toasts list.

The project is build using React, Typescript and Tailwindcss. Tailwindcss is compiled into css, meaning you do not need it as a depedency.

All files are bundled into 3 seperate files for both cjs, esm and dts using the Rollup bundler. (commonjs, esmodules and declaration for ts types).

:dart: Features

  • :white_check_mark: Typescript support
  • :white_check_mark: FULLY Customizable to your needs
  • :white_check_mark: Create as many Popups.
  • :white_check_mark: Create as many Toasts.
  • :white_check_mark: Light/dark Mode.
  • :white_check_mark: Animations.

Install @tryferos/Popups using

  npm install @tryferos/Popups@1.0.3

Remember that you need to have react and react-dom already installed

  npm install react@^18.0.1 react-dom@^18.0.1

This package is build using react 18, you can use with different versions of react at your own risk.

  npm install @tryferos/Popups@1.0.3 --force

Import the components

{/*! Version 1.0*/}
import { PopupItem, PopupWrapper, PopupElement, usePopup } from "@tryferos/Popups";
{/*! Version 1.1*/}
import {ToastItem, PopupToastElement, useToast} from "@tryferos/Popups"

Usage

Wrap your Application in PopupWrapper.

{/*! Version 1.0*/}
const { popup, changePopup, title, closePopup} = usePopup();
{/*! Version 1.1*/}
const { toast, changeToast, title, closeToast} = useToast();
<PopupWrapper>
    {/*! Version 1.1*/}
    <PopupToastElement position={'top-center'} toasts={Object.values(myToastsEnum)}>
        <ToastItem toast={myToastsEnum.Error} element={<MyErrorToastComponent/>} />
        <ToastItem toast={myToastsEnum.Success} element={<MySuccessToastComponent/>} />
        ...
    </PopupToastElement>
    {/*! Version 1.0*/}
    <PopupElement popups={Object.values(MyPopupsEnum)}>
        <PopupItem popup={MyPopupsEnum.Login} element={<MyLoginPopupComponent/>}/>
        <PopupItem popup={MyPopupsEnum.Payment} element={<MyPaymentPopupComponent/>} />
        ...
    <PopupElement/>
    <App/> //Your Application's normal Components here
</PopupWrapper>

👨‍💻 Authors

Keywords

FAQs

Last updated on 25 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc