pachoclo / resizable-two-column-layout

A React + vanilla CSS two-column layout with resizable sidebar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two Column Layout with resizable sidebar

  • React + TS + Vite
  • No libs
  • Vanilla CSS
  • Props for initial, min and max sidebar size
  • Saves / loads preferred size automatically to LocalStorage
  • Reset on double-click
  • Most likely still has some bugs πŸ€·β€β™‚οΈ
Screen.Recording.2023-03-16.at.8.21.31.PM.mov

πŸ•ΉοΈ Commands

npm i
npm run dev
npm run build
npm run preview

πŸ—‚οΈ Structure

.
β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ App.tsx
β”‚   β”‚   β”œβ”€β”€ Layout.tsx              <- ⚠️
β”‚   β”‚   β”œβ”€β”€ MainContent.tsx
β”‚   β”‚   └── SidebarContent.tsx
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── use-resize-sidebar.tsx  <- ⚠️
β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   β”œβ”€β”€ Layout.css              <- ⚠️
β”‚   β”‚   └── index.css
β”‚   β”œβ”€β”€ main.tsx
β”‚   └── vite-env.d.ts
β”œβ”€β”€ index.html
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ tsconfig.node.json
β”œβ”€β”€ package.json
└── vite.config.ts

About

A React + vanilla CSS two-column layout with resizable sidebar


Languages

Language:TypeScript 60.8%Language:CSS 31.5%Language:HTML 7.8%