Skip to content

feat(resizable): add animated collapse/expand methods to ResizablePanel#16

Merged
bob-obringer merged 1 commit intomainfrom
feat/resizable-animated-collapse
Jan 21, 2026
Merged

feat(resizable): add animated collapse/expand methods to ResizablePanel#16
bob-obringer merged 1 commit intomainfrom
feat/resizable-animated-collapse

Conversation

@bob-obringer
Copy link
Copy Markdown
Collaborator

Summary

  • Added animatedCollapse() and animatedExpand() methods to the ResizablePanel imperative handle
  • Enables smooth CSS transitions when programmatically collapsing/expanding panels
  • Drag resizing remains instant (transition is only applied temporarily during animated methods)

Changes

  • resizable.tsx: Extended ResizablePanelImperativeHandle type with new animated methods that use direct DOM manipulation on the data-panel element
  • resizable.stories.tsx: Added AnimatedCollapse story demonstrating animated vs instant toggle
  • package.json: Version bump to 1.2.0
  • CHANGELOG.md: Added 1.2.0 entry

Usage

const panelRef = useRef<ResizablePanelImperativeHandle>(null);

// Smooth animated collapse/expand
panelRef.current?.animatedCollapse();
panelRef.current?.animatedExpand();

// Original instant collapse/expand (still available)
panelRef.current?.collapse();
panelRef.current?.expand();

Test plan

  • Verified animation works in Storybook
  • Confirmed drag resizing has no animation lag
  • Build passes

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ui Ready Ready Preview, Comment Jan 20, 2026 11:47pm

Request Review

…ions

Add `animated` prop to ResizablePanel that enables smooth CSS transitions
for imperative collapse() and expand() calls. Drag resizing stays instant.

Usage:
```tsx
<ResizablePanel ref={panelRef} animated collapsible>
  ...
</ResizablePanel>

// collapse() and expand() now animate smoothly
panelRef.current?.collapse()
```

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bob-obringer bob-obringer force-pushed the feat/resizable-animated-collapse branch from 23ae28f to 086b913 Compare January 20, 2026 23:46
@bob-obringer bob-obringer merged commit 542e7c6 into main Jan 21, 2026
2 of 3 checks passed
@bob-obringer bob-obringer deleted the feat/resizable-animated-collapse branch January 21, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant