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>
);
}















