erictsai83

Expandable Toggle Button

Buttons

About

A shadcn toggle button that expands from an icon into an icon-and-label action while keeping the icon anchored.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Expandable Toggle Button to your project and fits it to your theme.

Code

How Expandable Toggle Button is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { ScanSearch, X } from "lucide-react";

import { ExpandableToggleButton } from "@/components/ui/ericts-expandable-toggle-button";

export default function Preview() {
  return (
    <div className="flex min-h-32 w-full items-center justify-center">
      <ExpandableToggleButton
        icon={<ScanSearch aria-hidden />}
        activeIcon={<X aria-hidden />}
        inactiveLabel="Inspect preview"
        activeLabel="Stop inspecting"
        label="Stop inspecting"
        expandFrom="start"
      />
    </div>
  );
}

Dependencies

More by erictsai83

View all
  • Adaptive Drawer

    Adaptive Drawer

  • Status Button

    Status Button

  • Floating Shortcut Button

    Floating Shortcut Button

  • Filter Tags

    Filter Tags

  • Feedback Popover

    Feedback Popover

  • Expandable Toolbar

    Expandable Toolbar

  • Arc Menu

    Arc Menu

  • Multi-Step Flow

    Multi-Step Flow

More in Buttons

View all
  • Button

    Button

    166
  • Texture Button

    Texture Button

    121
  • Button

    Button

    21
  • Figma File Button

    Figma File Button

    39
  • Native Button

    Native Button

    12
  • Button

    Button

    88
  • HeroUI Button Group

    HeroUI Button Group

    11
  • Great UI Button

    Great UI Button

    19