Dark UI row of rounded buttons where 'Playlists' and 'Artists' are selected and visually fused into a single continuous capsule shape.

Merging Pill Filter Buttons

This Merging Pill Filter Button set introduces a fluid, organic feel to standard multi-select inputs. Instead of keeping active items isolated, this component visually fuses adjacent selected buttons into a single continuous shape. It’s an excellent choice for music apps, filtering systems, or any UI where categories are related and grouping them visually adds context.

Technologies:
HTML SCSS Babel
Difficulty: Intermediate
Browser Support (as of Feb 2026):
Chrome Chrome 60+ Edge Edge 79+ Firefox Firefox 50+ Safari Safari 10+
Features:
Visual Merging Adjacent Sibling Selector Negative Margins Fluid Scaling
License: MIT

See the Pen Merging Pill Filter Buttons.

A set of contact buttons that collapse into a single arrow icon and expand back on click.

Expanding Buttons

A horizontal contact bar (Email, Telegram, Twitter) smoothly collapses into a small arrow button and expands back upon clicking.

See the Pen Expanding Buttons.

An animated button that morphs from a rectangle with text into a circle with a bouncing up arrow.

Up Arrow

A rectangular button smoothly shrinks into a circle, the text fades out, and an upward-pointing arrow begins to cyclically rise within it.

See the Pen Up Arrow.

Hover Effects

A dynamic hover effect in pure CSS, where the :has() pseudo-class triggers simultaneous animations: a slide-out tooltip and a smooth icon fill. The tooltip’s content is sourced from a data-tooltip attribute via attr(), and the fill color is flexibly configured with a --bg CSS Custom Property.

See the Pen Hover Effects.

Animated Ghost Button

An orchestrated pure CSS morphing button. On hover, complex transition timings compress, rotate, and round the button into a floating ghost silhouette via border-radius: 50%. Scaled radial-gradient circles emerge to form its eyes and mouth, while pseudo-elements float the text “boo” and project a soft, floating under-shadow.

See the Pen Animated Ghost Button.

Animated Ghost Button 2

The button features a complex, non-linear hover effect powered by a cubic-bezier transition curve and CSS transform: translate3d applied to the inner .mask element, creating a sweeping diagonal light wipe effect.

See the Pen Animated Ghost Button 2.

Ghost Button Animation

This SASS component defines two aesthetically consistent styles (.bttn and .bttn-dark) using centralized color variables and implements a distinctive “slide-out” hover effect by animating the ::before pseudo-element’s left and right properties from 50% to 0.

See the Pen Ghost Button Animation.

Gradient Hover Animated Ghost Button

The button animation uses SVG rect elements and CSS stroke-dasharray and stroke-dashoffset properties to create a sophisticated, drawing border effect that transitions smoothly on hover, highlighting the call-to-action.

Liquid Fill Buttons

Creative Splatoon-inspired buttons featuring a liquid fill animation achieved with pure CSS and SCSS. The component leverages SCSS loops for automated color variations via hue-rotate and a smooth background-position transition to create an interactive ink-filling effect on hover.

See the Pen Liquid Fill Buttons.

SVG Button Hover Effect With Snap.svg

SVG Button Hover Effect With Snap.svg

An advanced SVG button built with Snap.svg featuring interactive mask transformations and vibrant gradient fill effects. The script dynamically replaces standard HTML buttons with animated SVG nodes, delivering smooth text and border transitions through complex path manipulation and high-performance JavaScript animations.

Ghost Button

A collection of three interactive buttons built with SCSS, utilizing pseudo-elements to create unique hover effects. The set features border expansion animations, text swapping with smooth background transitions, and futuristic corner-border effects, providing ready-to-use solutions for high-impact call-to-action elements.

See the Pen Ghost Button.

Line & Direction

A collection of interactive CSS buttons featuring a unique segmented background-fill animation on hover. The component utilizes cascading transition-delay and CSS transforms to create a smooth, staggered effect, offering six distinct visual styles easily customizable via CSS variables and nth-child selectors.

See the Pen Line & Direction.

Pure CSS Ghost Buttons with Directional Awareness

Direction-aware Brutalist buttons featuring a unique hover effect implemented with pure CSS using clip-path polygons. The component offers extensive customization via CSS variables and provides responsive background-fill animations that react to the cursor’s entry direction.

Pixel Button Hover Animation Effects

A retro-inspired button showcasing a pixelated dissolve hover effect. Upon hover, the outline border vanishes while a tiled spritesheet image is loaded. An @keyframes rule transitions background-position-y using the steps(8) timing function to produce a crisp, looping 8-frame pixelated explosion animation.

3 Techniques: Candy Ghost Buttons

3 Techniques: Candy Ghost Buttons

Three experimental CSS techniques to render candy ghost buttons featuring unified gradient text and borders. The demos leverage advanced compositing methods including mask-composite: exclude, background-clip: text, and clip-path wrappers to clip non-standard border-image curves without any JavaScript.

Frequently Asked Questions

How do I create a ghost button with a smooth fill transition on hover?

Use a ::before pseudo-element with transform: scaleX(0) and transform-origin: left as the base state, transitioning to scaleX(1) on :hover. The pseudo-element fills from left to right behind the text while the border color transitions via CSS transition.

Why does the text need a subtle text-shadow on ghost button hover?

Ghost buttons have transparent backgrounds in the idle state, so the text is rendered directly on the page background. On hover, a text-shadow with the button’s fill color prevents the text from appearing to float or lose contrast during the border-to-fill transition.

How should ghost buttons handle accessibility for keyboard users?

Always use a <button> element with :focus-visible outline that remains visible against both the idle transparent background and the hover fill state. Use outline-offset to prevent the focus ring from clipping against the button border.

How do I make ghost buttons responsive to different container sizes?

Set border-width, padding, and font-size using clamp() with relative units. For the fill pseudo-element, use percentage-based dimensions so it scales proportionally with the button size across viewports.