
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@slithy/modal-core
Advanced tools
The modal store. No React components, no animation, no UI.
modal-core owns the state machine and is the source of truth for which modals are open. All other modal packages depend on it. Consuming apps interact with it directly to open and close modals.
pnpm add @slithy/modal-core
All store methods are available via useModalStore.getState() for use outside React, or via the hook for reactive access.
import { useModalStore } from '@slithy/modal-core'
// Open a modal — pass any ReactNode
const id = useModalStore.getState().openModal(<MyModal />, {
triggerEvent: event, // enables keyboard-triggered focus return on close
})
// Close
useModalStore.getState().closeModal() // topmost modal
useModalStore.getState().closeModal(id) // specific modal
useModalStore.getState().closeAllModals() // all modals
openModal options| Option | Type | Description |
|---|---|---|
id | string | Stable ID; reuses the slot if already open |
triggerEvent | ModalTriggerEvent | Enables focus return to the triggering element |
triggerElement | Element | Explicit element to focus on close |
skipAnimation | boolean | Skip enter/leave animation |
closeModals | string[] | Close specific modals before opening this one |
import { useModalStore } from '@slithy/modal-core'
// Re-renders when modals change
const modals = useModalStore(s => s.modals)
const isAnyOpen = useModalStore(s => s.modals.length > 0)
// One-time read or in event handlers
const isOpen = useModalStore.getState().modalIsOpen()
const isOpen = useModalStore.getState().modalIsOpen(id)
type ModalState = 'opening' | 'open' | 'closing' | 'closed'
type ModalElement = {
id: string
modal: React.ReactNode
skipAnimation?: boolean
state: ModalState
triggerElement?: HTMLElement | null
}
| Export | Description |
|---|---|
useModalStore | Zustand-style store hook |
ModalStore | Store type |
ModalState | 'opening' | 'open' | 'closing' | 'closed' |
ModalElement | Shape of a registered modal |
ModalTriggerEvent | Union of synthetic and native event types |
FAQs
Core modal state management for @slithy/modal-kit.
We found that @slithy/modal-core 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.