Complete Feature Catalogue

Every Feature. Zero Dependencies.

Comprehensive listing of every feature shipping in the toastory npm package. Every item includes runnable browser demos, TypeScript syntax snippets, and direct links to full documentation.

Toasts & Promises

Semantic Toast Types & Rich Colors

Docs →

Pre-configured semantic types: success, error, warning, info, loading, and neutral cards with custom icons and rich tones.

typescript
toast.success('Project deployed!', {
  description: 'Live on production edge in 340ms.',
  richColors: true
});
Live npm package test:
Toasts & Promises

Async Promise Tracking with unwrap()

Docs →

Streamline async operations with automated loading indicators, success/error transitions, and unwrap() error rejection.

typescript
toast.promise(fetchDatabaseStats(), {
  loading: 'Gathering cluster telemetry...',
  success: 'Cluster healthy across 12 zones',
  error: 'Failed to reach database replica'
});
Live npm package test:
Toasts & Promises

Dynamic Toast Updates & Dismissal

Docs →

Programmatically mutate active toast content, progress, or duration on the fly with toast.update(id, patch).

typescript
const id = toast.loading('Uploading 14.8 MB assets...');
setTimeout(() => {
  toast.update(id, {
    type: 'success',
    title: 'Upload complete!',
    description: 'Saved to encrypted S3 bucket.'
  });
}, 2000);
Live npm package test:
Toasts & Promises

Interactive Action & Cancel Buttons

Docs →

Attach primary action and cancellation buttons with keyboard focus rings, callbacks, and automatic dismiss.

typescript
toast('File moved to trash', {
  description: 'analytics_2026.parquet',
  action: { label: 'Undo', onClick: () => restoreFile() },
  cancel: { label: 'Dismiss' }
});
Live npm package test:
Toasts & Promises

4-Direction Velocity Gesture Physics

Docs →

Fluid touch & mouse swipe physics with customizable drag threshold and velocity snap dismissal in any direction.

typescript
toast.info('Swipe me away!', {
  swipeDirections: ['left', 'right', 'up', 'down'],
  dragThreshold: 40
});
Live npm package test:
Toasts & Promises

Determinate Progress Bars & Circular Rings

Docs →

Visual feedback for long-running operations with linear percentage bars or circular radial progress rings.

typescript
toast.loading('Compiling kernel...', {
  progress: true,
  duration: 5000
});
Live npm package test:
Toasts & Promises

Pausable Timers & Window Focus Sync

Docs →

Timers automatically freeze when hovering, focusing elements, or switching browser tabs to avoid missed notifications.

typescript
toast('Hover to pause countdown', {
  pauseOn: ['hover', 'focus', 'hidden'],
  duration: 6000
});
Live npm package test:
Toasts & Promises

Extensible Custom Types Registry

Docs →

Register domain-specific toast variants with distinct brand colors, custom icons, and preset defaults.

typescript
ui.toast.types.add('backup', {
  color: '#8b5cf6',
  ariaLive: 'polite',
  duration: 5000
});
Live npm package test:
Dialogs & Modals

Accessible Modal Confirmations (ui.confirm)

Docs →

Promise-based modal dialog with focus trapping, tone presets (info, warning, danger), Esc key listener, and backdrop click control.

typescript
const { isConfirmed } = await ui.confirm({
  title: 'Delete billing method?',
  text: 'Your current subscriptions will default to wire transfer.',
  tone: 'danger',
  confirmButton: { label: 'Remove Card' }
});
Live npm package test:
Dialogs & Modals

Accessible Alert Modals (ui.alert)

Docs →

High-contrast accessible modal dialog for critical announcements, system notices, and policy agreements.

typescript
await ui.alert({
  title: 'Scheduled Maintenance',
  text: 'API gateway will restart on Sunday at 02:00 UTC.',
  tone: 'info',
  confirmButton: { label: 'Acknowledge' }
});
Live npm package test:
Dialogs & Modals

Async preConfirm & Button Loading States

Docs →

Keep the modal open and display an animated spinner inside the confirm button until an async API call resolves or rejects.

typescript
await ui.confirm({
  title: 'Deploy to Production?',
  preConfirm: async () => {
    await triggerPipelineDeploy();
  }
});
Live npm package test:
Dialogs & Modals

Draggable Dialogs & 15 Screen Positions

Docs →

Users can freely drag modal dialogs around the screen, or position them across 15 coordinates (top, center, bottom, corners).

typescript
await ui.alert({
  title: 'Draggable Inspector',
  text: 'Grab the modal header to reposition it anywhere.',
  draggable: true
});
Live npm package test:
Dialogs & Modals

Countdown Timers with Auto-Dismiss Bar

Docs →

Attach auto-dismiss countdown timers with live animated progress bars and programmatic handle controllers.

typescript
await ui.confirm({
  title: 'Session Expiring',
  text: 'Automatically logging out in 5 seconds...',
  timer: 5000,
  timerProgressBar: true
});
Live npm package test:
Forms & Inputs

16 Built-in Form Input Types

Docs →

Native input renderers: text, email, password, number, tel, url, search, textarea, select, radio, checkbox, range, date, time, file.

typescript
const { value } = await ui.prompt({
  title: 'Select Deployment Region',
  input: 'select',
  options: { 'us-east': 'US East (N. Virginia)', 'eu-west': 'EU West (Ireland)' }
});
Live npm package test:
Forms & Inputs

Sync & Async Input Validation

Docs →

Enforce input rules with inline validation messages, regex patterns, or async server availability checks.

typescript
await ui.prompt({
  title: 'Claim Username',
  input: 'text',
  validate: async (val) => {
    if (!val || val.length < 3) return 'At least 3 characters required';
    if (await isTaken(val)) return 'Username already registered';
  }
});
Live npm package test:
Forms & Inputs

Type-to-Confirm Security Guard

Docs →

Eliminate accidental destructive actions by requiring the user to type a specific verification keyword.

typescript
await ui.prompt({
  title: 'Confirm Repository Wipe',
  text: 'Type "RESET" to confirm permanent deletion:',
  confirmText: 'RESET',
  caseSensitive: true,
  tone: 'danger'
});
Live npm package test:
Forms & Inputs

6-Cell Discrete Numeric OTP Code

Docs →

Individual auto-advancing verification cells with clipboard paste parsing, numeric keypad mode, and resend cooldown timer.

typescript
await ui.prompt({
  title: 'Enter Verification Code',
  input: 'otp',
  otpLength: 6,
  resendCooldown: 30
});
Live npm package test:
Wizards & Sheets

Multi-Step Guided Wizards (ui.steps)

Docs →

Assemble multi-page onboarding wizards with Back and Next navigation, per-step validation, and accumulated return values.

typescript
const { values } = await ui.steps([
  { title: 'Step 1: Workspace', input: 'text' },
  { title: 'Step 2: Plan', input: 'select', options: ['Pro', 'Enterprise'] }
]);
Live npm package test:
Wizards & Sheets

Mobile Draggable Bottom Sheet (ui.bottomSheet)

Docs →

Slide-up modal sheet with touch drag handle, velocity snap points (e.g. 40vh, 85vh), and fluid swipe dismissal.

typescript
ui.bottomSheet({
  title: 'Deployment Options',
  snapPoints: [0.4, 0.85],
  confirmButton: { label: 'Apply Settings' }
});
Live npm package test:
Wizards & Sheets

iOS Action Sheet Menu (ui.sheet)

Docs →

Stacked iOS-inspired action list with destructive option highlighting, neutral secondary items, and cancellation button.

typescript
ui.sheet({
  title: 'Document Actions',
  actions: [
    { label: 'Copy Public URL', value: 'copy' },
    { label: 'Export as PDF', value: 'pdf' },
    { label: 'Delete File', value: 'delete', style: 'destructive' }
  ]
});
Live npm package test:
Wizards & Sheets

Full-Screen Loading Overlay with Progress

Docs →

Modal loading backdrop with smooth spinner, dynamic percentage progress, and programmatic handle controller.

typescript
const handle = ui.loading({ text: 'Deploying worker...' });
handle.update({ progress: 0.6, text: 'Warming cache...' });
setTimeout(() => handle.close(), 2000);
Live npm package test:
Theming & Engine

21 Handcrafted Glass & Solid Themes

Docs →

Specular frosted glass (ios-glass, liquid-glass, aurora), retro brutalism, and clean flat styles with light & dark modes.

typescript
import 'toastory/themes/ios-glass.css';
ui.configure({ theme: 'ios-glass', mode: 'auto' });
Live npm package test:
Theming & Engine

Centralized Global Configuration (ui.configure)

Docs →

Define default themes, 6 screen placements, 3D deck stacking, pause triggers, and hotkeys in one call.

typescript
ui.configure({
  theme: 'ios-glass',
  position: 'top-right',
  stack: 'stacked',
  duration: 4000,
  maxVisible: 5,
  gap: 12
});
Live npm package test:
Theming & Engine

Zero Dependencies & WCAG 2.2 AA Compliance

Docs →

Strict 0 runtime dependencies in published bundle. < 6 KB gzip core + toast. 100% passed contrast checks & focus traps.

typescript
// Zero runtime dependencies. Runs in plain Node, SSR, and browsers.
import { ui } from 'toastory';
Live npm package test: