Skip to content

Shutter Button

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

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 ShutterButton from "./ShutterButton";
export default function Example() {
return (
<ShutterButton
children={"Explore the collection"}
color={"#d9bda5"}
background={"#27211d"}
textColor={"#f3e7dc"}
activeTextColor={"#26201b"}
shutters={6}
disabled={false}
/>
);
}

Using Shutter Button

Pass a meaningful action label through children and wire onClick to your action. The shutter effect also responds to keyboard focus.

Set textColor and activeTextColor for their respective surfaces. Use type="submit" for form actions and disabled when the action is unavailable.

Props

NameTypeRequiredDefaultDescription
childrenReactNodeNoundefinedAction label or custom content.
colorstringNo"#d9bda5"Shutter fill and focus colour.
backgroundstringNo"#27211d"Resting background colour.
textColorstringNo"#f3e7dc"Resting text colour.
activeTextColorstringNo"#26201b"Text colour over the shutter fill.
shuttersnumberNo6Number of animated panels, from 2 to 12.
disabledbooleanNofalseDisable the native button.
onClickfunctionNoundefinedNative click handler.
type"button" | "submit" | "reset"No"button"Native button type.
...restButtonHTMLAttributesNoundefinedAdditional native attributes such as 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.

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

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

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