ns-ui / split-pane-weighted — drag has weight, release finds a rail

Explorer

  • src/
  • app/
  • layout.tsx
  • page.tsx
  • components/
  • split-pane-weighted.tsx
  • toolbar.tsx
  • lib/
  • spring.ts
  • package.json
1export function SashWeight({
2 orientation = "vertical",
3 detents = [25, 50, 75],
4 ...props
5}: SashWeightProps) {
6 const live = useSpring(pos, {
7 k: dragging ? 90 : 170,
8 zeta: dragging ? 1.15 : 1,
9 });
10 
11 return <Divider {...live} />;
12}

Preview

drag either rail fast, or nudge it with Arrow keys — Enter jumps to 50/50