Install
Glimmer is plain CSS with no build step. It works on its own or alongside Tailwind CSS v4. Three small scripts are optional, for the few things CSS cannot do.
npm i glimmer-ui: that name on npm belongs to an unrelated package.1. Install the package
npm i github:huntercash/glimmer-uiOr let an AI agent do it
Paste this into your coding agent. It covers every step on this page and carries the frost level and colours you have picked in the navbar.
Set up the Glimmer UI kit in this project and use it for all UI. Docs and every component: https://glimmer-ui.com
1. Install it (it is not on npm yet, so install from GitHub):
npm i github:huntercash/glimmer-ui
2. Import it in the main stylesheet. With Tailwind CSS v4, put it straight after Tailwind:
@import "tailwindcss";
@import "glimmer-ui";
Without Tailwind, use: @import "glimmer-ui/css/index.css";
Optional extras: @import "glimmer-ui/css/fonts.css"; for the bundled SUIT and Fragment Mono fonts, and (Tailwind only)
@import "glimmer-ui/css/tailwind.css"; so variants such as md:btn-lg and hover:btn-primary work.
If the project already uses class names like .btn or .card, import "glimmer-ui/css/prefixed.css" instead and write every class with a gl- prefix.
3. Apply this theme. Add class="frost-1" (clear glass) to the <html> element, and add this to the main stylesheet:
:root {
--gl-primary: #f5a05a;
--gl-secondary: #3b9ef5;
}
4. Load the two small scripts once on the client:
import "glimmer-ui/glow.js"; // light follows the pointer on .glow surfaces
import "glimmer-ui/behaviors.js"; // tab panels, toast(), carousel buttons, list filtering, tooltip accessibility
5. Build with Glimmer's classes instead of writing custom CSS:
- One class makes a component, on the natural HTML element: btn, card, input, select, toggle, badge, alert, tabs, navbar, menu, modal and drawer (on <dialog>), popover (on an element with the popover attribute).
- A suffix sets the colour: -primary, -secondary, -success, -warning, -danger. For example btn-primary, badge-success.
- State comes from HTML attributes, not classes: disabled, open, aria-busy, aria-invalid, aria-selected, aria-current, data-done.
- Any element becomes a glass panel with the class "glass". Add "glow" and its light follows the pointer.
- For charts, import from "glimmer-ui/charts.js" (lineChart, barChart, candlestickChart, chordDiagram and more), or use <gl-chart type="..." data='...'> (add the zoom attribute to let people zoom and pan).
- In React, the classes go on plain elements (<button className="btn btn-primary">). Only the parts with behaviour have components: import { Chart, Tabs, Modal, Drawer, toast } from "glimmer-ui/react".
6. Each component's markup is documented in the comment above its rule in node_modules/glimmer-ui/css/*.css, each chart in node_modules/glimmer-ui/charts.js, and each behaviour in node_modules/glimmer-ui/behaviors.js. Read those before writing a component, and do not invent class names.2. Add it to your CSS
With Tailwind, import Glimmer after it. Any utility on the same element then overrides the component, and the kit's colours and fonts become Tailwind's own: bg-primary, text-muted, font-mono.
@import "tailwindcss";
@import "glimmer-ui";
@import "glimmer-ui/css/tailwind.css"; /* optional: variants such as md:btn-lg */3. Use a component
<button class="btn btn-primary">Hello, glass</button>That is the whole setup. Browse the components for everything else.
Optional: the scripts
Each is loaded once, anywhere in your app, and does nothing on a server.
| File | What it adds |
|---|---|
glow.js | Surfaces with the glow class move their inner light to the pointer. |
behaviors.js | Tabs that switch panels, toast(), carousel buttons, filtering a list as you type, and tooltips that screen readers can read. |
charts.js | The chart functions and the <gl-chart> tag. |
import "glimmer-ui/glow.js";
import "glimmer-ui/behaviors.js";
import "glimmer-ui/charts.js";Optional: React
Most of Glimmer needs no components: put the classes on plain elements. The parts with behaviour have small ones, with TypeScript types. Importing them loads the behaviours and charts for you.
import { Chart, Tabs, Modal, Drawer, toast } from "glimmer-ui/react";
<button className="btn btn-primary" onClick={() => toast("Saved.", { type: "success" })}>Save</button>
<Chart type="line" data={{ labels, series }} options={{ smooth: true }} />Optional: fonts
Out of the box, text uses your system font. The kit also ships SUIT for text and Fragment Mono for labels (about 700 KB together), which this site uses. Add them with one more import:
@import "glimmer-ui/css/fonts.css";Bundlers that resolve package asset URLs need nothing else. The Tailwind CLI inlines the stylesheet but does not copy the font files, so link fonts.css from HTML instead, or copy the css and fonts folders next to each other in your public directory.
If Glimmer's names clash with yours
The default import styles the page itself (background, text colour, font, focus ring) and uses short class names such as btn and card. Both are optional.
/* Leaves your page background, fonts and focus styles alone. */
@import "glimmer-ui/css/components.css";With the prefixed build, tell the script that builds toasts: config.prefix = "gl-", imported from behaviors.js. Chart classes and attributes such as data-tip keep their names.
Apple platforms
The same components exist as a SwiftUI package. See SwiftUI.