Examples /
Feedback and status
Alerts, banners, empty states, loading skeletons, spinners and error pages.
Alerts
Info, success, warning and error. Each uses one Radix scale: 2 for the fill, 6 for the border, 11 and 12 for the text.
<div class="xw-560px w-100% mx-auto d-grid g-12px">
<div role="status" class="d-flex g-12px p-14px br-10px b-1px-solid-blueTheme6 bgc-blueTheme2">
<span class="c-blueTheme11 pt-1px"><svg class="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg></span>
<div class="d-grid g-2px fs-14px"><b class="fw-600 c-blueTheme12">A new version is available</b><span class="c-blueTheme11">Reload the page to get the latest features.</span></div>
</div>
<div role="status" class="d-flex g-12px p-14px br-10px b-1px-solid-greenTheme6 bgc-greenTheme2">
<span class="c-greenTheme11 pt-1px"><svg class="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg></span>
<div class="d-grid g-2px fs-14px"><b class="fw-600 c-greenTheme12">Payment received</b><span class="c-greenTheme11">We emailed the receipt to ada@example.com.</span></div>
</div>
<div role="alert" class="d-flex g-12px p-14px br-10px b-1px-solid-amberTheme6 bgc-amberTheme2">
<span class="c-amberTheme11 pt-1px"><svg class="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4M12 17h.01"/></svg></span>
<div class="d-grid g-2px fs-14px"><b class="fw-600 c-amberTheme12">Your trial ends in 3 days</b><span class="c-amberTheme11">Add a payment method to keep your projects. <a href="#" class="c-amberTheme12 fw-500">Upgrade</a></span></div>
</div>
<div role="alert" class="d-flex g-12px p-14px br-10px b-1px-solid-redTheme6 bgc-redTheme2">
<span class="c-redTheme11 pt-1px"><svg class="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6M9 9l6 6"/></svg></span>
<div class="d-grid g-2px fs-14px"><b class="fw-600 c-redTheme12">There were 2 errors</b>
<ul class="m-0 pl-18px c-redTheme11"><li>The password needs at least 12 characters.</li><li>That username is taken.</li></ul>
</div>
</div>
</div>export default function Alerts() {
return (
<div className="xw-560px w-100% mx-auto d-grid g-12px">
<div role="status" className="d-flex g-12px p-14px br-10px b-1px-solid-blueTheme6 bgc-blueTheme2">
<span className="c-blueTheme11 pt-1px">
<svg className="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10" />
<path d="M12 16v-4M12 8h.01" />
</svg>
</span>
<div className="d-grid g-2px fs-14px">
<b className="fw-600 c-blueTheme12">A new version is available</b>
<span className="c-blueTheme11">Reload the page to get the latest features.</span>
</div>
</div>
<div role="status" className="d-flex g-12px p-14px br-10px b-1px-solid-greenTheme6 bgc-greenTheme2">
<span className="c-greenTheme11 pt-1px">
<svg className="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10" />
<path d="m9 12 2 2 4-4" />
</svg>
</span>
<div className="d-grid g-2px fs-14px">
<b className="fw-600 c-greenTheme12">Payment received</b>
<span className="c-greenTheme11">We emailed the receipt to ada@example.com.</span>
</div>
</div>
<div role="alert" className="d-flex g-12px p-14px br-10px b-1px-solid-amberTheme6 bgc-amberTheme2">
<span className="c-amberTheme11 pt-1px">
<svg className="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" />
<path d="M12 9v4M12 17h.01" />
</svg>
</span>
<div className="d-grid g-2px fs-14px">
<b className="fw-600 c-amberTheme12">Your trial ends in 3 days</b>
<span className="c-amberTheme11">
Add a payment method to keep your projects.
<a href="#" className="c-amberTheme12 fw-500">Upgrade</a>
</span>
</div>
</div>
<div role="alert" className="d-flex g-12px p-14px br-10px b-1px-solid-redTheme6 bgc-redTheme2">
<span className="c-redTheme11 pt-1px">
<svg className="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10" />
<path d="m15 9-6 6M9 9l6 6" />
</svg>
</span>
<div className="d-grid g-2px fs-14px">
<b className="fw-600 c-redTheme12">There were 2 errors</b>
<ul className="m-0 pl-18px c-redTheme11">
<li>The password needs at least 12 characters.</li>
<li>That username is taken.</li>
</ul>
</div>
</div>
</div>
);
}Announcement banner
A slim bar for the top of a page, with a link and a close button.
<div class="d-flex aic jcc g-12px px-44px py-10px br-10px position-relative bgc-accentRA1000 c-white fs-14px ta-center">
<span><b class="fw-600">AliasCSS 1.5.4 is out.</b> Dashed names, --imp and keyframes without brackets.</span>
<a href="#" class="d-inline-flex aic g-4px c-white fw-600 td-none white-space-nowrap --hover-td-underline">Read more<svg class="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 5l7 7-7 7"/></svg></a>
<button aria-label="Dismiss" class="position-absolute r-8px d-grid place-items-center w-28px h-28px br-6px b-0 bgc-transparent c-white cursor-pointer --hover-bgc-whiteA4"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
</div>export default function Banner() {
return (
<div className="d-flex aic jcc g-12px px-44px py-10px br-10px position-relative bgc-accentRA1000 c-white fs-14px ta-center">
<span>
<b className="fw-600">AliasCSS 1.5.4 is out.</b>
Dashed names, --imp and keyframes without brackets.
</span>
<a href="#" className="d-inline-flex aic g-4px c-white fw-600 td-none white-space-nowrap --hover-td-underline">
Read more
<svg className="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M5 12h14M13 5l7 7-7 7" />
</svg>
</a>
<button aria-label="Dismiss" className="position-absolute r-8px d-grid place-items-center w-28px h-28px br-6px b-0 bgc-transparent c-white cursor-pointer --hover-bgc-whiteA4">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M18 6 6 18M6 6l12 12" />
</svg>
</button>
</div>
);
}Empty state
What a list shows before it has items: an icon, one line of explanation and the action that fills it.
<div class="w-100% xw-440px d-grid justify-items-center g-12px px-24px py-40px br-14px b-1px-dashed-slateTheme6 ta-center">
<span class="d-grid place-items-center w-48px h-48px br-12px bgc-slateTheme3 c-slateTheme11"><svg class="w-22px h-22px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg></span>
<div class="d-grid g-4px">
<h3 class="m-0 fs-16px fw-600 c-slateTheme12">No projects yet</h3>
<p class="m-0 fs-14px lh-1.5 c-slateTheme11">Projects group your pages, assets and team. Create one to get started.</p>
</div>
<button class="d-inline-flex aic g-8px h-36px px-14px br-8px b-0 bgc-accentRA1000 c-white fs-14px fw-500 font-family-inherit cursor-pointer mt-4px --hover-bgc-accentRA1100"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>New project</button>
</div>export default function EmptyState() {
return (
<div className="w-100% xw-440px d-grid justify-items-center g-12px px-24px py-40px br-14px b-1px-dashed-slateTheme6 ta-center">
<span className="d-grid place-items-center w-48px h-48px br-12px bgc-slateTheme3 c-slateTheme11">
<svg className="w-22px h-22px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
</svg>
</span>
<div className="d-grid g-4px">
<h3 className="m-0 fs-16px fw-600 c-slateTheme12">No projects yet</h3>
<p className="m-0 fs-14px lh-1.5 c-slateTheme11">
Projects group your pages, assets and team. Create one to get started.
</p>
</div>
<button className="d-inline-flex aic g-8px h-36px px-14px br-8px b-0 bgc-accentRA1000 c-white fs-14px fw-500 font-family-inherit cursor-pointer mt-4px --hover-bgc-accentRA1100">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M12 5v14M5 12h14" />
</svg>
New project
</button>
</div>
);
}Loading skeleton
Placeholder blocks with a shimmer. The shimmer is one keyframes attribute and a moving gradient; reduced motion turns it off.
<i class="d-none" keyframes-shimmer="@0-[background-position(200%_0)] @100-[background-position(-200%_0)]"></i>
<div aria-busy="true" aria-label="Loading" class="w-100% xw-420px d-grid g-16px p-16px br-12px b-1px-solid-slateTheme5 bgc-slateTheme1 _[data-sk][background(linear-gradient(90deg,var(--x-sk-color)_25%,var(--x-sk-shine-color)_50%,var(--x-sk-color)_75%)),background-size-200%-100%,animation(shimmer_1.4s_linear_infinite)] @motion-reduce_[data-sk]-animation-none --x-sk-color:slateTheme4 --x-sk-shine-color:slateTheme2">
<div class="d-flex aic g-12px">
<span data-sk class="w-44px h-44px br-999px flex-shrink-0"></span>
<span class="d-grid g-8px flex-1"><span data-sk class="br-6px h-12px w-60%"></span><span data-sk class="br-6px h-10px w-40%"></span></span>
</div>
<span data-sk class="br-6px h-120px"></span>
<span class="d-grid g-8px"><span data-sk class="br-6px h-10px"></span><span data-sk class="br-6px h-10px w-90%"></span><span data-sk class="br-6px h-10px w-70%"></span></span>
</div>export default function Skeleton() {
return (
<>
<i className="d-none" keyframes-shimmer="@0-[background-position(200%_0)] @100-[background-position(-200%_0)]" />
<div aria-busy="true" aria-label="Loading" className="w-100% xw-420px d-grid g-16px p-16px br-12px b-1px-solid-slateTheme5 bgc-slateTheme1 _[data-sk][background(linear-gradient(90deg,var(--x-sk-color)_25%,var(--x-sk-shine-color)_50%,var(--x-sk-color)_75%)),background-size-200%-100%,animation(shimmer_1.4s_linear_infinite)] @motion-reduce_[data-sk]-animation-none --x-sk-color:slateTheme4 --x-sk-shine-color:slateTheme2">
<div className="d-flex aic g-12px">
<span data-sk="" className="w-44px h-44px br-999px flex-shrink-0" />
<span className="d-grid g-8px flex-1">
<span data-sk="" className="br-6px h-12px w-60%" />
<span data-sk="" className="br-6px h-10px w-40%" />
</span>
</div>
<span data-sk="" className="br-6px h-120px" />
<span className="d-grid g-8px">
<span data-sk="" className="br-6px h-10px" />
<span data-sk="" className="br-6px h-10px w-90%" />
<span data-sk="" className="br-6px h-10px w-70%" />
</span>
</div>
</>
);
}Spinners and loading dots
A border spinner, a dashed ring and three bouncing dots. Each is one element and one keyframes attribute.
<i class="d-none" keyframes-spin="@100-[tf-rotate(360deg)]"></i>
<i class="d-none" keyframes-bounce="@[0,80,100][tf-scale-0.6,o-0.4] @40-[tf-scale-1,o-1]"></i>
<div class="d-flex aic g-40px c-accentRATheme1000">
<span role="status" aria-label="Loading" class="d-block w-28px h-28px br-999px b-3px-solid-slateTheme5 border-top-color-currentColor animation(spin_.8s_linear_infinite)"></span>
<span role="status" aria-label="Loading" class="d-block w-28px h-28px br-999px b-3px-dashed-currentColor animation(spin_2s_linear_infinite)"></span>
<span role="status" aria-label="Loading" class="d-flex g-6px __span[w-8px,h-8px,br-999px,bgc-currentColor,animation(bounce_1s_ease-in-out_infinite)] __span--nth-child(2)-animation-delay-.15s __span--nth-child(3)-animation-delay-.3s"><span></span><span></span><span></span></span>
</div>export default function Spinners() {
return (
<>
<i className="d-none" keyframes-spin="@100-[tf-rotate(360deg)]" />
<i className="d-none" keyframes-bounce="@[0,80,100][tf-scale-0.6,o-0.4] @40-[tf-scale-1,o-1]" />
<div className="d-flex aic g-40px c-accentRATheme1000">
<span role="status" aria-label="Loading" className="d-block w-28px h-28px br-999px b-3px-solid-slateTheme5 border-top-color-currentColor animation(spin_.8s_linear_infinite)" />
<span role="status" aria-label="Loading" className="d-block w-28px h-28px br-999px b-3px-dashed-currentColor animation(spin_2s_linear_infinite)" />
<span role="status" aria-label="Loading" className="d-flex g-6px __span[w-8px,h-8px,br-999px,bgc-currentColor,animation(bounce_1s_ease-in-out_infinite)] __span--nth-child(2)-animation-delay-.15s __span--nth-child(3)-animation-delay-.3s">
<span />
<span />
<span />
</span>
</div>
</>
);
}404 page
A full error page: a large code, one sentence and two ways out.
<main class="d-grid justify-items-center g-16px ta-center">
<p class="m-0 fs-14px fw-600 c-accentRATheme1100">404</p>
<h1 class="m-0 fs-40px fw-700 letter-spacing--0.02em c-slateTheme12">Page not found</h1>
<p class="m-0 xw-360px fs-16px lh-1.6 c-slateTheme11">The page you're looking for was moved, removed, or never existed.</p>
<div class="d-flex g-10px mt-8px">
<a href="#" class="d-inline-flex aic h-40px px-16px br-8px bgc-accentRA1000 c-white fs-14px fw-500 td-none --hover-bgc-accentRA1100">Go home</a>
<a href="#" class="d-inline-flex aic h-40px px-16px br-8px b-1px-solid-slateTheme7 c-slateTheme12 fs-14px fw-500 td-none --hover-bgc-slateTheme3">Contact support</a>
</div>
</main>export default function NotFound() {
return (
<main className="d-grid justify-items-center g-16px ta-center">
<p className="m-0 fs-14px fw-600 c-accentRATheme1100">404</p>
<h1 className="m-0 fs-40px fw-700 letter-spacing--0.02em c-slateTheme12">Page not found</h1>
<p className="m-0 xw-360px fs-16px lh-1.6 c-slateTheme11">
The page you're looking for was moved, removed, or never existed.
</p>
<div className="d-flex g-10px mt-8px">
<a href="#" className="d-inline-flex aic h-40px px-16px br-8px bgc-accentRA1000 c-white fs-14px fw-500 td-none --hover-bgc-accentRA1100">Go home</a>
<a href="#" className="d-inline-flex aic h-40px px-16px br-8px b-1px-solid-slateTheme7 c-slateTheme12 fs-14px fw-500 td-none --hover-bgc-slateTheme3">Contact support</a>
</div>
</main>
);
}