Electric Shock Button
Button with electric spark/effect animation
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/electric-button.
<iframe src="/embed/electric-button" sandbox="allow-scripts" loading="lazy" title="Electric Shock Button" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Electric Shock Button, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.
HTML
<button class="electric-button">⚡ ELECTRIC</button>CSS
.electric-button {
position: relative;
padding: 1rem 2rem;
border-radius: 0.75rem;
background: linear-gradient(to right, #06b6d4, #2563eb);
color: white;
font-weight: bold;
border: none;
cursor: pointer;
overflow: hidden;
transition: all 0.3s ease;
animation: electric-glow 1.5s ease-in-out infinite;
}
.electric-button:hover {
transform: scale(1.05);
box-shadow: 0 0 30px #06b6d4, 0 0 60px #06b6d4;
}
.electric-button::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
animation: electric-shine 1s linear infinite;
}
@keyframes electric-glow {
0%, 100% { box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }
50% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.5); }
}
@keyframes electric-shine {
0% { left: -100%; }
100% { left: 100%; }
}LWC — HTML template
<template>
<button class="electric-button" onclick={handleClick}>
<slot>⚡ ELECTRIC</slot>
</button>
</template>LWC — JavaScript
import { LightningElement, api } from 'lwc';
export default class ElectricButton extends LightningElement {
@api label = '⚡ ELECTRIC';
handleClick() {
this.dispatchEvent(new CustomEvent('buttonclick', {
bubbles: true,
composed: true
}));
}
}LWC — CSS
.electric-button {
position: relative;
padding: 1rem 2rem;
border-radius: 0.75rem;
background: linear-gradient(to right, #06b6d4, #2563eb);
color: white;
font-weight: bold;
border: none;
cursor: pointer;
overflow: hidden;
transition: all 0.3s ease;
animation: electric-glow 1.5s ease-in-out infinite;
}
.electric-button:hover {
transform: scale(1.05);
box-shadow: 0 0 30px #06b6d4, 0 0 60px #06b6d4;
}
.electric-button::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
animation: electric-shine 1s linear infinite;
}
@keyframes electric-glow {
0%, 100% { box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }
50% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.5); }
}
@keyframes electric-shine {
0% { left: -100%; }
100% { left: 100%; }
}LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>Where Electric Shock Button fits
- Gaming
- Tech Sites
- Energy Products
- Interactive
Interaction states & animations
- Electric
- Spark
- Hover
Topics
- #electric
- #spark
- #tech
- #energy
- #gaming
- #shock
Accessibility notes
Provide reduced motion alternative. Ensure text remains readable.
Browser support
- All modern browsers