Kodza

Add to Cart

Add-to-cart button that confirms with a tick while a copy of the product picture flies into the cart icon and its count rolls up by one. Rolls back if the request fails.

Buttons No dependencies buttoncartecommercecounterwoocommerce Added Oct 2026
/anim/add-to-cart/ GitHub Fullscreen

With your AI

Just ask.

Say it to your AI. It gets the exact code below, not its best guess, and knows where it goes.

Add the Kodza Add to Cart to my page.

Not plugged in yet?
claude mcp add -t http kodza https://kodza.dev/api/mcp
Also in Codex, Cursor and VS Code.
kodza-add-to-cart.html
<a class="kodza-add-to-cart__cart" href="/cart/" aria-label="Cart, 0 items" data-count="0">
  <svg class="kodza-add-to-cart__bag" viewBox="0 0 24 24" aria-hidden="true"><path d="M5.2 8.2h13.6l-1 11a2 2 0 0 1-2 1.8H8.2a2 2 0 0 1-2-1.8z" /><path d="M9 8.2V6.8a3 3 0 0 1 6 0v1.4" /></svg>
  <span class="kodza-add-to-cart__count" aria-hidden="true">0</span>
</a>

<button class="kodza-add-to-cart" type="button">
  <span class="kodza-add-to-cart__label">
    <span>Add to cart</span>
    <span aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M6 12.5l4 4 8-9" pathLength="1" /></svg>Added</span>
    <span aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.5" /><path d="M12 7.8v5" /><path d="M12 16.2v.01" /></svg>Try again</span>
  </span>
</button>

Checked

Checked before you paste.

Robots poked at it before you did. Every component goes through the same checks, and again each time it changes.

What ranLast run
Accessibilityaxe-core 4.10.2: the WCAG 2.1 A and AA rules, plus best practices. 0 issues
KeyboardThe Tab key gets there, and the focus ring shows when it does. Passed
Reduced motionTurn on reduced motion and what moved just appears. Nothing loops. Passed
Light and darkThe same checks on both themes, contrast included. Passed
WordPressPasted into Twenty Twenty-Five, Twenty Twenty-One, Astra, Blocksy, GeneratePress, Hello Elementor, Kadence and OceanWP. Nothing to flag. 8 / 8 themes
Robots checked this. A human with VoiceOver hasn't yet.
KeyboardPress them in the preview
On the button
  • Adds the product, the picture flies to the cartEnter/Space

More like this

More in Buttons