Skip to content

Stamp Button

A raised rubber-stamp button leaves a fading outline when pressed.

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 StampButton from "./StampButton";
export default function Example() {
return (
<StampButton
children={"Make your mark"}
color={"#c7755d"}
background={"#231917"}
disabled={false}
/>
);
}

Using Stamp Button

Pass the action label through children and connect onClick to your action. Use type="submit" when placing the button inside a form.

The imprint replays on pointer and keyboard activation. Choose an ink colour with sufficient contrast against the face, and use disabled while an action is unavailable.

Props

NameTypeRequiredDefaultDescription
childrenReactNodeNoundefinedButton label or icon.
colorstringNo"#c7755d"Ink, border and focus colour.
backgroundstringNo"#231917"Button face colour.
disabledbooleanNofalseDisable interaction.
type"button" | "submit" | "reset"No"button"Native button type.
onClickfunctionNoundefinedNative click callback.
...restButtonHTMLAttributesNoundefinedOther native button attributes, including aria-label and form.
classNamestringNo""Additional classes on the root element.
styleCSSPropertiesNoundefinedInline styles for sizing, typography and appearance.

Related components

An action label contracts into a circular loader and resolves to a checkmark.

Alternating shutters close into a solid button face on hover or focus.

A sculpted keycap compresses into its base with a satisfying press.

A clipped corner floods the button with colour as its arrow turns.