
Security News
OpenClaw Advisory Surge Highlights Gaps Between GHSA and CVE Tracking
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.
Make life easier handling dialogs, sheets and drawers for shadcn.
pnpm add pushmodal
// file: src/modals/index.tsx (alias '@/modals')
import Modal1 from './modal-1'
import Modal2 from './model-2'
import { createPushModal, SheetWrapper } from 'pushmodal'
export const {
pushModal,
popModal,
ModalProvider
} = createPushModal({
modals: {
Modal1: {
Component: Modal1
},
Modal2: {
Component: Modal2
// This will appear as a sheet instead of dialog
Wrapper: SheetWrapper,
// Options for this modal
// onEscapeKeyDown(event) {
// event.preventDefault();
// },
// onInteractOutside(event) {
// event.preventDefault();
// },
// onPointerDownOutside(event) {
// event.preventDefault();
// },
},
},
// Change default wrapper
// defaultWrapper: SheetWrapper
})
How we usually structure things
src
├── ...
├── modals
│ ├── modal-1.tsx
│ ├── modal-2.tsx
│ ├── modal-3.tsx
│ ├── modal-4.tsx
│ ├── modal-5.tsx
│ ├── modal-6.tsx
│ └── index.tsx
├── ...
└── ...
<ModalProvider /> to your root file.import { ModalProvider } from '@/modals'
export default function App({ children }: { children: React.ReactNode }) {
return (
<>
{/* Notice! You should not wrap your children */}
<ModalProvider />
{children}
</>
)
}
pushModalpushModal can have 3 arguments
name - name of your modalprops - props for your specific modal, types are infered from your component!options - options for the modalimport { SheetWrapper } from 'pushmodal'
import { pushModal } from '@/modals'
export default function RandomComponent() {
return (
<div>
<button onClick={() => {
pushModal('Modal1')
}}>
Open modal
</button>
<button onClick={() => {
pushModal('Modal1', {}, { Wrapper: SheetWrapper })
}}>
Open modal in sheet instead!
</button>
<button onClick={() => {
pushModal('Modal1', {}, {
onInteractOutside: (event) => event.preventDefault()
})
}}>
Open modal with custom config
</button>
</div>
)
}
You can close modals on three different ways
popModal() - will pop the last added modalpopModal('Modal1') - will pop the last added modal with name Modal1popAllModals() - will close all your modalsexport interface PushModalOptions {
Wrapper?: React.ComponentType<{
open: boolean
onOpenChange: (open: boolean) => void
}>
onInteractOutside?: (event: Event) => void;
onPointerDownOutside?: (event: Event) => void;
onEscapeKeyDown?: (event: KeyboardEvent) => void;
}
It's common to want to update options on the fly. Then you can use usePushModal hook.
export default Modal() {
const [options, setOptions] = usePushModal()
const someCondition = false
useEffect(() => {
if(someCondition) {
setOptions(prev => ({
onInteractOutside: (event) => event.preventDefault()
}))
}
}, [])
return (
<>
...
</>
)
}
You can also pass options directly to the hook if you want your options to take effect immediately
export default Modal() {
usePushModal({
onInteractOutside: (event) => event.preventDefault()
})
return (
<>...</>
)
}
You might need to add the following to you tailwind.config. Of provide your own wrapper as option for createPushModal.
// tailwind.config.js
...
content: [
'./node_modules/pushmodal/**/*.js', // <---
],
...
FAQs
Handle shadcn dialog, sheet and drawer with ease
The npm package pushmodal receives a total of 3,683 weekly downloads. As such, pushmodal popularity was classified as popular.
We found that pushmodal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.