About this set
A browser-style tab strip with index.html, style.css and main.js, each tab carrying a close cross, and a plus button at the end that opens a new untitled tab. The selected tab turns white and joins the document area below it, while inactive tabs sit in a grey strip. Closing the selected tab hands the selection to its neighbour, closing the last one shows a short empty-state message, and new tabs are added as untitled-1.txt, untitled-2.txt and so on. Tabs shrink and truncate their names with an ellipsis before the strip starts to scroll, like a real browser. Use it for editors, multi-document tools, query consoles and chat or ticket workspaces. Keyboard users close the focused tab with the Delete key, which each tab describes to screen readers; the cross is a mouse shortcut for the same action. New tabs are cloned from the first tab and panel, so they keep every class and attribute. The Bootstrap version uses .nav-tabs with the Tab plugin and a small script for closing and adding.
What’s included
- Close with the cross or the Delete key
- Plus button opens new untitled tabs
- Selection moves to the neighbour when a tab closes
- Tabs shrink and truncate before the strip scrolls
- Empty state when every tab is closed
Accessibility
Tabs sit in a tablist labelled Open documents and each has a description, Press Delete to close this tab. Only the selected tab is in the Tab order; Left and Right (or Up and Down) move between tabs and select them, and Home and End jump to the first and last tab. Delete closes the focused tab and moves focus to the newly selected one, or to the New tab button when none are left. The cross is aria-hidden and not focusable, focus draws a 2px indigo outline, and transitions are removed under prefers-reduced-motion.
Customise it
Change --ct-accent, --ct-strip, --ct-tab, --ct-tab-hover, --ct-muted, --ct-icon and --ct-text on .ctabs (plain CSS and Bootstrap), and the tab min-width and max-width to control truncation. In Tailwind edit the --color-ct-* theme colours and the min-w-[88px] and max-w-[170px] utilities.

















