A video game character select screen with a large image of Ryu and a row of selectable character portraits at the bottom

CSS :has() Character Select Screen

demo & code

This is a CSS :has() Character Select Screen. It replicates the classic user interface of a fighting game’s selection menu, using modern CSS to handle all state logic. Its function is to demonstrate how the :has() pseudo-class can completely replace JavaScript for managing visibility in a selection-based UI, triggering changes in the main content area based on the state of a radio button group.

Level: Beginner
Browser Support [As of Mar 2026]: Chrome 105+, Edge 105+, Firefox 121+, Safari 15.4+
A settings panel UI featuring a notification icon and text that dynamically change from 'Off' to 'On' when the adjacent toggle switch is activated

CSS :has() Notification Toggle

demo & code

This is a CSS :has() Notification Toggle. It provides a fully functional, state-aware UI switch for settings panels without a single line of JavaScript. Its function is to allow the user to toggle a binary state (notifications on/off) and have the entire UI — including icons, labels, and descriptive text — update instantly based purely on the state of a hidden checkbox.

Level: Beginner
Browser Support [As of Mar 2026]: Chrome 105+, Edge 105+, Firefox 121+, Safari 15.4+
E-commerce product grid with a sidebar filter demonstrating pure CSS logic using the :has pseudo-class

E-commerce Product Filter

demo & code

This is a Pure CSS E-commerce Product Filter. It replaces JavaScript-based array filtering with native CSS relationship selectors. Its function is to toggle product visibility based on multiple checkbox states within a sidebar, offering an instant, script-free sorting mechanism for catalog grids.

Level: Intermediate
Browser Support [As of Mar 2026]: Chrome 105+, Edge 105+, Firefox 121+, Safari 15.4+
Minimalist white wallet card UI expanding to reveal bank card options and cash amounts using a pure CSS click interaction

Expandable Wallet Payment Card

demo & code

This is an Expandable Wallet Payment Card. It uses pure CSS to manage complex UI states without JavaScript. Its function is to conceal secondary actions — like selecting a payment method or adding funds — behind a compact primary view showing the balance. The interaction is self-contained, optimizing screen real estate while keeping critical functions one click away.

Level: Intermediate
Browser Support [As of Feb 2026]: Chrome 105+, Edge 105+, Firefox 121+, Safari 15.4+
Dark UI toggle switch in 'ON' state emitting a realistic orange ember glow and rust texture created purely with CSS.

Industrial Ember Glow Toggle Switch

demo & code

This is an Industrial Ember Glow CSS Toggle Switch. It uses layered box-shadow properties and complex radial gradients to simulate a physical, heat-emitting mechanism. Its function is to handle binary states (On/Off) while providing intense visual feedback. The effect relies completely on CSS, bypassing JavaScript to manage its interactive state and idle animations.

Level: Intermediate
Browser Support [As of Feb 2026]: Chrome 88+, Edge 88+, Firefox 84+, Safari 14+
A blue toggle switch UI element where the white circular handle is elongating and morphing like liquid during the transition from off to on.

Morphing Liquid Toggle Switch

demo & code

This Morphing Liquid Toggle Switch takes the standard UI control to a new level of polish. Instead of a rigid circle sliding back and forth, the handle behaves like a viscous fluid. When toggled, it stretches, snaps, and settles into place with a satisfying elastic bounce, creating a delightful tactile experience for the user.

Level: Intermediate
Browser Support [As of Feb 2026]: Chrome 50+, Edge 79+, Firefox 50+, Safari 10+
A dark-themed list of system diagnostics (Memory Test, Disk Integrity). The checkboxes are 3D mechanical discs that flip from dark grey to glowing orange when checked.

Flip-Disc Mechanical Checkbox

demo & code

This Flip-Disc Mechanical Checkbox brings the satisfying, tactile physics of old-school airport information boards to the web. Instead of a simple tick, selecting an item triggers a 3D rotation of a mechanical disc, flipping it from a dark, inactive side to a glowing orange active side. This creates a high-contrast, industrial aesthetic perfect for system dashboards or retro-themed interfaces.

Level: Intermediate
Browser Support [As of Feb 2026]: Chrome 36+, Edge 12+, Firefox 16+, Safari 9+
A collection of skeuomorphic toggle switches with wooden handles, detailed shadows, and varied designs (sliding, rocking, and pill-shaped) in 'ON' and 'OFF' states.

Skeuomorphic Wood Texture Toggles

demo & code

This collection of Skeuomorphic Wood Texture Toggles brings a tactile, nostalgic feel to digital interfaces. It showcases four distinct variations of toggle switches (sliding, dotted handle, separated track, and embedded text), all unified by a realistic wood grain texture and intricate lighting effects. The implementation demonstrates the power of modern CSS features like :has() to control complex state changes without a single line of JavaScript.

Level: Intermediate
Browser Support [As of Feb 2026]: Chrome 105+, Edge 105+, Firefox 121+, Safari 15.4+
Minimalist toggle switch morphing from a sun icon to a moon icon using pure CSS transitions and the :has selector

Pure CSS Morphing Dark Mode Toggle

demo & code

This Pure CSS Morphing Dark Mode Toggle is a sophisticated implementation of a theme switcher that eliminates the need for JavaScript. By utilizing the modern CSS :has() relational selector and complex transform logic, the component morphs a sun icon into a moon icon seamlessly. It offers a premium feel through the use of custom cubic-bezier timing and modular CSS construction.

Level: Intermediate
Browser Support [As of Jan 2026]: Chrome 105+, Edge 105+, Safari 15.4+, Firefox 121+
Minimalist toggle switch that triggers a white curtain sweep, inverting page colors using CSS mix-blend-mode logic

Pure CSS Mix-Blend-Mode Dark Toggle

demo & code

This Pure CSS Mix-Blend-Mode Dark Toggle offers a lightweight, JavaScript-free solution for theming. Instead of manually redefining colors for a dark theme, it utilizes a full-screen “curtain” overlay with a specific blending mode to mathematically invert the page’s color palette. The result is a smooth, wiping transition that instantly creates a high-contrast dark mode.

Level: Intermediate
Browser Support [As of Jan 2026]: Chrome 41+, Edge 79+, Firefox 32+, Safari 8+
A fully functional Connect 4 game board implemented entirely in CSS.

Can :has() Connect 4?

A fully functional Connect 4 game implemented entirely in CSS, utilizing the :has() selector to manage complex game state, enforce turn-taking via CSS counters, and detect win conditions (vertical, horizontal, diagonal).

See the Pen Can :has() Connect 4?.

Pure CSS Home Media (Ambilight)

Pure CSS Home Media (Ambilight)

A remarkable, zero-JS interactive environment simulation utilizing the CSS Checkbox Hack and global CSS Variables to control the scene’s ambient lighting.

See the Pen Pure CSS Home Media (Ambilight).

Tailwind Glassy Profile

Tailwind Glassy Profile

A highly interactive, visually deep (glassy) component where the user can reveal two different layers of information (data and social media) or switch to a fullscreen content mode using only CSS triggers.

See the Pen Tailwind Glassy Profile.

Tailwind Social Profile Light with Theme Toggle

Tailwind Social Profile Light with Theme Toggle

A highly dynamic and visually complex component that uses a combination of advanced CSS selectors and techniques to create a sophisticated, multi-stage UI effect without heavy libraries.

Ergonomic Toggle (CSS)

Ergonomic Toggle (CSS)

A hyper-realistic skeuomorphic toggle switch crafted entirely in CSS using advanced box-shadows and gradients to simulate depth and lighting.

See the Pen Ergonomic Toggle (CSS).

Skull Toggle (CSS)

Skull Toggle (CSS)

A playful skeleton toggle switch animated purely with CSS. The skull handle slides via @keyframes triggered by the :checked state, while a complex hand assembly - constructed from gradients and box-shadows - slides in to “push” the toggle, creating a whimsical, interactive narrative without JavaScript.

See the Pen Skull Toggle (CSS).

Grow Up, They Said...

Grow Up, They Said...

An interactive 3D todo list utilizing CSS perspective and rotateY transforms to create tangible, flipping card effects. JavaScript orchestrates a staggered entrance animation via setTimeout loops, while Sass mixins manage complex transition delays for the cascading sub-menu reveal.

See the Pen Grow Up, They Said....

Simple To-Do List Built with Tailwind CSS

Simple To-Do List Built with Tailwind CSS

A responsive dual-theme todo list built with Tailwind CSS, relying on the input:checked + label selector hack for state management.

HTML Accordion (Tailwind Only)

HTML Accordion (Tailwind Only)

A smooth, fully functional accordion that animates expansion to the content’s intrinsic height without requiring JS dimension calculations.

See the Pen HTML Accordion (Tailwind Only).