Despite internal modernization of the resize hook, the public API for controlling and observing sidebar width remains unchanged. You can continue to use the following props, state, and hooks to manage the sidebar:
Props and State
defaultWidth: The initial width of the sidebar.width: The current width.setWidth: Function to manually set the width.isDraggingRail: Boolean indicating if the user is currently dragging the resize rail.setIsDraggingRail: Function to update the dragging state.enableDrag: Boolean to enable or disable resizing.
Components and Hooks
SidebarRail: The component used to trigger resizing.useSidebarResize: The hook for managing resize logic.sidebar:state: State identifier.sidebar:width: State identifier for width.
Data Attributes and Constants
data-dragging: Attribute applied during drag operations.duration-0: Attribute used to manage transition timing during drag.MIN_SIDEBAR_WIDTH: Constant defining the minimum allowed width.MAX_SIDEBAR_WIDTH: Constant defining the maximum allowed width.
// The following public tokens remain stable:
// defaultWidth, width, setWidth, isDraggingRail, setIsDraggingRail,
// SidebarRail, enableDrag, useSidebarResize, sidebar:state,
// sidebar:width, data-dragging, duration-0, MIN_SIDEBAR_WIDTH, MAX_SIDEBAR_WIDTH