Button Library · Signature
Price Tag
Hangs by a string and swings when touched.
States
Default
Hover
Active
Focus
Code
sig-tag.html
<button class="btn-sig-tag" type="button"> <span class="btn-sig-tag__card">₹499 Buy</span> </button>
sig-tag.css
.btn-sig-tag {
--btn-bg: #ffd166;
--btn-fg: #26252c;
--btn-font: inherit;
--btn-size: 15px;
--btn-weight: 800;
--btn-px: 22px;
--btn-py: 11px;
--btn-w: auto;
--btn-h: auto;
--btn-bw: 0px;
--btn-line: #8b6cff;
--btn-radius: 10px;
--btn-shadow: none;
--btn-speed: 180ms;
}
.btn-sig-tag {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5em;
box-sizing: border-box;
width: var(--btn-w);
height: var(--btn-h);
padding: 0;
font-family: var(--btn-font);
font-size: var(--btn-size);
font-weight: var(--btn-weight);
line-height: 1.2;
color: var(--btn-fg);
background: transparent;
border: var(--btn-bw) solid var(--btn-line);
border-radius: var(--btn-radius);
box-shadow: var(--btn-shadow);
cursor: pointer;
text-decoration: none;
white-space: nowrap;
transition: all var(--btn-speed) ease;
margin-left: 26px;
transform-origin: 18px 50%;
}
.btn-sig-tag:focus-visible {
outline: 2px solid var(--btn-bg);
outline-offset: 2px;
}
.btn-sig-tag:disabled {
opacity: 0.5;
pointer-events: none;
}
.btn-sig-tag__icon {
width: 1.15em;
height: 1.15em;
flex-shrink: 0;
}
.btn-sig-tag::before {
content: "";
position: absolute;
top: calc(50% - 12px);
left: -24px;
width: 44px;
height: 12px;
border-top: 2px solid var(--btn-bg);
border-left: 2px solid var(--btn-bg);
border-radius: 16px 0 0 0;
}
.btn-sig-tag:hover {
animation: btn-tag 900ms ease;
}
.btn-sig-tag__card {
padding: var(--btn-py) var(--btn-px) var(--btn-py) 36px;
background: var(--btn-bg);
clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%);
mask: radial-gradient(circle 5px at 19px 50%, transparent 98%, #000);
}
@keyframes btn-tag {
0%, 100% { transform: rotate(0); }
25% { transform: rotate(-8deg); }
55% { transform: rotate(6deg); }
80% { transform: rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
.btn-sig-tag {
animation: none !important;
transition: none !important;
}
}
sig-tag.js
// No JavaScript needed: this one is CSS only.
sig-tag.tsx
import type React from "react";
import "./sig-tag.css"; // the CSS tab
export function BtnSigTag({ children = "₹499 Buy", ...props }: React.ComponentProps<"button">) {
return (
<button className="btn-sig-tag" type="button" {...props}>
<span className="btn-sig-tag__card">{children}</span>
</button>
);
}
sig-tag.html
<button class="relative inline-flex items-center justify-center gap-[0.5em] [box-sizing:border-box] [padding:0] [font-family:inherit] text-[15px] font-[800] [line-height:1.2] text-[#26252c] [background:transparent] [border:0px_solid_#8b6cff] rounded-[10px] [box-shadow:none] cursor-pointer no-underline whitespace-nowrap [transition:all_180ms_ease] [margin-left:26px] [transform-origin:18px_50%] focus-visible:[outline:2px_solid_#ffd166] focus-visible:[outline-offset:2px] disabled:[opacity:0.5] disabled:[pointer-events:none] before:content-[''] before:absolute before:[top:calc(50%_-_12px)] before:[left:-24px] before:w-[44px] before:h-[12px] before:[border-top:2px_solid_#ffd166] before:[border-left:2px_solid_#ffd166] before:rounded-[16px_0_0_0] hover:[animation:btn-tag_900ms_ease] motion-reduce:[animation:none!important] motion-reduce:[transition:none!important]" type="button">
<span class="[padding:11px_22px_11px_36px] bg-[#ffd166] [clip-path:polygon(16px_0,_100%_0,_100%_100%,_16px_100%,_0_50%)] [mask:radial-gradient(circle_5px_at_19px_50%,_transparent_98%,_#000)]">₹499 Buy</span>
</button>
<!-- A class cannot hold keyframes: keep this in your CSS. -->
<style>
@keyframes btn-tag {
0%, 100% { transform: rotate(0); }
25% { transform: rotate(-8deg); }
55% { transform: rotate(6deg); }
80% { transform: rotate(-3deg); }
}
</style>