Keycap Press

Keycaps rise in 3D and press as a shortcut chord, then a line of text writes in below. A free, MIT-licensed Remotion UI block.

Installation
$ pnpm dlx shadcn@latest add @remocn/keycap-press

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { KeycapPress } from "@/components/remocn/keycap-press";
 
const KeycapPressScene = () => (
  <KeycapPress
    keys={[{ label: "⌘", sub: "command", width: 1.25 }, { label: "K" }]}
    label="Everything, one shortcut away"
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="KeycapPress"
    component={KeycapPressScene}
    durationInFrames={270}
    fps={60}
    width={1280}
    height={720}
  />
);

Keycaps rise into a tilted 3D view, press one after another as a chord with a ripple, then lift while the label writes in below. Pass your own keys as strings or objects with a legend, a sub label and a width. material sets the keycap finish and theme the stage; the symbols for command, option and shift are drawn as icons.

The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.

Props15

PropTypeDefault
keys
(string | { label: string; sub?: string; width?: number })[]DEFAULT_KEYS

Keys in the chord. Strings or objects with a label, sub caption and width.

label
string"Everything, one shortcut away"

Line of text written in under the keys.

material
"dark" | "light""dark"

Keycap finish, dark or light.

theme
"dark" | "light"—

Stage look, dark or light. Defaults to the material.

accent
string"#3B5BFD"

Color of the press ripple.

stagger
number3

Frames between words as the label writes in.

glow
number1

Strength of the accent underglow beneath the keys, from 0 to 1.

ground
GshPresetId—

Shader preset id for the animated background.

groundParams
Partial<GradientParams>—

Partial shader parameters that override the ground preset.

background
string—

Solid fill in place of the gradient ground; pass "transparent" to drop it.

ink
string—

Text color; overrides the theme ink.

fontFamily
string"Bricolage Grotesque"

Typeface for the copy. Load the font in your project first.

scale
number1

Size of the foreground around the frame's center; the background stays put.

delay
number0

Frames to hold the first frame before anything moves.

speed
number1

Playback speed multiplier for the whole timeline.

  • keys(string | { label: string; sub?: string; width?: number })[]

    Keys in the chord. Strings or objects with a label, sub caption and width.

    DefaultDEFAULT_KEYS

  • labelstring

    Line of text written in under the keys.

    Default"Everything, one shortcut away"

  • material"dark" | "light"

    Keycap finish, dark or light.

    Default"dark"

  • theme"dark" | "light"

    Stage look, dark or light. Defaults to the material.

  • accentstring

    Color of the press ripple.

    Default"#3B5BFD"

  • staggernumber

    Frames between words as the label writes in.

    Default3

  • glownumber

    Strength of the accent underglow beneath the keys, from 0 to 1.

    Default1

  • groundGshPresetId

    Shader preset id for the animated background.

  • groundParamsPartial<GradientParams>

    Partial shader parameters that override the ground preset.

  • backgroundstring

    Solid fill in place of the gradient ground; pass "transparent" to drop it.

  • inkstring

    Text color; overrides the theme ink.

  • fontFamilystring

    Typeface for the copy. Load the font in your project first.

    Default"Bricolage Grotesque"

  • scalenumber

    Size of the foreground around the frame's center; the background stays put.

    Default1

  • delaynumber

    Frames to hold the first frame before anything moves.

    Default0

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1