Expandable Control
Expandable controls separate expansion state from the action inside the expanded surface.
Practical React example
Reveal the label of a compact toolbar action before letting someone invoke its secondary action.
Before you copy and paste
Keep the example in the React rendering environment required by the imported component. Copy components/motion/expandable-control.tsx and its returned support files from the Code tab; preserve the project-relative paths.
Listed package dependencies: clsx, lucide-react, motion, react, tailwind-merge.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Reveal the label of a compact toolbar action before letting someone invoke its secondary action
// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";
import { Bell, X } from "lucide-react";
import {
ExpandableButton,
ExpandableChip,
} from "@/components/motion/expandable-control";
export function ExpandableControlPreview() {
return (
<div className="flex flex-col items-center gap-6">
<div className="flex items-center gap-2">
<ExpandableButton
icon={<Bell className="size-4" />}
label="Notifications"
/>
</div>
<div className="flex items-center gap-2">
<ExpandableChip
label="React"
actionIcon={<X className="size-3.5" />}
actionLabel="Remove React"
/>
</div>
</div>
);
}
Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.
Use expanded and onExpandedChange when another part of the page owns the toolbar state. Give a chip action an actionLabel that describes what it changes.
Customization
- ExpandableStateProps.expanded
- Optional; boolean.
- ExpandableStateProps.defaultExpanded
- Optional; boolean.
- ExpandableStateProps.onExpandedChange
- Optional; (expanded: boolean) => void.
- ExpandableButtonProps.icon
- Required; ReactNode.
- ExpandableButtonProps.label
- Required; ReactNode.
- ExpandableChipProps.label
- Required; ReactNode.
- ExpandableChipProps.actionIcon
- Required; ReactNode.
- ExpandableChipProps.actionLabel
- Required; string.
- ExpandableChipProps.onAction
- Optional; () => void.
- ExpandableChipProps.collapseOnAction
- Optional; boolean.
- ExpandableChipProps.disabled
- Optional; boolean.
- ExpandableChipProps.className
- Optional; string.
- ExpandableChipProps.labelClassName
- Optional; string.
- ExpandableChipProps.actionClassName
- Optional; string.
Integration notes
- Expansion is not confirmation that a record was changed.
- Check whether the first tap expands the control and whether a second action remains discoverable on touch.
Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.