AppWindow
Window container with close / minimize / zoom controls, title, custom header slot and actions. SegmentedTabs is the compact view switcher for its title bar.
- Deploy web@4f2a1cReady2m ago
- Deploy api@9b77e0Building5m ago
- Deploy web@1c09d3Failed1h ago
The window controls are buttons: try close, minimize, zoom.
import { AppWindow } from "@/components/ui/app-window";export function Preview() { return ( <AppWindow title="Preview" onClose={close} glass bodyClassName="p-5"> <p>Window content goes here.</p> </AppWindow> );}"use client";import { useState } from "react";import { AppWindow } from "@/components/ui/app-window";import { SegmentedTabs } from "@/components/ui/segmented-tabs";const views = ["Overview", "Activity", "Settings"];export function DeploysWindow({ onClose }: { onClose: () => void }) { const [view, setView] = useState(views[0]); return ( <AppWindow onClose={onClose} header={ <SegmentedTabs label="Views" items={views} value={view} onChange={setView} /> } bodyClassName="p-5" > <h2 className="font-medium">{view}</h2> </AppWindow> );}<AppWindow>
actionsReactNodeRight-aligned titlebar slot.
bodyClassNamestringClasses for the content area under the title bar.
glassbooleanTranslucent, blurred surface.
headerReactNodeCustom titlebar content (tabs, navbar, search); replaces the centered title.
onClose() => voidPassing a handler turns the matching dot into a button.
onMaximize() => voidShows the maximize control; called when it is pressed.
onMinimize() => voidShows the minimize control; called when it is pressed.
titleReactNodeCentered titlebar text.
| Prop | Type | Default |
|---|---|---|
actionsRight-aligned titlebar slot. | ReactNode | — |
bodyClassNameClasses for the content area under the title bar. | string | — |
glassTranslucent, blurred surface. | boolean | — |
headerCustom titlebar content (tabs, navbar, search); replaces the centered title. | ReactNode | — |
onClosePassing a handler turns the matching dot into a button. | () => void | — |
onMaximizeShows the maximize control; called when it is pressed. | () => void | — |
onMinimizeShows the minimize control; called when it is pressed. | () => void | — |
titleCentered titlebar text. | ReactNode | — |
Also accepts every <div> prop.
<SegmentedTabs>
Segmented tabs. One indicator slides under the active item on a spring, always behind the labels.
items*readonly string[]Labels, also used as values.
label*stringAccessible name for the tab list.
onChange*(item: string) => voidCalled with the pressed item.
value*stringActive item; marked
aria-current.
| Prop | Type | Default |
|---|---|---|
items*Labels, also used as values. | readonly string[] | — |
label*Accessible name for the tab list. | string | — |
onChange*Called with the pressed item. | (item: string) => void | — |
value*Active item; marked | string | — |
* required. Every component also takes className.