gridland
Components

TerminalWindow

A decorative terminal-style window chrome container

A decorative container that mimics a terminal window with traffic light buttons and an optional centered title. Defaults to a dark gray background.

Terminal
?

Run demo

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

Installation

bunx shadcn@latest add @gridland/terminal-window

Usage

import { TerminalWindow } from "@/components/ui/terminal-window"
<TerminalWindow title="my-terminal">
  <div>Window content here</div>
</TerminalWindow>

Examples

With Title

Display a centered title in the title bar.

With title
<TerminalWindow title="~/projects/my-app">
  <div>Terminal content</div>
</TerminalWindow>

Transparent Background

Use transparent to remove the default dark gray background and inherit from the parent.

Transparent
<TerminalWindow title="Preview" transparent>
  <div>Content on transparent background</div>
</TerminalWindow>

Window Controls

Pass onClose, onMinimize, and onMaximize callbacks to make the traffic light buttons interactive.

With callbacks
<TerminalWindow
  title="Editor"
  onClose={() => console.log("close")}
  onMinimize={() => console.log("minimize")}
  onMaximize={() => console.log("maximize")}
>
  <div>Window content</div>
</TerminalWindow>

Min Width

Set a minimum width for the window container.

Min width
<TerminalWindow title="Wide" minWidth={600}>
  <div>Content</div>
</TerminalWindow>

API Reference

TerminalWindow

PropTypeDefaultDescription
childrenReactNode-Content below the title bar
classNamestring-Additional CSS classes
titlestring-Centered title bar text
minWidthnumber | string-Minimum width of the window
transparentbooleanfalseRemove the dark gray background
onClose() => void-Close button callback
onMinimize() => void-Minimize button callback
onMaximize() => void-Maximize button callback