Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
Poonam-13's button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By @Poonam-13
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 Poonam-13's button
Poonam-13's button is an animated CSS button by @Poonam-13. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects, Icon
- 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">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<svg width="25%" height="25%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" tabindex="0">
<rect class="buttonSides" x="5.04999" y="51" width="90.62" height="8" fill="#763AC2" />
<rect class="buttonSides" width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 59)" fill="#763AC2" />
<g clip-path="url(#clip0_106_11)">
<rect class="buttonTop" width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 51)" fill="#A661FF" />
<path class="buttonSides playSides" d="M64.2199 42.5L55.4353 61.4282L31.4353 47.5718L64.2199 42.5Z" fill="#763AC2" />
<g class="glowAll" filter="url(#filter0_d_106_11)">
<path d="M64.2199 42.5L55.4353 61.4282L31.4353 47.5718L64.2199 42.5Z" fill="white" />
</g>
<g class="glowMe" opacity="0.5" filter="url(#filter1_f_106_11)">
<path d="M73.0478 36.9032L58.6665 67.8905L19.3761 45.2062L73.0478 36.9032Z" fill="white" />
</g>
</g>
<path class="glowMe" opacity="0.5" d="M64 43L32 47.8L32 8L64 8L64 43Z" fill="url(#paint0_linear_106_11)" />
<defs>
<filter id="filter0_d_106_11" x="23.4353" y="34.5" width="48.7846" height="34.9282" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
<feOffset />
<feGaussianBlur stdDeviation="4" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0" />
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_106_11" />
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_106_11" result="shape" />
</filter>
<filter id="filter1_f_106_11" x="3.37613" y="20.9032" width="85.6716" height="62.9873" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feGaussianBlur stdDeviation="8" result="effect1_foregroundBlur_106_11" />
</filter>
<linearGradient id="paint0_linear_106_11" x1="47" y1="48" x2="47" y2="8" gradientUnits="userSpaceOnUse">
<stop stop-color="white" />
<stop offset="1" stop-color="white" stop-opacity="0" />
</linearGradient>
<clipPath id="clip0_106_11">
<rect width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 51)" fill="white" />
</clipPath>
</defs>
</svg>
<svg width="25%" height="25%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" tabindex="0">
<rect class="buttonSides" x="5.04999" y="51" width="90.62" height="8" fill="#763AC2" />
<rect class="buttonSides" width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 59)" fill="#763AC2" />
<g clip-path="url(#clip0_106_11)">
<rect class="buttonTop" width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 51)" fill="#A661FF" />
<path class="buttonSides playSides" d="M64.2199 42.5L55.4353 61.4282L31.4353 47.5718L64.2199 42.5Z" fill="#763AC2" />
<g class="glowAll" filter="url(#filter0_d_106_11)">
<path d="M64.2199 42.5L55.4353 61.4282L31.4353 47.5718L64.2199 42.5Z" fill="white" />
</g>
<g class="glowMe" opacity="0.5" filter="url(#filter1_f_106_11)">
<path d="M73.0478 36.9032L58.6665 67.8905L19.3761 45.2062L73.0478 36.9032Z" fill="white" />
</g>
</g>
<path class="glowMe" opacity="0.5" d="M64 43L32 47.8L32 8L64 8L64 43Z" fill="url(#paint0_linear_106_11)" />
<defs>
<filter id="filter0_d_106_11" x="23.4353" y="34.5" width="48.7846" height="34.9282" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
<feOffset />
<feGaussianBlur stdDeviation="4" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0" />
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_106_11" />
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_106_11" result="shape" />
</filter>
<filter id="filter1_f_106_11" x="3.37613" y="20.9032" width="85.6716" height="62.9873" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feGaussianBlur stdDeviation="8" result="effect1_foregroundBlur_106_11" />
</filter>
<linearGradient id="paint0_linear_106_11" x1="47" y1="48" x2="47" y2="8" gradientUnits="userSpaceOnUse">
<stop stop-color="white" />
<stop offset="1" stop-color="white" stop-opacity="0" />
</linearGradient>
<clipPath id="clip0_106_11">
<rect width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 51)" fill="white" />
</clipPath>
</defs>
</svg>
<svg width="25%" height="25%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" tabindex="0">
<rect class="buttonSides" x="5.04999" y="51" width="90.62" height="8" fill="#763AC2" />
<rect class="buttonSides" width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 59)" fill="#763AC2" />
<g clip-path="url(#clip0_106_11)">
<rect class="buttonTop" width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 51)" fill="#A661FF" />
<path class="buttonSides playSides" d="M64.2199 42.5L55.4353 61.4282L31.4353 47.5718L64.2199 42.5Z" fill="#763AC2" />
<g class="glowAll" filter="url(#filter0_d_106_11)">
<path d="M64.2199 42.5L55.4353 61.4282L31.4353 47.5718L64.2199 42.5Z" fill="white" />
</g>
<g class="glowMe" opacity="0.5" filter="url(#filter1_f_106_11)">
<path d="M73.0478 36.9032L58.6665 67.8905L19.3761 45.2062L73.0478 36.9032Z" fill="white" />
</g>
</g>
<path class="glowMe" opacity="0.5" d="M64 43L32 47.8L32 8L64 8L64 43Z" fill="url(#paint0_linear_106_11)" />
<defs>
<filter id="filter0_d_106_11" x="23.4353" y="34.5" width="48.7846" height="34.9282" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
<feOffset />
<feGaussianBlur stdDeviation="4" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0" />
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_106_11" />
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_106_11" result="shape" />
</filter>
<filter id="filter1_f_106_11" x="3.37613" y="20.9032" width="85.6716" height="62.9873" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feGaussianBlur stdDeviation="8" result="effect1_foregroundBlur_106_11" />
</filter>
<linearGradient id="paint0_linear_106_11" x1="47" y1="48" x2="47" y2="8" gradientUnits="userSpaceOnUse">
<stop stop-color="white" />
<stop offset="1" stop-color="white" stop-opacity="0" />
</linearGradient>
<clipPath id="clip0_106_11">
<rect width="57" height="57" rx="8" transform="matrix(0.866025 -0.5 0.866025 0.5 1 51)" fill="white" />
</clipPath>
</defs>
</svg>
</body>
</html>CSS
body {
position: absolute;
display: flex;
inset: 0;
align-items: center;
justify-content: center;
background-color: #000000;
}
.glowMe,
.glowAll {
opacity: 0;
transition: opacity 300ms linear 0s;
}
svg {
width: 30vw;
height: 30vw;
cursor: pointer;
}
svg:hover .glowMe {
opacity: 0.5;
}
svg:hover .glowAll {
opacity: 1;
}
.buttonTop {
fill: #5f309b;
transition: fill 300ms linear 0s;
}
svg:hover .buttonTop {
fill: #a661ff;
}
.buttonSides {
fill: #371b5b;
transition: fill 300ms linear 0s;
}
svg:hover .buttonSides {
fill: #763ac2;
}
svg:focus {
outline: none;
}
svg:focus .buttonTop,
svg:focus .playSides {
stroke: white;
stroke-width: 2px;
}
svg:focus .playSides {
stroke-width: 1px;
}
svg:active .buttonTop {
fill: #c79cff;
}
svg:nth-of-type(1) {
transform: translate(37%, -35%);
}
svg:nth-of-type(3) {
transform: translate(-37%, 35%);
}