@hirotoshioi/hiraku-core
v0.0.6
Published
Core modal state management library for React
Maintainers
Readme
Features
- ⚡ Open from anywhere - Call
modal.open()from any file, even outside React components - 🔒 Type-safe - Strongly typed props + close results
- 🧩 Framework-agnostic - No Radix/Base UI dependency
- 🪶 Lightweight - Depends only on zustand
- 🧱 Integration-first - This package is typically used via an integration package
Recommended usage
Most apps should install an integration package:
- Radix UI:
@hirotoshioi/hiraku-radix-ui(seepackages/radix-ui/) - Base UI:
@hirotoshioi/hiraku-base-ui(seepackages/base-ui/)
@hirotoshioi/hiraku-core is the shared implementation used by those packages (and for building custom integrations).
Installation
npm install @hirotoshioi/hiraku-coreExports
- Factories:
createDialog,createSheet,createAlertDialog - Hooks:
useModal,useModalStore - Global:
modalController - Types:
ModalRole,ModalResult,ModalWrapperType, etc.
If you’re implementing a custom provider, the reference providers live in:
packages/radix-ui/src/provider.tsxpackages/base-ui/src/provider.tsx
