gridland
Components

StatusBar

A horizontal bar displaying keybinding hints

A horizontal bar that displays keybinding hints with key labels and descriptions. Commonly placed at the bottom of a view.

StatusBar
?

Run demo

Terminal
bunx @gridland/demo status-bar
Terminal
curl -fsSL https://raw.githubusercontent.com/thoughtfulllc/gridland/main/scripts/run-demo.sh | bash -s status-bar

Installation

bunx shadcn@latest add @gridland/status-bar

Usage

import { StatusBar } from "@/components/ui/status-bar"
<StatusBar
  items={[
    { key: "Tab", label: "switch focus" },
    { key: "q", label: "quit" },
  ]}
/>

Examples

Multiple Items

Multiple keybindings
<StatusBar
  items={[
    { key: "↑↓", label: "navigate" },
    { key: "Enter", label: "select" },
    { key: "Esc", label: "cancel" },
    { key: "q", label: "quit" },
  ]}
/>

With Extra Content

Render custom inline content to the left of the hints. A dim separator appears between the extra content and the keybinding items.

With extra
<StatusBar
  items={[{ key: "←→", label: "change type" }]}
  extra={<span style={textStyle({ fg: theme.accent, bold: true })}>dots</span>}
/>

API Reference

StatusBar

PropTypeDefaultDescription
itemsStatusBarItem[]-Array of keybinding hints to display
extraReactNode-Inline content rendered left of the hints (must be <span> or string)

StatusBarItem

FieldTypeDescription
keystringKey or key combination text (e.g. "Tab", "←→")
labelstringDescription of what the key does