Collection of free HTML button with vanilla JavaScript code examples: animated, multiple, confirm, delete, download/upload, submit and with hover/click/hold effects

Welcome to our collection of JavaScript examples! In this meticulously curated compilation, we have assembled a diverse range of JavaScript code snippets that showcase the flexibility and power of this dynamic programming language.

3D Button

Author:
Robin Delaporte | May 12, 2020
Made with:
HTML / CSS (SCSS) / JS (Babel)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
three.js, gsap.js

Thumbs Up Confetti

Author:
Aaron Iker | April 28, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Thumbs Up Button

Author:
Aaron Iker | April 23, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
gsap.js

Submit Button

Author:
Mikael Ainalem | April 22, 2020
Made with:
HTML / CSS / JS

About a code

An uncommon take on a submit button with a progress meter.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
anime.js

Donate Button Animation

Author:
Aaron Iker | April 20, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
simple-mask-money.js

Awful Buttons

Author:
Adam Kuhn | April 13, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
splitting.js

T-Shirt Cannon Button

Author:
Jhey | April 10, 2020
Made with:
HTML (Pug) / CSS (Stylus) / JS (Babel)

About a code

T-Shirt cannon button with GreenSock.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
splitting.js, gsap.js

Confirm Confetti Button

Author:
Aaron Iker | April 9, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Button Bending Hover

Author:
Aaron Iker | April 3, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Trash Button

Author:
Aaron Iker | March 30, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

Delete button with animated trash in vanilla JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Confetti Button

Author:
Cooper Goeke | March 24, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Unsubscribe Button

Author:
Ryan Mulligan | March 23, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

The pitfalls of trying to unsubscribe in 2020.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
splitting.css, splitting.js

Compress Files

Author:
Aaron Iker | March 20, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

Simple "File-Zipping" button micro-interaction.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Grid / List Toggle Buttons

Author:
Aaron Iker | March 18, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Delete Button Animation

Author:
Aaron Iker | March 15, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

Simple "Delete Button" micro-interaction in HTML, CSS and JS.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Download & Upload Hover Animations

Author:
Aaron Iker | March 12, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Smash To Submit Button

Author:
Aaron Iker | March 12, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Upload Button Hover

Author:
Aaron Iker | March 8, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Button Drawing Animation

Author:
Chris Smith | March 5, 2020
Made with:
CSS (SCSS) / JS

About a code

Animating pseudo elements to give the effect of drawing a button.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Button States Animations

Author:
Vlad Racoare | March 2, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
font-awesome.css

Beer Like Button

Author:
Aaron Iker | February 19, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Trash Button Animation

Author:
Aaron Iker | February 19, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Upload File Button

Author:
alphardex | February 16, 2020
Made with:
HTML / CSS (SCSS) / JS (TypeScript)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Button Popper

Author:
Louis Hoebregts | February 15, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

SMASH that Like Button

Author:
@keyframers | February 12, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

Favorite button, micro-Interaction in JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Neumorphism, Heartly

Author:
gitSushi | January 27, 2020
Made with:
HTML (Pug) / CSS (Sass) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Add To Cart Animation

Author:
Aaron Iker | January 23, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

A cool add to cart animation with JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Material Buttons

Author:
Gabriele Corti | January 23, 2020
Made with:
HTML / CSS / JS

About a code

Practice with custom properties, clip-path, pseudo elements and CSS as a whole to create a series of buttons inspired by the material UI. With just enough JavaScript to make mouse events extra special.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Download Progress Animation

Author:
Aaron Iker | January 21, 2020
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Multi Buttons

Author:
Cassandra | January 19, 2020
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
font-awesome.css

Order Button Animation

Author:
Aaron Iker | January 17, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

An animated order confirmation button with HTML, CSS and little JavaScript,

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Press and Hold Button

Author:
Gabriele Corti | January 12, 2020
Made with:
HTML / CSS / JS

About a code

Experiment with SVG syntax and CSS transitions to create a button allowing to open up three more options.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Processing Button

Author:
Aaron Iker | January 10, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

Micro-animations for a button which submits, processes and confirms the interaction.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Button + Canvas = Awesome

Author:
Tibix | January 9, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

Using the canvas element to bring your button hover effects to a new level! These are just a few examples using the same approach with particles, now imagine the endless possibilities!

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Dynamic Moving Pill-Button Background

Author:
Lucas Lang | January 7, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Multi-Buttons - Animals

Multi-Buttons - Animals

Author:
‹MAIKO/› | January 6, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
font-awesome.css

Multi-Button Pill

Author:
Lennart Hase | January 6, 2020
Made with:
HTML / CSS (SCSS) / JS (Babel)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
font-awesome.css

Neumorphic Buttons

Author:
Sikriti Dakua | December 30, 2019
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Bounce Download Button

Author:
Aaron Iker | December 23, 2019
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Download Button SVG CSS JS

Author:
Timothy Williams-Fowler | December 23, 2019
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Upload Buttons

Author:
Aaron Iker | December 12, 2019
Made with:
HTML / CSS (SCSS) / JS

About a code

Some upload animation buttons.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
gsap.js

Play & Pause Button

Author:
Aaron Iker | December 5, 2019
Made with:
HTML / CSS (SCSS) / JS

About a code

Play Button. Some playful experimentations.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Button Hover Effects

Author:
Aaron Iker | December 3, 2019
Made with:
HTML / CSS (SCSS) / JS

About a code

Some more relative simple button hover effects.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Download Interaction

Author:
Milan Raring | December 2, 2019
Made with:
HTML / CSS (SCSS) / JS

About a code

Cool download interaction in HTML, CSS and JS.

Compatible browsers:
Chrome, Edge, Opera, Safari
Responsive:
no
Dependencies:
-

Add / Remove Button

Author:
Aaron Iker | December 2, 2019
Made with:
HTML / CSS (SCSS) / JS

About a code

An add-to-button microinteraction exploration.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Button - Hold to Confirm

Author:
Aaron Iker | November 22, 2019
Made with:
HTML / CSS (SCSS) / JS

About a code

Trying another button type where an extra confirmation is needed - for example if you publish or delete something. You will need to press the button for nearly 2 seconds to success.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Rocket Launch Button

Author:
Aaron Iker | November 14, 2019
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Neumorphism Soft UI Buttons

Author:
Moustafa Jazzar | November 11, 2019
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Music Player Button

Author:
MrJ | October 4, 2019
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-
Easy Buttons for the Canvas with ZIMjs

Easy Buttons for the Canvas with ZIMjs

Author:
ZIM | August 9, 2018
Made with:
JS

About a code

Easy buttons with rollovers, backings, icons, toggle and wait states, patterns, tabs and more! ZIM provides JavaScript conveniences, components and controls for the Canvas and is powered by CreateJS with its solid Bitmap Object Model (BOM).

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
zim.js

Discover Our Extensive Snippet Library

This heading suggests that your website provides a wide variety of snippets across different technologies, encouraging users to explore and use these resources for their development projects.

HTML Snippets.

Explore a collection of HTML snippets designed to streamline your web development process. From basic structures to complex elements.

CSS Snippets.

Discover powerful CSS snippets that help you style your web pages with ease. Whether you need layout solutions, animations

JavaScript Snippets.

Enhance your website's interactivity with our JavaScript snippets. From DOM manipulation to advanced algorithms

Bootstrap Snippets.

Leverage the power of Bootstrap with our collection of snippets. Quickly integrate responsive design components

Tailwind Snippets.

Speed up your development process with Tailwind CSS snippets. These utility-first CSS snippets enable you to

jQuery Snippets.

Simplify your JavaScript development with jQuery snippets. Easily perform common tasks like event handling, animations

React Snippets.

Build robust, component-based user interfaces with our React snippets. From state management to lifecycle methods,

Vue Snippets.

Streamline Vue.js development with our collection of snippets for creating components, managing state, and handling events.

Ready to set your Brand ablaze?

Let's craft a visual identity that ignites passion and loyalty. ✨