Skip to content

Crystal Refraction Button

Polished crystal button that bends and refracts light with internal reflections and prism glow

Crystal Refraction Button

by FreeCsStyles Dev's

PremiumCrystal
🌐🎨⚛️💚🅰️🔥☁️
#crystal#refraction#glass#premium#luxury#shine#prism

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/crystal-refraction-button.

<iframe src="/embed/crystal-refraction-button" sandbox="allow-scripts" loading="lazy" title="Crystal Refraction Button" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Crystal Refraction 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="crystal-btn"><span>✦ CRYSTAL</span></button>
CSS
.crystal-btn {
  position: relative;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #1a1a2e, #2d1b69, #1a1a2e);
  color: #c4b5fd;
  border: 1px solid rgba(196,181,253,0.2);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 16px rgba(0,0,0,0.2);
}
.crystal-btn:hover { transform: scale(1.04); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 8px 32px rgba(0,0,0,0.3); }
.crystal-btn:active { transform: scale(0.96); }
.crystal-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: crystal-shine 2s linear infinite;
  pointer-events: none;
}
.crystal-btn::after {
  content: ''; position: absolute; inset: 0;
  clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
  background: linear-gradient(135deg, rgba(196,181,253,0.05), transparent);
  animation: crystal-glow 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes crystal-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes crystal-glow { 0%,100% { opacity: 0.3; } 50% { opacity: 0.6; } }
Tailwind CSS
<button class="px-8 py-4 rounded-lg font-semibold bg-gradient-to-br from-[#1a1a2e] via-[#2d1b69] to-[#1a1a2e] text-violet-300 border border-violet-300/20 shadow-[inset_0_1px_0_rgba(255,255,255,0.1),0_4px_16px_rgba(0,0,0,0.2)] hover:scale-104 active:scale-96 transition-all overflow-hidden relative">
  <span class="relative z-10">✦ CRYSTAL</span>
  <div class="absolute inset-0 bg-gradient-to-r from-transparent via-white/15 to-transparent pointer-events-none" style="animation: crystal-shine 2s linear infinite;" />
</button>
React
function CrystalButton() {
  return (
    <motion.button
      className="px-8 py-4 rounded-lg font-semibold relative overflow-hidden"
      style={{ background: 'linear-gradient(135deg, #1a1a2e, #2d1b69, #1a1a2e)', color: '#c4b5fd', border: '1px solid rgba(196,181,253,0.2)', cursor: 'pointer', boxShadow: 'inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 16px rgba(0,0,0,0.2)' }}
      whileHover={{ scale: 1.04, boxShadow: 'inset 0 1px 0 rgba(255,255,255,0.15), 0 8px 32px rgba(0,0,0,0.3)' }}
      whileTap={{ scale: 0.96 }}
    >
      <span style={{ position: 'relative', zIndex: 10 }}>✦ CRYSTAL</span>
      <motion.div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent)' }}
        animate={{ x: ['-100%', '100%'] }} transition={{ duration: 2, repeat: Infinity, ease: 'linear' }}
      />
    </motion.button>
  );
}
LWC — HTML template
<template><button class="crystal-btn" onclick={handleClick}><span style="position:relative;z-index:10"><slot>✦ CRYSTAL</slot></span></button></template>
LWC — JavaScript
import { LightningElement, api } from 'lwc';
export default class CrystalButton extends LightningElement {
  @api label = '✦ CRYSTAL';
  handleClick() { this.dispatchEvent(new CustomEvent('buttonclick', { bubbles: true, composed: true })); }
}
LWC — CSS
.crystal-btn { position: relative; padding: 1rem 2rem; border-radius: 0.5rem; font-weight: 600; background: linear-gradient(135deg, #1a1a2e, #2d1b69, #1a1a2e); color: #c4b5fd; border: 1px solid rgba(196,181,253,0.2); cursor: pointer; overflow: hidden; transition: all 0.3s ease; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 16px rgba(0,0,0,0.2); }
.crystal-btn:hover { transform: scale(1.04); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 8px 32px rgba(0,0,0,0.3); }
.crystal-btn:active { transform: scale(0.96); }
.crystal-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent); animation: crystal-shine 2s linear infinite; pointer-events: none; }
.crystal-btn::after { content: ''; position: absolute; inset: 0; clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%); background: linear-gradient(135deg, rgba(196,181,253,0.05), transparent); animation: crystal-glow 3s ease-in-out infinite; pointer-events: none; }
@keyframes crystal-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes crystal-glow { 0%,100% { opacity: 0.3; } 50% { opacity: 0.6; } }
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 Crystal Refraction Button fits

  • Luxury
  • Finance
  • Premium SaaS
  • High-end Products

Interaction states & animations

  • Shine
  • Refraction
  • Reflection Sweep
  • Prism Glow

Topics

  • #crystal
  • #refraction
  • #glass
  • #premium
  • #luxury
  • #shine
  • #prism

Accessibility notes

Ensure text contrast against the crystal background. Focus ring must be clearly visible.

Browser support

  • All modern browsers