gitmyhub

vex

CSS ★ 6.9k updated 3y ago

A modern dialog library which is highly configurable and easy to style. #hubspot-open-source

Vex is a small JavaScript library created by HubSpot for showing dialog boxes in web applications. A dialog box is the popup window that appears when a site needs to ask the user a question, confirm an action, or prompt them to type something. Browsers have built-in versions of these (alert, confirm, and prompt), but they look plain and cannot be styled. Vex is a drop-in replacement that gives developers full control over how these dialogs look and behave.

The library weighs about 5.6 kilobytes after compression, has no external dependencies, and works on mobile devices as well as desktop browsers. Multiple dialogs can be open at the same time, and they can be closed individually or all at once. Transitions and animations are configurable and described in the README as smooth. The styling is handled through CSS, so matching a site's existing visual design is a matter of writing or overriding CSS rules rather than modifying JavaScript.

Vex supports UMD, which means it can be loaded through various module systems or included directly in a page with a script tag. A plugin system allows additional behavior to be added on top of the core functionality.

The repository's README is brief and links out to a demo page and full documentation for setup instructions and the complete API. The project is open-source and was released by HubSpot as part of their open-source program.