Tinyrack

Window Frame

Wraps any content in macOS or browser window chrome, with traffic-light controls and an optional title or address bar.

Contract

AxisValuesDefault
variantmacos, browsermacos
padding (Body)none, sm, md, lgmd
partsRoot, TitleBar, Controls, Control, Title, AddressBar, Bodycompound API

Install

pnpm add @tinyrack/ui

Scroll inside the code area to read long lines.

Styles

@import '@tinyrack/ui/components/window-frame.css';

Scroll inside the code area to read long lines.

Imports

import { TRWindowFrame } from '@tinyrack/ui/components/window-frame';

Scroll inside the code area to read long lines.

Playground

Usage

Terminal window permalink

The signature look: macOS chrome around a dark terminal. Controls auto-render the three traffic-light dots, and the body goes dark through the --tr-window-frame-body-* custom properties so the framing and the content match.

Examples

macOS and browser chrome permalink

Use variant macos for a titled app window and browser for a web mockup with an address bar that fills the title bar. Both wrap real UI, not just terminals.

Custom theme permalink

Everything themes through custom properties. Recolor the traffic-light dots with --tr-window-frame-control-* and paint any palette with the --tr-window-frame-body-* properties — no extra variant needed.

API

PartBase elementKey props
TRWindowFrame.Rootdivvariant, render
TRWindowFrame.TitleBardivnative div props
TRWindowFrame.Controlsdivauto-renders three dots, aria-hidden by default
TRWindowFrame.Controldivtone (close, minimize, maximize)
TRWindowFrame.Titlespanrender for heading semantics
TRWindowFrame.AddressBardivnative div props
TRWindowFrame.Bodydivpadding (none, sm, md, lg)

TRWindowFrame.Root and TRWindowFrame.Title support Base UI's additive render contract, so the frame can become an <article> or <figure> and the title can opt into a heading. The traffic-light dots are decorative — Controls sets aria-hidden and renders non-interactive elements. The body inherits the theme; restyle it into a dark terminal with the --tr-window-frame-body-background, --tr-window-frame-body-color, and --tr-window-frame-body-font custom properties, and recolor the dots with --tr-window-frame-control-close, --tr-window-frame-control-minimize, and --tr-window-frame-control-maximize.