tanstack-shadcn-table
Version:
A powerful, feature-rich React table component built on top of TanStack Table v8 with shadcn/ui styling. Optimized bundle size with 55% reduction through peer dependencies.
2 lines (1 loc) • 722 B
JavaScript
import{jsx as e}from"react/jsx-runtime";import{c as o}from"./utils-49e5594d.js";function r({header:r,className:t}){const{column:l}=r,n=l.getIsResizing();return l.getCanResize()?e("div",{className:o("absolute right-0 top-0 h-full w-1 cursor-col-resize select-none touch-none bg-transparent hover:bg-blue-500 active:bg-blue-600 focus:bg-blue-500 focus:outline-none",n&&"bg-blue-500",t),onMouseDown:r.getResizeHandler(),onTouchStart:r.getResizeHandler(),role:"separator","aria-label":`Resize ${r.column.id} column`,"aria-orientation":"vertical",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||e.preventDefault()},style:{transform:"translateX(50%)"},children:e("div",{className:"h-full w-full"})}):null}export{r as C};