The bare minimum for elegant interfaces.
Three classes, no framework,3.2 kB.
A CSS and JavaScript library with no reset, no font, no runtime dependencies and no rule outside a pui- class; the browser does the work.
<button class="pui-btn pui-solid pui-theme">Button</button>Three classes, no framework,3.2 kB.
3.2 kB. Measured, not promised.
perfectui.css is 3,221 bytes gzip; the optional JavaScript loader is 493. The bars below are the same measurement run on the published builds of the alternatives.
gzip -9 -n of the published builds; perfectui measured at build from version 1.0.0-beta.1, others on 2026-09-23
A shape, a style, a colour.
Every element is up to three classes you can combine freely: what it is, how the colour is applied, which colour. Seven colours and four styles give 28 looks per shape, and adding a colour never multiplies your classes.
<button class="pui-btn pui-solid pui-theme">Overlays without a plugin.
Modals are <dialog>, menus are popover, tooltips are interestfor, accordions are <details>. The optional loader downloads a fallback only when a browser is missing one of them.
One attribute for dark mode. One variable for your colour.
With no attribute, perfectui follows the operating system. Set data-pui-mode to choose, and --pui-theme to make every component yours.
<html data-pui-mode="light"> --pui-theme: #7c3aed;Dark mode docs
Your utilities always win.
One @layer line keeps Tailwind's reset below perfectui and every utility above it.
class="pui-btn pui-solid pui-theme w-full"@layer theme, base, pui, components, utilities; @custom-variant dark (&:where([data-pui-mode="dark"], [data-pui-mode="dark"] *));
Nothing you have to undo.
No reset to override,no font to remove,no !important to beat,no initialiser to call after rendering,no guard for server rendering.ESM only, nothing on window.
Coming from 0.x?
1.0 is a rewrite: every class is prefixed, styles and colours are separate classes, and the browser replaced the JavaScript. The guide lists every change.
- btn style-solid-primary+ pui-btn pui-solid pui-themeInstall it your way.
A package for npm, yarn, pnpm or bun, or two tags from a CDN. Import everything or only the components you use.
Get startedimport "@chrissgon/perfectui/perfectui.css";
// or only what you use:
import "@chrissgon/perfectui/core.css";
import "@chrissgon/perfectui/components/button.css";<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@chrissgon/perfectui@1.0.0-beta.1/dist/perfectui.css"> <script type="module"> import "https://cdn.jsdelivr.net/npm/@chrissgon/perfectui@1.0.0-beta.1/dist/js/index.js"; </script>