Socket
Socket
Sign inDemoInstall

@saas-ui/modals

Package Overview
Dependencies
250
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @saas-ui/modals

A modal manager for Chakra UI


Version published
Weekly downloads
2.5K
decreased by-28.18%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@saas-ui/modal

Chakra UI modals manager.

Build in modal types:

  • Modal
  • Drawer
  • Form
  • Dialog
  • ConfirmDialog
  • MenuDialog

Installation

$ yarn add @saas-ui/modals

#or

$ npm i @saas-ui/modals  --save

Usage

Add the ModalProvider to your app.

import { ModalsProvider } from '@saas-ui/modals'

export default App() {
  return (
    <ModalsProvider>
      {children}
    </ModalsProvider>
  )
}

Open a modal

import { useModals } from '@saas-ui/modals'

function MyComponent() {
  const modals = useModals()

  modals.open({
    title: 'My modal',
    body: <>My modal body</>,
  })
}

Open a drawer

import { useModals } from '@saas-ui/modals'

function MyComponent() {
  const modals = useModals()

  modals.drawer({
    title: 'My drawer',
    body: <>My drawer body</>,
  })
}

Open a confirm dialog

import { useModals } from '@saas-ui/modals'

function MyComponent() {
  const modals = useModals()

  modals.confirm({
    title: 'Delete user',
    body: 'Are you sure you want to delete this user?'
    onConfirm: () => //delete user
  })
}

Docs

https://www.saas-ui.dev/docs/overlay/modals-manager

Source

https://github.com/saas-js/saas-ui/tree/next/packages/saas-ui-modals

License

MIT - Appulse Software

Keywords

FAQs

Last updated on 24 May 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