FormsFree
Expandable Icon Toggle 1

Expandable Icon Toggle 1

A compact toggle that expands on hover to reveal all options, collapsing back to show only your selection. Component used in Colouring Page.

Installation 30s

1

Run Claude Code then copy and paste this command

@5ds/framework

Sign In to Build

Join with a free account

Sign In
2

Claude Code will install this into the /src/components folder in your project

3

Tell Claude Code where you want to use this

Description

A space-saving toggle that shows just the selected icon until you hover over it.

When you hover, it smoothly expands to reveal all options with a sliding highlight animation. The default setup handles portrait, landscape, and square orientations, but you can pass in any icons and labels you want.

Pass your own options array to customize the icons and values. The onChange callback fires whenever someone picks a new option, so you can hook it up to your state management.

Built with Framer Motion for the spring animations and shadcn tooltips that appear when expanded.

Key Features

Collapses to show only selected option, expands on hover
Smooth spring animations with Framer Motion
Fully customizable icons and options via props
Built-in tooltips that appear when expanded
onChange callback for state management

Use Cases

Orientation selector for image uploads or canvas tools
View mode switcher (grid, list, gallery) in a compact toolbar
Format selector that doesn't take up much space
Any multi-option toggle where screen real estate is tight

Frequently Asked Questions

Dependencies

framer-motion@tabler/icons-reactshadcn/tooltip

These will be automatically installed when you add this component to your project.

AppWebsiteSaaSE-commDirectoryIdeaAI Business, In Days

Join 0 others building with AI