Skip to content

Examples

Explore Silvery's features through focused examples. Each page teaches a specific differentiator — click a demo to load it, keyboard input works inside the terminal.

By Feature

ExampleWhat it teachesKey components
Components30+ ready-made widgetsSelectList, Tabs, ProgressBar, Spinner
LayoutCSS flexbox for terminalsBox, flexGrow, gap, justifyContent
Forms & InputInteractive forms and wizardsSelectList, TextInput, focusScope
Tables & DataData exploration and filteringTable, VirtualList, useContentRect()
ScrollbackDynamic inline mode (unique)ScrollbackList, ScrollbackView
Terminal ProtocolsKitty keyboard, mouse, imagesImage, Canvas, parseHotkey()
AI Coding AgentStreaming and real-time updatesVirtualList, TextInput, tool calls
TestingHeadless testing APIcreateRenderer, press(), getByText()

Running Examples

Clone the repository and run any example:

bash
git clone https://github.com/beorn/silvery
cd silvery
bun install

# Run the example viewer (Storybook-style TUI):
bun examples

# Run a specific example:
bun examples/interactive/aichat/index.tsx
bun examples/interactive/cli-wizard.tsx
bun examples/layout/dashboard.tsx

Creating Your Own

Start with the example closest to your use case:

Use CaseStart With
Interactive form / wizardForms & Input
Data table with searchTables & Data
Multi-pane dashboardLayout
Chat / streaming UIAI Coding Agent
CLI tool with scrollbackScrollback

All examples follow the same patterns:

  1. Use SelectList for selection prompts (not manual cursor tracking)
  2. Use TextInput for text entry (built-in readline with Emacs keybindings)
  3. Use useContentRect() for responsive dimensions
  4. Use overflow="scroll" + scrollTo for scrolling
  5. Use $token colors for consistent theming

Released under the MIT License.