Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

Share Button

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By @Jacinth-Mahanta

Remix button

Button submission checks

Checks will appear after the preview updates.

Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.

Accessibility quick check

Waiting for the rendered preview…

Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.

Explore freely here. Remix to publish your version with credit to the creator.

About Share Button

Share Button is an animated CSS button by @Jacinth-Mahanta. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects, Toggle, Icon, Social
Using this example
Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.

Usage, Tailwind and licensing questions

Read the source files

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Share Button</title>
    <link rel="stylesheet" href="./style.css">
</head>
<body>
    <div class="menu">
        <div class="share">
            <ion-icon name="share-social"></ion-icon>
        </div>

        <li style = "--i:0; --clr:#c32aa3;">
            <a href="#">
                <ion-icon name="logo-instagram"></ion-icon>
            </a>
        </li>
        <li style = "--i:1; --clr:#25d366;">
            <a href="#">
                <ion-icon name="logo-whatsapp"></ion-icon>
            </a>
        </li>
        <li style = "--i:2; --clr:#333;">
            <a href="#">
                <ion-icon name="logo-github"></ion-icon>
            </a>
        </li>
        <li style = "--i:3; --clr:#ea4c89;">
            <a href="#">
                <ion-icon name="logo-dribbble"></ion-icon>
            </a>
        </li>
        <li style = "--i:4; --clr:#0a66c2;">
            <a href="#">
                <ion-icon name="logo-linkedin"></ion-icon>
            </a>
        </li>
        <li style = "--i:5; --clr:#1877f2;">
            <a href="#">
                <ion-icon name="logo-facebook"></ion-icon>
            </a>
        </li>
        <li style = "--i:6; --clr:#bd081c;">
            <a href="#">
                <ion-icon name="logo-youtube"></ion-icon>
            </a>
        </li>
        <li style = "--i:7; --clr:#053eff;">
            <a href="#">
                <ion-icon name="logo-behance"></ion-icon>
            </a>
        </li>

    </div>
    
    <script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
    <script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
    <script src="./script.js"></script>
</body>
</html>

CSS


*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(45deg, #9ad751, #2196f3);
}

.menu{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 280px;
    height: 280px;
}

.menu .share{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.15);
    color: #333;
    cursor: pointer;
    font-size: 2em;
    transition: 1.2s;
}

.menu.active .share{
    transform: rotate(360deg);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15), 0 0 0 2px #333, 0 0 0 8px #fff;
}

.menu li{
    position: absolute;
    left: 0;
    list-style: none;
    transition: 0.5s;
    transform: rotate(calc(360deg/8 * var(--i)));
    transform-origin: 140px;
    scale:0;
}

.menu.active li{
    scale: 1;
}

.menu li a{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(calc(360deg/-8 * var(--i)));
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    font-size: 1.78em;
    color: var(--clr);
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.15);
    transition: 0.5s;
}

.menu li:hover a{
    font-size: 2.5em;
    box-shadow: 0 0 0 2px var(--clr), 0 0 0 6px #fff;
}

JavaScript

let share = document.querySelector('.share');
let menu = document.querySelector('.menu');
share.onclick = function(){
    menu.classList.toggle('active')
};