TitleBar

A custom, draggable title bar with native minimize, maximize and close controls.

Import

import { TitleBar } from "@tarve/core";

Usage

TitleBar.tsx
import { Badge, Column, Row, Text, TitleBar, Window } from "@tarve/core";

<Window title="Editor" width={960} height={640}>
  <TitleBar height={40} showMaximize={false}>
    <Row gap={8} align="center" padding={12}>
      <Text weight={600}>Editor</Text>
      <Badge variant="secondary">main.ts</Badge>
    </Row>
  </TitleBar>
  <Column flex={1} padding={24}>
    <Text>Window content</Text>
  </Column>
</Window>

Props

PropTypeDefault
height number40
showClose booleantrue
showMaximize booleantrue
showMinimize booleantrue
title string—
Inherited from ViewProps 11 props
PropTypeDefault
align Style["align"]—
dismissOnOutside boolean—
dragRegion boolean—
flex number—
focusable boolean—
gap number—
justify Style["justify"]—
onOutsideClick () => void—
padding Style["padding"]—
portal boolean—
windowAction "minimize" | "toggleMaximize" | "close"—

Common props

Shared by every component. See descriptions →

childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyle