UI Components snippets

CSS UI component snippets: buttons, forms, navigation, cards, tooltips, and more. Every snippet includes a live demo, copyable CSS, and an LLM-ready prompt.

Widely supported

CSS accordion

details/summary styled accordion, no JS.

no-js
Widely supported

Avatar stack

Overlapping circular avatars using negative margins and z-index stacking.

layout
Widely supported

Breadcrumb navigation

A breadcrumb navigation with CSS flexbox and pseudo-element separators.

layout
Widely supported

CSS-only toggle

Checkbox-driven toggle switch with no JavaScript.

no-js
Widely supported

:has() dropdown

Style a parent when a child is open using :has().

no-js
Widely supported

Styled text input

A polished text input with focus-visible state, placeholder, and oklch colors.

Widely supported

Pricing card

A pricing tier card with a highlighted popular option using scale transform and oklch accent colors.

Widely supported

Primary button

Production-ready primary button with hover, focus, active, and disabled states.

Widely supported

Progress bar

A styled progress element with animated fill using pseudo-elements and an accent-color fallback.

animation
Widely supported

Tag cloud / chip group

A flex-wrap tag cloud with consistent chip styling using oklch colors.

layout
Widely supported

CSS tooltip

A pure CSS tooltip using ::after and attr() that appears on hover with a smooth transition.

no-js
Widely supported

Top navigation bar

Responsive top nav with logo, links, and sticky positioning.

layout