useScrollbarWidth
- This is a hook that retrieves the
widthof the globally set scrollbar in the browser window.
Features
- You can retrieve the width of the scrollbar.
Types
const useScrollbarWidth: () => number;
Example
const TableCols = (/**...**/) => {
const scrollbarWidth = useScrollbarWidth();
return (
// ...
<th style={{ width: `${scrollbarWidth}px` }} />
)
};