Button Library · Signature
Envelope
The flap lifts and a letter rises out on hover.
States
Default
Hover
Active
Focus
Code
sig-envelope.html
<button class="btn-sig-envelope" type="button"> <span class="btn-sig-envelope__letter" aria-hidden="true"></span> <span class="btn-sig-envelope__body">Send it</span> <span class="btn-sig-envelope__flap" aria-hidden="true"></span> </button>
sig-envelope.css
.btn-sig-envelope {
--btn-bg: #ff8a5c;
--btn-fg: #26252c;
--btn-font: inherit;
--btn-size: 15px;
--btn-weight: 600;
--btn-px: 22px;
--btn-py: 11px;
--btn-w: auto;
--btn-h: auto;
--btn-bw: 0px;
--btn-line: #8b6cff;
--btn-radius: 6px;
--btn-shadow: none;
--btn-speed: 260ms;
}
.btn-sig-envelope {
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;
isolation: isolate;
perspective: 500px;
}
.btn-sig-envelope:focus-visible {
outline: 2px solid var(--btn-bg);
outline-offset: 2px;
}
.btn-sig-envelope:disabled {
opacity: 0.5;
pointer-events: none;
}
.btn-sig-envelope__icon {
width: 1.15em;
height: 1.15em;
flex-shrink: 0;
}
.btn-sig-envelope:hover {
--rise: -26px;
--open: 180deg;
--layer: 0;
}
.btn-sig-envelope__letter {
position: absolute;
top: 6px;
left: 10%;
right: 10%;
height: 70%;
z-index: 1;
background: repeating-linear-gradient(180deg, transparent 0 6px, #d9d9e3 6px 8px) 8px 8px / calc(100% - 16px) 100% no-repeat, #ffffff;
border-radius: 3px;
transform: translateY(var(--rise, 0));
transition: transform var(--btn-speed) ease;
}
.btn-sig-envelope__body {
position: relative;
z-index: 2;
padding: calc(var(--btn-py) + 18px) calc(var(--btn-px) + 8px) var(--btn-py);
background: var(--btn-bg);
border-radius: var(--btn-radius);
}
.btn-sig-envelope__flap {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 28px;
z-index: var(--layer, 3);
background: color-mix(in srgb, var(--btn-bg) 82%, #000);
clip-path: polygon(0 0, 100% 0, 50% 100%);
transform-origin: 50% 0;
transform: rotateX(var(--open, 0deg));
transition: transform var(--btn-speed) ease, z-index 0s calc(var(--btn-speed) / 2);
}
@media (prefers-reduced-motion: reduce) {
.btn-sig-envelope,
.btn-sig-envelope__letter,
.btn-sig-envelope__flap {
animation: none !important;
transition: none !important;
}
}
sig-envelope.js
// No JavaScript needed: this one is CSS only.
sig-envelope.tsx
import type React from "react";
import "./sig-envelope.css"; // the CSS tab
export function BtnSigEnvelope({ children = "Send it", ...props }: React.ComponentProps<"button">) {
return (
<button className="btn-sig-envelope" type="button" {...props}>
<span className="btn-sig-envelope__letter" aria-hidden="true" />
<span className="btn-sig-envelope__body">{children}</span>
<span className="btn-sig-envelope__flap" aria-hidden="true" />
</button>
);
}
sig-envelope.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-[600] [line-height:1.2] text-[#26252c] [background:transparent] [border:0px_solid_#8b6cff] rounded-[6px] [box-shadow:none] cursor-pointer no-underline whitespace-nowrap [transition:all_260ms_ease] isolate [perspective:500px] focus-visible:[outline:2px_solid_#ff8a5c] focus-visible:[outline-offset:2px] disabled:[opacity:0.5] disabled:[pointer-events:none] hover:[--rise:-26px] hover:[--open:180deg] hover:[--layer:0] motion-reduce:[transition:none!important]" type="button"> <span class="absolute [top:6px] [left:10%] [right:10%] h-[70%] [z-index:1] [background:repeating-linear-gradient(180deg,_transparent_0_6px,_#d9d9e3_6px_8px)_8px_8px_/_calc(100%_-_16px)_100%_no-repeat,_#ffffff] rounded-[3px] [transform:translateY(var(--rise,_0))] [transition:transform_260ms_ease] motion-reduce:[transition:none!important]" aria-hidden="true"></span> <span class="relative [z-index:2] [padding:calc(11px_+_18px)_calc(22px_+_8px)_11px] bg-[#ff8a5c] rounded-[6px]">Send it</span> <span class="absolute [top:0] [left:0] [right:0] h-[28px] [z-index:var(--layer,_3)] [background:color-mix(in_srgb,_#ff8a5c_82%,_#000)] [clip-path:polygon(0_0,_100%_0,_50%_100%)] [transform-origin:50%_0] [transform:rotateX(var(--open,_0deg))] [transition:transform_260ms_ease,_z-index_0s_calc(260ms_/_2)] motion-reduce:[transition:none!important]" aria-hidden="true"></span> </button>