Windows — Fluent
JS behaviour
TabView
Win11 tabs (the window cards): rounded tabs with document icons, a close button only under the pointer, a «+» for new tabs, and a preview peek while you hold.
Real scenarios
The component as it is used in a product — not a specimen grid.
Documents as window cards
The close ✕ appears only under the pointer or on the active tab, the «+» adds up to five tabs, and resting on a tab peeks a preview. Arrow keys walk the strip; Delete closes.
Sales report
Fourth-quarter sales grew 18% over last year; the charts were refreshed this morning.
Rest on a tab for the preview peek; the last tab refuses to close.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| tab | shape | '4px' | A 4px radius, 32px tall; icon + title + close. |
| close | visibility | 'hover' | The close button shows on hover or for the active tab. |
| new-tab | button | '+' | The + at the strip’s end; Ctrl+T works too. |
Snippet
<div class="fltab" role="tablist">
<button class="fltab-tab" data-current role="tab">📄 گزارش <span class="fltab-x">×</span></button>
<button class="fltab-add" aria-label="تب جدید">+</button>
</div>
<style>
.fltab { display: flex; align-items: center; gap: 4px; padding: 4px; background: #f3f3f3; }
.fltab-tab { display: inline-flex; gap: 8px; align-items: center; block-size: 32px;
padding-inline: 10px; border-radius: 4px; }
.fltab-tab[data-current] { background: #fff; box-shadow: 0 1px 2px #00000014; }
.fltab-x { opacity: 0; border-radius: 3px; }
.fltab-tab:hover .fltab-x { opacity: 1; }
</style>