01 — Toggles

Heart Like Button

A classic social-media style "like" button. Click to toggle — the heart fills red and pops with a scale animation. Built with a hidden checkbox + :checked selector, so no JavaScript is needed.

checkbox hack + transform keyframes TOGGLE
<span class="heart-wrap">
  <input type="checkbox" id="heart1"/>
  <label for="heart1">
    <svg class="heart" viewBox="0 0 24 24">
      <path d="M12 21s-7-4.5-9.5-9C1 9 2 5 5.5 5
               c2 0 3.5 1 4.5 2.5 1-1.5 2.5-2.5 4.5-2.5
               3.5 0 4.5 4 3 7-2.5 4.5-9.5 9-9.5 9z"/>
    </svg>
  </label>
</span>
02 — Toggles

Toggle Switch

iOS-style on/off switch. The thumb slides to the right and the track changes color when checked. The cubic-bezier easing gives it a satisfying bounce.

checkbox + translateX with spring easing TOGGLE
<label class="switch">
  <input type="checkbox"/>
  <span class="track"></span>
  <span class="thumb"></span>
</label>
03 — Toggles

Animated Checkbox

A custom checkbox where the tick is an SVG path that draws itself in. Uses stroke-dasharray + stroke-dashoffset — a trick for animating any SVG shape.

SVG stroke-dashoffset animation TOGGLE
<label class="check-box">
  <input type="checkbox"/>
  <span class="box">
    <svg class="tick" viewBox="0 0 14 14">
      <polyline points="1.5 7 6 11 13 3"/>
    </svg>
  </span>
  <span>I agree to the terms</span>
</label>
04 — Toggles

Hamburger → X

Three bars that morph into a close (X) icon when clicked. The middle bar fades out; the top and bottom bars rotate to form the X.

3 bars + rotate + translate TOGGLE
<label class="burger">
  <input type="checkbox"/>
  <span class="line top"></span>
  <span class="line mid"></span>
  <span class="line bot"></span>
</label>
05 — Feedback

Click Ripple

Material-style ripple that expands from the center when the button is pressed. Uses an absolutely-positioned ::after circle that scales up via a keyframe animation.

::after + @keyframes on :active FEEDBACK
<button class="ripple-btn">Click me</button>
06 — Feedback

Success Checkmark

A celebratory state for form submissions or finished tasks — the circle pops into view and the check is drawn in. Useful at the end of a sign-up flow or after a save.

scale pop + SVG stroke draw FEEDBACK
<div class="success">
  <div class="circle">
    <svg viewBox="0 0 24 24">
      <polyline points="4 12 10 18 20 6"/>
    </svg>
  </div>
</div>
07 — Feedback

Progress Bar

An animated striped progress bar showing ongoing work. The stripes are built with a linear-gradient at a 45° angle and continuously shift position.

diagonal gradient + background-position shift FEEDBACK
<div class="progress">
  <div class="fill"></div>
</div>
08 — Feedback

Skeleton Loader

Placeholder blocks with a shimmer effect shown while real content loads. The shimmer is an animated linear-gradient sliding across each block.

shimmer keyframes on background-position FEEDBACK
<div class="skeleton">
  <div class="line block"></div>
  <div class="line"></div>
  <div class="line"></div>
  <div class="line short"></div>
</div>
09 — Controls

Floating Label Input

The label starts centered inside the input. When focused or filled, it floats up and shrinks — giving you a compact label that never overlaps the value. Uses :placeholder-shown to detect whether the field is empty.

:focus + :placeholder-shown + transform CONTROL
<div class="float-group">
  <!-- IMPORTANT: placeholder must be a single space -->
  <input type="email" id="email1" placeholder=" "/>
  <label for="email1">Email address</label>
</div>
10 — Controls

Radio Card Group

Pricing plans, shipping options, avatars — anywhere you'd pick one of a few. The selected card gets a colored border and glow via :has(input:checked).

:has(input:checked) for parent styling CONTROL
<div class="radio-cards">
  <label>
    <input type="radio" name="plan"/>
    Starter <small>Free forever</small>
  </label>
  <label>
    <input type="radio" name="plan" checked/>
    Pro <small>$12 / month</small>
  </label>
  <label>
    <input type="radio" name="plan"/>
    Team <small>$29 / month</small>
  </label>
</div>
11 — Navigation

Arrow Link

A text link where the arrow nudges to the right on hover while the gap opens up. Subtle but compelling — common in editorial "Read more" links.

inline-flex gap + translateX on arrow NAV
<a href="#" class="arrow-link">
  Read the article
  <span class="arrow">→</span>
</a>
12 — Navigation

Tooltip on Hover

A pop-up bubble with extra information, shown on hover. The tooltip text lives in a data-tip attribute so no extra HTML is needed — just content: attr(data-tip).

::before with content: attr() + opacity NAV
auto-save password team slug
<span class="tip" data-tip="Saved just now">auto-save</span>