Docs / Components / Cards
Cards
Cards 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.
Cards New
A card in two layers: a tinted shell holding a raised media panel (a picture, an illustration or a live preview), then a title, a line of text and one action. Only the media and the action are links, so the text stays selectable and each card is a single tab stop. The cards on the components page are built with it.
API
Programmatic access to your account.
<div class="ace-card">
<a class="ace-card-media" href="/reports" tabindex="-1" aria-hidden="true">
<img src="reports.png" alt="">
</a>
<div class="ace-card-body">
<h3 class="ace-card-title" id="reports-title">Reports</h3>
<p class="ace-card-text">Weekly summaries of bookings and revenue.</p>
<a class="ace-btn ace-btn--glass ace-btn--block ace-card-action" href="/reports"
id="reports-cta" aria-labelledby="reports-cta reports-title">View reports</a>
</div>
</div>Parts
ace-card the tinted shell (4px padding, 24px corners)
ace-card-media the raised panel: an <a> (lifts on hover) or a plain <div>
ace-card-body title, text and action, in a column
ace-card-title 16px, medium
ace-card-text 13px, muted (a touch darker, for contrast on the shell)
ace-card-action pinned to the bottom, so a row of cards lines its actions up
/* Tune it (light values shown; dark mode sets its own) */
.ace-card { --ace-card-radius: 24px; --ace-card-shell: …; --ace-card-panel: …;
--ace-card-shadow: …; --ace-card-shadow-hover: …; }Do
- Give the media link
tabindex="-1"andaria-hidden="true"and make the action the real link, so keyboard and screen-reader users get one stop per card. - Name the action with the card title (
aria-labelledby) when every card says the same thing, such as "View".
Don't
- Wrap the whole card in a link: the text can't be selected, and a screen reader reads the whole card as the link's name.
- Put more than one main action in a card; link secondary things from the page it opens.
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
Glass buttonsButtons 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.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
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