okayy
v1.0.0
Published
A confirm dialog for React. One line. Beautiful.
Downloads
252
Maintainers
Readme
Usage
npm install okayy// app/layout.tsx
import { Confirmer } from 'okayy';
import 'okayy/styles.css';
export default function Layout({ children }) {
return (
<>
{children}
<Confirmer />
</>
);
}import { confirm } from 'okayy';
async function handleDelete() {
if (await confirm('Delete this item?')) {
// confirmed
}
}Features
- One function call —
await confirm('title')returnstrue/false - Variants —
confirm.danger(),.warning(),.info(),.success() - Alert mode —
confirm.alert()for acknowledgment dialogs - Async confirm — loading spinner on the button during
onConfirm - Type-to-confirm —
confirmationKeywordfor dangerous actions - Custom rendering —
confirm.custom((close) => <YourComponent />) - Accessible — focus trap, ARIA roles (
dialog/alertdialog),aria-modal,inert - Mobile — bottom sheet with safe-area padding
- Themeable — light/dark/system, CSS variables, unstyled mode
- Tiny — ~3.6 kB gzipped
Documentation
Visit pavlito.github.io/okayy for full documentation, examples, and API reference.
Development
npm install # Install dependencies
npm run dev:all # Watch library + demo site
npm run test # Unit tests (vitest)
npm run test:e2e # E2E tests (Playwright — chromium, firefox, webkit, mobile)
npm run test:e2e:ui # E2E tests with interactive UI
npm run build # Build library
npm run type-check # TypeScript check
npm run lint # ESLint
npm run size # Check bundle size (4.0 kB budget)