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.
<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>
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.
<label class="switch"> <input type="checkbox"/> <span class="track"></span> <span class="thumb"></span> </label>
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.
<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>
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.
<label class="burger"> <input type="checkbox"/> <span class="line top"></span> <span class="line mid"></span> <span class="line bot"></span> </label>
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.
<button class="ripple-btn">Click me</button>
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.
<div class="success">
<div class="circle">
<svg viewBox="0 0 24 24">
<polyline points="4 12 10 18 20 6"/>
</svg>
</div>
</div>
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.
<div class="progress"> <div class="fill"></div> </div>
Skeleton Loader
Placeholder blocks with a shimmer effect shown while real content loads. The shimmer is an animated linear-gradient sliding across each block.
<div class="skeleton"> <div class="line block"></div> <div class="line"></div> <div class="line"></div> <div class="line short"></div> </div>
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.
<div class="float-group"> <!-- IMPORTANT: placeholder must be a single space --> <input type="email" id="email1" placeholder=" "/> <label for="email1">Email address</label> </div>
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).
<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>
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.
<a href="#" class="arrow-link"> Read the article <span class="arrow">→</span> </a>
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).
<span class="tip" data-tip="Saved just now">auto-save</span>