Skip to main content

Getting Started

Get Waria running in under 2 minutes.

Install

npm install @dufeut/waria

Initialize

import { App } from "@dufeut/waria";

App.start();

Done. All 29 components are now registered and ready to use.

Your First Component

<w-dialog>
<w-slot trigger><button>Open</button></w-slot>
<w-slot body>
<div>
<h2>Hello Waria!</h2>
<p>Focus trapping, escape-to-close, and ARIA — all automatic.</p>
<w-slot close><button>Close</button></w-slot>
</div>
</w-slot>
</w-dialog>

That's it. The dialog handles:

  • Focus trapping inside the modal
  • Escape key to close
  • Click outside to close
  • ARIA attributes (role="dialog", aria-modal)
  • Return focus to trigger on close

CDN Usage

No build tools? Use the IIFE bundle:

<script src="https://unpkg.com/@dufeut/waria/dist/waria.iife.js"></script>
<script>
waria.App.start();
</script>

Browser Support

BrowserVersion
Chrome67+
Firefox63+
Safari10.1+
Edge79+

Next Steps

  • Slots — How composition works
  • Events — Handling component events
  • Cheat Sheet — All components at a glance