← Home v1.5.0

Docs / Components / Glass buttons

Glass buttons

Buttons v2: frosted glass pill buttons with a lit rim and soft layered shadow, plus a brand-coloured glass pill with a glow. Three sizes, icon buttons, a flat Coming soon state, dark mode built in, no JavaScript.

Glass buttons New

The glass of the liquid navbar (a tinted surface with light along the rim) on a pill button, in plain CSS. Add ace-btn--glass (neutral) or ace-btn--glass-primary (brand colour) to ace-btn instead of another variant. A 1px rim lit from the top, a hairline round the outside and a soft layered shadow make it sit on the card; pressed, it drops 1px and the shadow tightens. Disabled, it goes flat with a faint outline, for “Coming soon”.

Starter

For side projects and prototypes.

Get started
Team

Shared workspaces and roles.

Get started
Enterprise

SSO and audit logs.

<a class="ace-btn ace-btn--glass ace-btn--block" href="/signup">Get started</a>
<button class="ace-btn ace-btn--glass ace-btn--block" disabled>Coming soon</button>

Navbar pair: glass and primary glass

At --sm (38px, 13px text) the pair fits a navbar or a page header. ace-btn--glass-primary puts the brand colour behind the same glass, with a soft glow of that colour underneath. It follows --ace-primary, or --ace-tone on the button or a section; the fill is deepened a little (--ace-glass-tone-depth, 24%) so the white label keeps 4.5:1. A leading icon is 18px and a shade softer than the label until hover.

Open app Get started --ace-tone: #0e7490
<a class="ace-btn ace-btn--glass ace-btn--sm" href="/app"><svg …/>Open app</a>
<a class="ace-btn ace-btn--glass-primary ace-btn--sm" href="/signup">Get started</a>

<!-- Any colour: one variable on the button or a whole section -->
<a class="ace-btn ace-btn--glass-primary ace-btn--sm" style="--ace-tone:#0e7490" href="/signup">Get started</a>

/* Very light or very dark brand: tune how much the fill is deepened */
.ace-btn--glass-primary { --ace-glass-tone-depth: 10%; }

Sizes, icons and glass over colour

The glass scale is 38, 44 (default) and 52px, always a full pill; --icon makes a round button. Over a picture or colour, the tint lets a little of it show through.

ace-btn--glass                 44px pill, 24px side padding, 15px text
ace-btn--glass-primary         the same pill in the brand colour
ace-btn--glass ace-btn--sm     38px  — navbars, headers
ace-btn--glass ace-btn--lg     52px
ace-btn--glass ace-btn--icon   round; combine with --sm / --lg
ace-btn--glass ace-btn--block  full width (cards)

<button class="ace-btn ace-btn--glass-primary ace-btn--lg">Get started <svg …/></button>
<button class="ace-btn ace-btn--glass ace-btn--icon" aria-label="Add"><svg …/></button>

/* Tune the glass (light values shown; dark mode sets its own) */
.ace-btn--glass { --ace-glass-bg: rgb(239 240 240 / 0.9); --ace-glass-sheen: rgb(255 255 255 / 0.2); }
Do
  • Use it for calm, repeated actions on cards and over imagery (Get started, Open, View).
  • Use one --glass-primary per view for the main action; the neutral glass for everything around it.
Don't
  • Combine it with another variant (--primary, --secondary…): --glass and --glass-primary are variants of their own.
  • Put it on busy, high-contrast photos without a scrim: the light tint needs a calm backdrop to stay readable.

Use it

One stylesheet from the CDN, pinned to v1.5.0:

<link rel="stylesheet" href="https://acecss.dev/v1.5.0/ace.min.css"
      integrity="sha384-WmkeAiD0DT0GfPo6Dp2l/XBsGQEN1+Fo/7i+QMs/3UfKE/xCswJsjpBxwKYYSMCR" crossorigin="anonymous">

Or from npm:

npm i @acecss/core

import '@acecss/core'

Bundlers, Tailwind, every script in one file and self-hosting: Install.

More components

ButtonsCopy-paste CSS buttons with primary, secondary and danger styles, five colours, any brand colour via one variable, four sizes, icon buttons and a loading state. Dark mode built in, no JavaScript.View component
Hero buttonA sparkle call-to-action button for landing pages: a dark pill that turns brand-coloured on hover, with twinkling stars, a spark line round the edge and particles. No GSAP, respects reduced motion.View component
NavbarA sticky floating glass navbar: blurred, tinted pill with a sliding hover highlight, a raised shadow on scroll and a mobile menu that unfolds inside the pill. Framework-free, dark mode included.View component
Liquid navbarA liquid-glass navbar that refracts the real page behind it: a WebGL lens magnifies, bends content in at the rim with a colour fringe, frosts and lights the glass. Drop-in HTML, no framework.View component
CardsCards in two layers: a tinted shell holding a raised media panel, then a title, text and one glass action. Only the media and the action are links, one tab stop per card, actions lined up across a row. Dark mode built in, no JavaScript.View component
Segmented controlA segmented control for switching views or options: a row of AceCSS buttons with aria-pressed, in three sizes and a full-width variant. Accessible, dark-mode ready, no JavaScript needed for the styles.View component
InputsAccessible CSS text inputs with labels, hints, required markers and error states, plus inputs with icons, prefixes and suffixes. Works with plain HTML forms and any framework.View component
Select & dropdownStyle native selects and textareas, or turn any <select> into a searchable dropdown with sub-labels and option groups. About 3 KB of JavaScript, keyboard accessible, no dependencies.View component
Date pickerA dependency-free date picker and pick-up → return date range picker that shows two months side by side, with times, min and max dates, locales and a change event. Dates can be typed or picked. About 5 KB of JavaScript, dark mode ready.View component
Time pickerTurns a real <input type="time"> into a field you can type into or pick from a list: step, min and max, overnight ranges, 12- or 24-hour display. Submits HH:MM like a normal field, works without JavaScript, keyboard accessible.View component
Checkbox, radio & switchStyled native checkboxes, radio buttons and toggle switches in pure CSS: accessible labels, focus rings and dark mode, with no JavaScript.View component
BadgesStatus badges in pure CSS: neutral, primary, success, warning, danger and info, in two sizes, with contrast checked for white text.View component
Choice cardsSelectable cards for plans, extras or options: built on AceCSS buttons, selected with a class, aria-pressed or a checked radio inside. Pure CSS, accessible, dark mode ready.View component