New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cute-emojies-modal

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cute-emojies-modal

A fun and customizable modal package for React, letting you easily add emoji-based confirmation dialogs to your app!

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

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

Cute Emojies Modal

A fun and customizable modal package for React, letting you easily add emoji-based confirmation dialogs to your app!

Check out the live demo of the modal in action.

Installation

You can install the package via yarn or npm:

yarn add cute-emojies-modal

or

npm install cute-emojies-modal

Usage

Step 1: Add the CSS

To use the styles provided by the package, import the CSS file in your index.ts (or index.js):

import 'cute-emojies-modal/dist/index.css';

Step 2: Add the Modals Container

To enable modals, ensure you add the CuteEmojiesConfirmContainer component to the app root. This is usually done in your main index.tsx file:

import { CuteEmojiesConfirmContainer } from 'cute-emojies-modal';

...

root.render(
  <React.StrictMode>
    <App />
    <CuteEmojiesConfirmContainer /> // add this line
  </React.StrictMode>
);

Step 3: Use the Modal in Your Components

Now you can easily trigger modals in your components using the useCuteModal hook:

import { useCuteModal } from 'cute-emojies-modal';

function App() {
  const modal = useCuteModal();

  const onShowClick = async () => {
    await modal({
      title: 'Lovely',
      body: 'Woho! Now you have 3 new badges!',
      variant: 'yellow',
      emoji: 2,
    });
  };

  return (
    <div>
      <button onClick={onShowClick}>Show Modal</button>
    </div>
  );
}

export default App;

Available Variants

The variant property controls the color scheme of the modal. You can choose from the following options:

  • mint-green
  • orange
  • light-purple
  • purple
  • light-blue
  • yellow

Available Emojis

The emoji property allows you to choose which emoji to display in the modal. You can select a number between 1 and 10.

Keywords

FAQs

Package last updated on 25 Oct 2024

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