Back to elements
Element•Premium

Squishy Toggle Button

A tactile checkbox button with layered highlights, soft depth, and a satisfying pressed state inspired by physical controls.

Overview

About the Squishy Toggle Button

A tactile checkbox button with layered highlights, soft depth, and a satisfying pressed state inspired by physical controls. It is delivered as editable TypeScript for React. Tailwind CSS is not required; the component's visual CSS is embedded in its TypeScript source. Its focused API can be adapted to your own content and visual system.

Usage

When to use it

  • Playful control panels, creative tools, and media interfaces that benefit from tactile feedback.
  • Feature toggles or compact binary actions where a physical-button aesthetic matches the product language.

What’s included

Files in the product ZIP

Squishy Toggle Button source

components/squishy-toggle-button.tsx

Editable React and TypeScript component source.

Working example

examples/example.tsx

A minimal import and render example that matches the packaged API.

Installation guide

README.md

Manual ZIP installation, styling, compatibility, asset, and usage notes.

Usage

Import and render

Copy the packaged source to the documented path, then use the public API shown below.

Import
import { SquishyToggleButton } from "@/components/squishy-toggle-button";
Minimum example
export default function Toggle() {
  return <SquishyToggleButton name="effects" aria-label="Enable effects" />;
}

Props

Component API

PropTypeDefaultDescription
labelReactNode"+"Visual label rendered on the button face.
sizenumber140Control width and height in pixels.
classNamestring""Additional root class names.
styleCSSPropertiesundefinedInline styles for the root label.

Also accepts native checkbox input attributes except className, size, style, and type.

Compatibility

Verified project setup

  • ReactLoom's preview is tested with Next.js 16.3.8 App Router, React 19.2.8, TypeScript 5.9.3, and Tailwind CSS 4.3.3. This describes the store environment, not the product's minimum requirements.
  • This interactive component includes the "use client" directive and must remain behind a Client Component boundary in the Next.js App Router.
  • Tailwind CSS is not required; the component's visual CSS is embedded in its TypeScript source.
Images
No image files are included or required by the packaged component.
Fonts
No font files are included. The component uses system font fallbacks unless your app supplies a matching font.

Installation

Add it to your project

Download the Squishy Toggle Button ZIP, place the source file at src/components/squishy-toggle-button.tsx, and copy the example into your own page or feature folder.

Target path

src/components/squishy-toggle-button.tsx

No additional npm runtime packages are required beyond the React host; follow the styling requirements below.

Styling requirements

  • Tailwind CSS is not required by this component.
  • All component styles are embedded in components/squishy-toggle-button.tsx.