Shell

A sidebar that resizes, collapses on a spring and peeks back when the pointer rests on the edge.

Today

Drag the sidebar’s edge, double-click it to reset, drag it shut, then rest the pointer on the left edge.

Features

  • A sidebar that resizes by its edge, resets on double-click and collapses when dragged below half its minimum.
  • It peeks back when the pointer rests on the left edge.

Use it for

  • App layouts.

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react motion lucide-react
  4. Load the styles once. Bring your own base tokens, or use runets’ default theme.
    import 'runets/styles/theme.css'
    import 'runets/styles/kit.css'

Usage

import { Shell } from 'runets'

<Shell title="Today" sidebar={rows}>{content}</Shell>

API

PropTypeWhat it does
sidebarReactNodeSidebar content.
titlestringToolbar title.

Accessibility

Source

The code is in src/kit/surfaces.tsx in runets, MIT licensed.