@syncfusion/react-navigations
Version:
A package of Pure React navigation components such as Toolbar and Context-menu which is used to navigate from one page to another
59 lines (58 loc) • 2.33 kB
TypeScript
import { HTMLAttributes, RefObject, ForwardRefExoticComponent, RefAttributes } from 'react';
import { Orientation } from './toolbar';
/**
* Specifies the props for the ToolbarScrollable component.
*/
export interface ToolbarScrollableProps {
/**
* Specifies the reference to the toolbar element.
* Used to access the toolbar DOM element for measurements and manipulation.
*
* @default null
*/
toolbarRef: RefObject<HTMLDivElement | null>;
/**
* Specifies the layout direction of toolbar items.
*
* The possible values are:
* - Horizontal: Arranges Toolbar items in a row from left to right.
* - Vertical: Stacks Toolbar items in a column from top to bottom.
*
* @default Orientation.Horizontal
*/
orientation: Orientation;
/**
* Specifies the scrolling distance in pixels when the toolbar items overflow in Scrollable mode.
* This property controls how far items scroll when navigation buttons are clicked.
*
* @default undefined
*/
scrollStep?: number;
/**
* Specifies the callback function triggered when the overflow state changes.
* This function is called to set up proper keyboard navigation for toolbar items.
*/
onOverflowChange: () => void;
}
/**
* Specifies the reference interface for the ToolbarScrollable component.
*/
export interface ToolbarScrollableRef {
/**
* Specifies the method to refresh the overflow calculation for scrollable toolbar items.
* This method recalculates the scrollable area and updates the visibility
* of scroll buttons based on current dimensions and content.
*/
refreshOverflow: () => void;
}
type IToolbarScrollableProps = ToolbarScrollableProps & HTMLAttributes<HTMLDivElement>;
/**
* ToolbarScrollable component that renders toolbar items with scrolling capability.
*
* This component manages the display of toolbar items that don't fit in the available space
* by providing horizontal or vertical scrolling functionality. It automatically detects
* when content overflows and renders appropriate scroll controls based on the toolbar's
* orientation.
*/
declare const ToolbarScrollable: ForwardRefExoticComponent<IToolbarScrollableProps & RefAttributes<ToolbarScrollableRef>>;
export { ToolbarScrollable };