The tabs of open documents (an editor's, a browser's): closable, with an unsaved mark, all over one shared panel; WAI-ARIA tabs with arrows, Home/End and Delete to close. The app closes them: ray-request-close asks.
Click a tab or use ←/→; × (or a middle click, or Delete on the focused tab) closes it. Closing the unsaved one asks first. The tabs share one panel, filled for the selected request.
Unlike ray-tabs, a tab has no panel of its own: they all control the element named by panel, whose content the app fills for the selected one. Closing is the app's: the ×, a middle click or Delete/Backspace fire ray-request-close, and the app removes the tab (after asking about unsaved changes, if it must). When the selected tab is removed, the one at its place is selected (change) and, if the closed tab had the focus, focused. More tabs than width: the bar scrolls sideways, fades the edge that hides tabs (data-overflow-start / data-overflow-end on the host), scrolls with a vertical wheel and keeps the selected tab in view.
Property
Attribute
Type
Default
Description
value
value
string
Value of the selected tab (default: the first).
panel
panel
string
The id of the shared panel: it gets role=tabpanel and aria-labelledby the selected tab; the tabs get aria-controls.
label
label
string
Accessible name of the tab list ("Open requests").
closeLabel
close-label
string
Close(text doc-tabs.close)
Tooltip of the ×.
dirtyLabel
dirty-label
string
Unsaved changes(text doc-tabs.dirty)
What assistive technology hears after the name of a dirty tab.
Event
Description
change
The selected tab changed: a click, the arrow keys, or the selected tab removed.
ray-request-close
The × was clicked, the tab middle-clicked, or Delete/Backspace pressed on it: remove the tab to close it (not fired for hide-close tabs).
Slot
Description
(default)
ray-doc-tab elements.
end
After the tabs, outside the scrolling list: a new-tab button.
Part
Description
list
The tab list (it scrolls sideways when the tabs do not fit).
end
The end slot's box.
<ray-doc-tab>
A document's tab: an icon or tag (slot left), its name (cut with an ellipsis; give the full one in title), and the × or the unsaved dot.
Property
Attribute
Type
Default
Description
value
valuereflects
string
Identifies the document (ray-doc-tabs value).
dirty
dirtyreflects
boolean
Unsaved changes: a dot in place of the ×, which comes back under the pointer.
hideClose
hide-closereflects
boolean
Cannot be closed: no ×, no middle click, no Delete.
Slot
Description
(default)
The document's name.
left
An icon or a tag (a file type, an HTTP method).
Part
Description
label
The name.
left-section
The left slot's box.
close
The × (pointer only: it is not focusable).
dot
The unsaved mark.
Texts
What it writes itself, in English; setStrings() translates them (Getting started: Languages).