Most demos need a newer browser

They use :has() and container queries. Update your browser, or on an iPhone update iOS to 16.4 or later.

CSS does more than you think.

Pure CSS examples and UI patterns

86 interactive UI patterns, zero JavaScript required.

Browse Examples

No examples match these filters yet. Turn on another level or pick another category.

Cues light up where there is more to scroll

Your browser can't run this demo

It needs :has(), container queries and scroll-state container queries, which this browser doesn't support yet. It works in Chrome 133+ and Edge 133+. Firefox and Safari don't support it yet.

Needs :has(), container queries and scroll-state container queries

Items

More above More below

  • Build finished
  • New comment on Pricing
  • Invoice paid
  • Deploy to staging
  • Two new sign-ups
  • Backup completed
  • Review requested
  • Password changed
  • Weekly report ready
  • Domain renewed
  • Cache cleared
  • Server restarted

Detect a Scrollable Element

IntermediateNew

Type, paste or delete in the headline

Your browser can't run this demo

It needs :has(), color-mix(), trigonometric functions and field-sizing, which this browser doesn't support yet. It works in Chrome 123+, Edge 123+, Firefox 152+ and Safari 26.2+.

Needs :has(), color-mix(), trigonometric functions and field-sizing

Up to 30 characters

The digits roll when the plan changes

Your browser can't run this demo

It needs :has() and the lh unit, which this browser doesn't support yet. It works in Chrome 109+, Edge 109+, Firefox 121+ and Safari 16.4+.

Needs :has() and the lh unit

$29 a month

$14 a month, billed yearly

The same radius, a softer curve

Your browser can't run this demo

It needs corner-shape, which this browser doesn't support yet, so you're seeing a plainer version. It works in Chrome 139+ and Edge 139+. Firefox and Safari don't support it yet.

Needs corner-shape

round
squircle

// this browser has no corner-shape yet, so both tiles are round

Squircle Corners

Beginner

Buttons you want to press

Tactile Button

Beginner

Glass that bends what is behind it

Liquid glass

The stripes bend as they pass behind it.

A glow that travels around the card

Pro plan

A border that never stops moving.

Rotating Glow Border

Intermediate

One gradient, turning slowly

New this week

two ray layers, turning at different speeds

Rotating Starburst

Intermediate

Drag the corner handle

An illustrated harbor at dusk with a pink and purple sky, a sun behind mountains, a pier and two sailboats on the water.
The same harbor scene drawn in flat grayscale, before the color edit.
Before After

drag the handle in the bottom right corner

A bar that inverts what it crosses

DIFFERENCE

// a white bar sweeps across: where it meets the letters, both go black
// overlapping circles subtract each other's color channels

Scroll the list

A
AJ
Alice JohnsonDesign
AM
Alex MorrisEngineering
AW
Amy WuMarketing
B
BC
Ben CarterEngineering
BL
Beth LeeDesign
C
CK
Chris KimProduct
CM
Clara MillsDesign
CP
Cole ParkEngineering
D
DJ
Dana JonesMarketing
DS
Drew SmithEngineering
E
EB
Emma BrooksDesign
EH
Ethan HallProduct
F
FN
Fiona NashEngineering
FO
Frank OrtizMarketing

A list that reveals as you scroll

↓ scroll to reveal
⚡
Scroll-driven animations
Link animation progress directly to scroll position, with no JavaScript and no IntersectionObserver.
🎨
CSS custom properties
Dynamic theming, animations, and calculations powered entirely by CSS variables.
📦
Container queries
Responsive components that adapt to their container's size, not the viewport.
🔗
CSS nesting
Write scoped, composable styles inside each other, using native Sass-style syntax.
📐
Subgrid
Nested grids that align to their parent's tracks, making complex layouts trivial.
✨
@starting-style
Animate elements from their initial state when they first appear in the DOM.

Drag the corner to resize

// Files
index.njk
global.css
eleventy.config.js
allExamples.js
base.njk
drag corner ↘ to resize
// Preview
← select a file to preview

Split Panel

Beginner

One element, two hundred seventeen shadows

purecss.com

One <div>, and every pixel is a CSS box-shadow value

CSS QR Code

Advanced

A month in seven columns

May 2026
Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

CSS Calendar

Intermediate

Sweep in on entry

↓ scroll to reveal
Design

Typography first.

Great design starts with type. Every layout decision, from spacing to hierarchy to rhythm, flows from the words on the page. CSS gives you full control without a single line of JavaScript.

Performance

No JavaScript overhead.

Scroll-driven animations run on the compositor thread. They don't block the main thread, don't require IntersectionObserver, and can't be slowed by heavy scripts. Pure CSS wins here.

Modern CSS

Native scroll animations.

Scroll-driven animations link movement to scroll position. With progressive enhancement, you can use them today, because non-supporting browsers see the final state.

Scroll Reveal

Advanced

Two tracks, opposite directions

Pure CSS Zero JavaScript No Dependencies Modern CSS Open Source Built with Eleventy
Scroll Snap CSS Nesting Custom Properties Scroll-Driven Container Queries Cascade Layers

Marquee Text

Beginner

Blur, then reveal on hover

Project Nightfall is our internal codename for the upcoming acquisition of Meridian Labs. The deal is expected to close on March 14th for a total of $240 million.

The lead negotiator is Sarah Chen from our legal team. Her direct contact is sarah@example.com . Please keep this confidential until the public release.

// hover to reveal

Redacted Text

Beginner

Words rotating on a loop

CSS is
versatile. modern. expressive. fast. versatile.
Build
anything. boldly. natively. beautifully. anything.

Text Ticker

Intermediate

Click to run the sequence

click to start
click to start

Progress Button

Intermediate

Click a header to expand

CSS nesting lets you write rules inside other rules, like Sass, but natively in the browser. Child selectors, pseudo-classes, and media queries can all live inside their parent block.
When a grid child has min-height: 0 (the default), setting the row track to 0fr collapses it to exactly zero. Transitioning to 1fr lets the browser interpolate to the natural content height, with no JavaScript and no fixed heights.
The max-height approach requires you to set a fixed maximum (like max-height: 1000px), which causes the animation timing to feel wrong for short content, because the browser animates through all the "empty" height before anything collapses. The grid trick avoids this entirely.

Expandable Card

Intermediate

Seven bars, one keyframe

Weekly visitors

65
Mon
45
Tue
80
Wed
55
Thu
90
Fri
70
Sat
30
Sun

CSS Bar Chart

Intermediate

Pie and donut from one gradient

Pie chart

Category A 35%
Category B 25%
Category C 20%
Category D 20%

Donut variant

Revenue 42%
Cost 23%
Tax 20%
Other 15%

CSS Pie Chart

Intermediate

Four gradients, one sweep

Pure CSS Golden Shimmer Rainbow Text Effect // loading content...

Four directions off one trigger

Top ↑ Right → Bottom ↓ ← Left

Tooltip Directions

Intermediate

Four severities and a dismiss

ℹ
Info Your password will expire in 7 days.
✓
Success Your profile was updated successfully.
⚠
Warning You have unsaved changes on this page.
✕
Error Failed to connect. Check your network.

Alert Banners

Beginner

Three toasts, driven by the URL hash

Your browser can't run this demo

It needs :has(), which this browser doesn't support yet, so you're seeing a plainer version. It works in Chrome 105+, Edge 105+, Firefox 121+ and Safari 15.4+.

Needs :has()

Position
✓ Changes saved successfully! ✕
✕ Something went wrong. Try again. ✕
ℹ Your session expires in 5 minutes. ✕

Toast Notification

Intermediate

Two stages, one checkbox

Are you sure?

Confirm Button

Intermediate

Hover to trace the outline

Border Draw Button

Intermediate

Three easings side by side

Elastic
bounce
Spring
overshoot
Linear
(for reference)

Elastic Bounce

Intermediate

Scroll inside the box

Your browser can't run this demo

It needs scroll-driven animations, which this browser doesn't support yet. It works in Chrome 115+, Edge 115+, Firefox 159+ and Safari 26+.

Needs scroll-driven animations

Scroll to explore

Each layer moves at a different speed

↑ scroll inside the box ↑

Thirty-two pieces from five cycles

🎉 Congrats!

Confetti Burst

Advanced

Three lines in sequence

Hello, World! 👋

Pure CSS only

// no JavaScript required

Typewriter Effect

Intermediate

Three glowing signs

PURE CSS

NEON GLOW

no javascript

Neon Text Effect

Beginner

A rail of fixed width cards

Design Systems
12 articles
CSS Tricks
8 articles
Typography
15 articles
Animation
9 articles
Layout
20 articles
Performance
6 articles
Accessibility
11 articles

← scroll or swipe →

Scroll Shelf

Beginner

Click a thumbnail

Your browser can't run this demo

It needs popover, which this browser doesn't support yet. It works in Chrome 114+, Edge 114+, Firefox 125+ and Safari 17+.

Needs popover

CSS Lightbox

Intermediate

Pick a section from the left

Overview

A quick introduction to the product. Use vertical tabs to organize content into logical sections without page reloads.

Features

Zero JavaScript, accessible via keyboard, fully themeable with CSS custom properties. Works on all modern browsers.

Pricing

Free and open source. Use it in personal and commercial projects. No attribution required.

Support

Open an issue on GitHub or check the documentation. Community-driven support available 24/7.

Vertical Tabs

Intermediate

Click a number, prev or next, or use arrow keys

Showing results 1-10 of 48 Showing results 11-20 of 48 Showing results 21-30 of 48 Showing results 31-40 of 48 Showing results 41-48 of 48

Pagination Component

Intermediate

Scroll the panel

Introduction

This sidebar uses position: sticky to stay in view while the content area scrolls. Scroll down to see it in action.

Installation

No dependencies required. Copy the CSS and HTML into your project. It works with any layout.

Usage

Add position: sticky; top: 0 to any element inside a scrolling container to pin it to the top.

API Reference

The sticky behavior respects top, bottom, left, and right offset values for precise positioning.

Examples

Common uses include sticky table headers, side navigation, notice banners, and floating action buttons.

Sticky Sidebar

Beginner

Number field and stepper row

Your browser can't run this demo

It needs :has(), which this browser doesn't support yet. It works in Chrome 105+, Edge 105+, Firefox 121+ and Safari 15.4+.

Needs :has()

B. Radio buttons, 0 to 10

A restyles the browser's own arrows through ::-webkit-inner-spin-button. It works for any range and allows typing. B uses radio buttons with minus and plus labels for a fixed range of 0 to 10. It renders consistently across browsers and dims the end buttons, but typing is not allowed.

Two styled selects

Move between steps

1. Your Info 2. Details 3. Done

Your Info

Details

All done!

✓ Form submitted, zero JavaScript used!

Multi-Step Form

Intermediate

Scroll the rows

Name Role Status Joined
Alice Chen Designer Active Jan 2023
Bob Torres Engineer Active Mar 2023
Carol Kim Manager Pending Jun 2023
David Park Engineer Inactive Aug 2022
Eva Müller Designer Active Nov 2023
Frank Liu Analyst Active Feb 2024
Grace Obi Engineer Pending Apr 2024
Henry Walsh Manager Inactive Sep 2022

Two intensities

Glitch
Base
Glitch
Intense

Glitch Effect

Intermediate

Scroll the article

Reading Progress

Check the frame and tires

Start with a visual inspection of the frame. Look for cracks, rust spots, or paint chips that expose bare metal. Check the welds where tubes meet. Run your hand along each seam. Small surface rust can be sanded and touched up with paint. Deep corrosion or cracks mean a trip to a bike shop. Frame damage is not something you fix at home.

Move to the tires next. Spin each wheel and watch for wobbles or hops. A wheel that moves side to side needs truing. Check the tire sidewalls for dry rot, which shows up as small cracks in the rubber. Press your thumb into the tread to feel for soft spots or cuts. Inflate both tires to the pressure range printed on the sidewall. Under-inflated tires make pedaling harder and wear out faster.

While the wheels spin, listen for grinding or clicking. Those sounds usually mean the bearings need attention. A bearing service takes special tools, so most riders bring that work to a shop. Check that the quick-release levers close firmly, with the lever pointing back along the fork or frame. An open lever is an easy way to lose a wheel.

Clean and lubricate the drivetrain

Wipe down the chain with a rag. Shift through every gear to expose the full length. A chain that looks black or gritty needs degreaser. Spray or brush the degreaser on, let it sit for a minute, then scrub with an old toothbrush. Rinse with water and dry the chain completely.

Apply chain lube one drop at a time on the top run of the chain, turning the pedals backward to work it in. Wipe off the excess with a clean rag. Too much lube attracts dirt. The chain only needs oil between the rollers, not coating the outside. A properly lubed chain runs quietly and shifts smoothly.

Check the derailleur cables while you are at it. Frayed cables snap when you shift under load. Shift into the smallest cog on the back wheel and inspect where the cable enters the derailleur. Look for broken strands sticking out from the cable housing. Replace any cable with visible damage.

Test the brakes and adjust the seat

Squeeze each brake lever hard and hold it while you try to push the bike forward. The wheel should lock completely. Inspect the pads for grooves or uneven wear. Pads worn down to the indicator line need replacing before your first ride.

Finish with the saddle height. Stand next to the bike and raise the seat until the top is level with your hip bone. Sit on the bike and put your heel on the pedal at its lowest point. Your leg should be straight. A seat that is too low makes your knees hurt on long rides. Once the height feels right, tighten the seat post clamp and give the saddle a twist to confirm it will not move.

Scroll with the wheel or swipe on touch

Type in a field and tab away

Enter a valid email address
At least 3 characters required

CSS Input Validation

Intermediate

Placeholders with a moving highlight

Your browser can't run this demo

It needs :has(), which this browser doesn't support yet. It works in Chrome 105+, Edge 105+, Firefox 121+ and Safari 15.4+.

Needs :has()

Skeleton Loader

Intermediate

Gradient filled type

Gradient Text Multi Color Animated Flow

Gradient Text

Beginner

Flip on hover

🎨 Front Side
Hover to flip
✨ Back Side
Pure CSS
Card Two
Hover me
No JS needed!

3D Card Flip

Intermediate

Reveal on click

The answer to life, the universe, and everything is 42. All without JavaScript.

Click-to-Reveal

Beginner

Five bars, one element type

CSS
HTML
JS
Rust
Upload

Progress Bars

Intermediate

Styled track and thumb

Your browser can't run this demo

It needs :has(), round() and scroll-driven animations, which this browser doesn't support yet. It works in Chrome 125+, Edge 125+, Firefox 159+ and Safari 26+.

Needs :has(), round() and scroll-driven animations

Styled Range Slider

Intermediate

Styled checkbox with a drawn check mark

Hover a word to see its tip

Hover over this word or this one to see tooltips.

Tooltip on Hover

Beginner

Click a tab to switch panels

Design panel content goes here.
Code panel content goes here.
Preview panel content goes here.

Tabs

Intermediate

Click a heading to expand

What is Pure CSS?
Pure CSS refers to techniques that achieve interactive UI patterns using only CSS, with no JavaScript required.
Which browsers are supported?
All modern browsers support the features used in these examples. Check caniuse.com for specific properties.
Can I use these in production?
Yes! These are real CSS techniques used in production sites. Always consider accessibility requirements for your use case.

Accordion / FAQ

Beginner

A toggle that repaints a panel

This area reacts to the theme toggle. Background, text and border all change.

Dark / Light Mode

Intermediate

Toggle a panel with one click

This content was hidden until you clicked the button, with no JavaScript needed.

Click a star to rate

Star Rating

Intermediate

Label floats on focus and on input

Floating Labels

Intermediate