Code
In context
Install · Free Web Component
One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.
The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:
Pro · React + TypeScript Pro
One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.
- React components —
GlassBentoandGlassBentoCell— with TypeScript types and the full source; a cell takes any React content and can be a link - Sunset, Mint and Mono tints, plus custom tints from Brand Fit
- The vanilla Web Component with every tint, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| <glass-cell> | children | — | One child per cell (four to six reads best). Its content — a heading and a line of text, or anything else — sits at the bottom of the glass. |
| span (on a cell) | "<columns>x<rows>" | "1x1" | How many columns and rows the cell covers, e.g. "2x1" or "1x2". Spans are clamped when fewer columns fit. |
| data-visual (on a cell) | 'bars' | 'ring' | 'stream' | — | A small live visual above the content: a moving bar chart, a progress ring that fills (data-value, 0–100) or lines of text typing themselves (data-lines="first|second|third"). |
| columns | number | 3 | Columns at full width, 2 to 6. Containers under 620px get two at most; under 480px the grid is one column. |
| gap | number (px) | 12 | Space between cells. |
| width | number (px) | CSS width | 1100 | Maximum width of the grid; it always fills its container up to this. |
| theme | 'light' | 'dark' | 'light' | Light or dark glass. |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | Colours of the scene behind the glass, the pointer light and the visuals, or a custom tint. Free build ships Aurora only. |
The grid measures its own container (not the window), so it behaves the same in a sidebar and full width; a wide, low cell puts its visual beside the text. The light is one point shared by every cell, eased toward the pointer; el.point(x, y) places it yourself (fractions of the grid, null turns it off) — handy for a guided tour. Cells reveal once, in a wave from the top-left corner, when an eighth of the grid is on screen; reduced motion shows them at once and stops the visuals. The scene, the bars and the typing all pause while the grid is off screen or the tab is hidden. The visuals are decorative and hidden from screen readers — put the real message in the cell text. After adding or removing cells from script, call el.refresh().
More components
- Pearl Pricing
- Quote Wall
- Glass Cta
- Tide Slide
- Pearl Code
- Ink Sphere
- Frost Card
- Holo Card
- Stream Text
- Lens Compare
- Pearl Dial
- Nova Rating
- Pearl Check
- Pearl Input
- Glass Toast
- Pearl Select
- Glass Sheet
- Pearl Accordion
- Glass Tip
- Pearl Calendar
- Glass Nav
- Pearl Tabs
- Glass Command
- Halo Avatar
- Pearl Steps
- Pearl Skeleton
- Pearl Table
- Pearl Chip
- Pearl Empty
- Roll Counter
- Glass Marquee
- Reveal Text
- Mesh Gradient
- Silk Waves
- Dot Field
- Plasma Orb
- Voice Wave
- Plush Buddy
- Gummy Agent
- Glass Tabbar
- Glass Menu
- Magnet Button
- Beam Border
- Spotlight Card
- Scratch Reveal
- Glass Sidebar
- Pearl Pagination
- Pearl Breadcrumb
- Glass Dock
- Pearl Slider
- Pearl Segmented
- Liquid Metal Button
- Mercury Orb
- Prompt Input
- Voice Orb
- Aurora Ring
- Glass Toggle
- Firefly Button
- Pearl Button
- Pearl Loader
- Alien Face
- Prism Button
- Liquid Carousel
- Orbit Carousel
- Deck Carousel