@itwin/itwinui-react
Version:
A react component library for iTwinUI
39 lines (38 loc) • 1.28 kB
TypeScript
import React from 'react';
import type { PolymorphicForwardRefComponent } from '../props.js';
type OverflowContainerProps = {
/**
* The orientation of the overflow in container.
* @default 'horizontal'
*/
overflowOrientation?: 'horizontal' | 'vertical';
/**
* Count of the *original* items (i.e. when sufficient space is available).
*/
itemsCount: number;
};
type OverflowContainerOverflowNodeProps = {
children: React.ReactNode;
};
/**
* @private
* Wrapper over `useOverflow`.
*
* - Use `OverflowContainer.useContext()` to get overflow related properties.
* - Wrap overflow content in `OverflowContainer.OverflowNode` to conditionally render it when overflowing.
*/
export declare const OverflowContainer: PolymorphicForwardRefComponent<"div", OverflowContainerProps> & {
/**
* Wrap overflow content in this component to conditionally render it when overflowing.
*/
OverflowNode: (props: OverflowContainerOverflowNodeProps) => React.ReactNode;
/**
* Get overflow related properties of the nearest `OverflowContainer` ancestor.
*/
useContext: typeof useOverflowContainerContext;
};
declare function useOverflowContainerContext(): {
visibleCount: number;
itemsCount: number;
};
export {};