Skip to content

Envelope Card

A paper flap lifts in 3D as a message slides out of its envelope.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import EnvelopeCard from "./EnvelopeCard";
export default function Example() {
return (
<EnvelopeCard
children={"A note for you.\n\nMake something\nworth keeping."}
defaultOpen={true}
label={"Open envelope"}
closeLabel={"Close envelope"}
color={"#b8a38d"}
paperColor={"#eee5d7"}
inkColor={"#43372d"}
sealColor={"#8d5b50"}
/>
);
}

Using Envelope Card

Pass the message through children and open the envelope with its seal button. Use open and onOpenChange when another part of the page should control it.

Keep the letter concise, or let its content scroll within the reserved letter height. Closed content is inert and hidden from assistive technology, and reduced motion removes the flap and slide transitions.

Props

NameTypeRequiredDefaultDescription
childrenReactNodeNoundefinedYour message or letter content.
openbooleanNoundefinedControlled open state.
defaultOpenbooleanNofalseInitial uncontrolled open state.
onOpenChangefunctionNoundefinedReceives the requested open state.
labelstringNo"Open envelope"Closed-state button label.
closeLabelstringNo"Close envelope"Open-state button label.
colorstringNo"#b8a38d"Envelope paper colour.
paperColorstringNo"#eee5d7"Letter surface colour.
inkColorstringNo"#43372d"Letter text and focus colour.
sealColorstringNo"#8d5b50"Seal colour.
classNamestringNo""Additional classes on the root element.
styleCSSPropertiesNoundefinedInline styles for sizing, typography and appearance.

Related components

A lightly textured receipt pairs precise item rows with a torn paper edge.

A suspended badge swings naturally after you drag and release its handle.

Fine metallic grooves catch a shifting iridescent pointer highlight.

A precision-cut card with chamfered corners and a folded accent.