import type { Meta, StoryObj } from '@storybook/nextjs'
import { useState } from 'react'
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from './Resizable'
const ResizableExample = () => {
const [isResizing, setIsResizing] = useState(false)
return (
setIsResizing(false)}
style={{ height: '400px', border: '1px solid #ccc' }}
>
Panel 1 - Resize me
setIsResizing(isDragging)}
/>
Panel 2
)
}
const ResizableVerticalExample = () => {
const [isResizing, setIsResizing] = useState(false)
return (
setIsResizing(false)}
style={{ height: '400px', border: '1px solid #ccc' }}
>
Top Panel
setIsResizing(isDragging)}
/>
Bottom Panel
)
}
const meta = {
component: ResizablePanelGroup,
parameters: {
docs: {
description: {
component:
'A react-resizable-panels wrapper. Use ResizablePanelGroup, ResizablePanel, and ResizableHandle together to create resizable layouts.',
},
},
},
} satisfies Meta
export default meta
type Story = StoryObj
export const Horizontal: Story = {
render: () => ,
}
export const Vertical: Story = {
render: () => ,
}