Reactor Button

A button that reacts when you press it: a quick strike, or a press-and-hold to confirm with a charging bar.

  • <kt-reactor-button>
  • Actions
  • No framework

Reactor Button

Deploy BuildHold to ConfirmInspect

The code

Copy the Reactor Button

Fastest: press Copy on the card above for one complete file. To build it into your own project, use the files below: the markup, the styles, this component’s script and the shared effects script (effects.js) that every component uses.

<kt-reactor-button mode="strike" sfx="ドン!" tag="STRIKE">Deploy Build</kt-reactor-button>

<kt-reactor-button mode="hold" duration="850" sfx="ドカン!" tag="HOLD">Hold to Confirm</kt-reactor-button>

<kt-reactor-button mode="strike" tone="outline" sfx="カチッ!">Inspect</kt-reactor-button>

Attributes

NameWhat it doesDefault
mode"strike" fires on release; "hold" fires after you hold it.strike
durationMilliseconds to hold in hold mode (minimum 300).850
tone"solid" or "outline".solid
tagSmall label shown inside the button.—
sfxComic sound-effect text shown on impact when VFX text is on.ドン!

Keyboard and screen readers

  • A real button: focusable and announced as a button.
  • Space or Enter presses it; hold mode works with a held key.
  • Motion effects are skipped when the visitor prefers reduced motion.

Styling variables

Every look is a CSS variable: --kt-accent, --kt-accent-ink, --kt-radius-btn, --kt-surface-radius, --kt-surface-bg, --kt-border-w, --kt-comp-shadow and --font-sans. The copied file sets them all from your choices.

FAQ

Reactor Button: questions answered

How do I use the Reactor Button?

Press Copy on the card to get a complete HTML file, or copy the HTML, CSS and JavaScript tabs into your own page. In your markup the element is written as <kt-reactor-button>.

Which attributes does <kt-reactor-button> accept?

mode, duration, tone, tag, sfx. Each one is described in the attributes table on this page.

Is the Reactor Button accessible?

A real button: focusable and announced as a button. Space or Enter presses it; hold mode works with a held key. Motion effects are skipped when the visitor prefers reduced motion.

Can I change the Reactor Button colors, corners and font?

Yes. Use the options on this page: accent color, border radius, background, border, shadow and Google font. The copied code already contains your choices, and every one of them is a CSS variable you can edit later.