ZUI

Search documentation

Find a page or a heading.

Editor Tab

One tab in an editor's tab strip, whose close button shows the unsaved dot until the tab's hover, focus or active state reveals its X.

tsx

Installation

bash

Usage

tsx
tsx

The consumer composes the parts inside upstream ItemContent and ItemActions. Use it for one tab in an editor's tab strip; give it active for the document on show and dirty while that document has unsaved changes.

Composition

text

API reference

EditorTab

Renders shadcn's Item and takes every prop it takes except variant and size, which it fixes to outline and xs, plus:

It sets data-slot="editor-tab", data-active while active, and data-dirty while dirty.

EditorTabTitle

Renders shadcn's ItemTitle and takes every prop it takes. It is muted until its tab is active. It sets data-slot="editor-tab-title".

EditorTabCloseButton

Renders shadcn's Button and takes every prop it takes except children, which it supplies as the Unsaved Indicator and a close icon.

It is named "Close" unless given its own aria-label. On a dirty tab it shows the unsaved dot; the close icon takes its place while the tab is hovered or active, or while the button has keyboard focus. The icon plays its animation only while the button itself is hovered or focused, not merely while the tab is active. A click on it does not reach the tab, so closing a tab does not also activate it. It sets data-slot="editor-tab-close-button".