Skip to content

Tab Bar

A copy-paste code & terminal component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Code & TerminalHTMLCSSany framework
app.tsx×utils.ts×readme.md×

Copy into your project

HTML
<!-- Tab Bar — file tabs with close buttons; toggle .is-active -->
<div class="nuda-tabs">
  <span class="nuda-tabs__tab is-active">app.tsx<i>×</i></span>
  <span class="nuda-tabs__tab">utils.ts<i>×</i></span>
  <span class="nuda-tabs__tab">readme.md<i>×</i></span>
</div>
CSS
/* Tab Bar
   Editor-style file tabs with active underline + per-tab close button.
   Customize: --tabs-accent, --tabs-bg */

.nuda-tabs {
  --tabs-accent: #e4ff54;
  --tabs-bg: #0a0a0a;
  display: inline-flex;
  background: var(--tabs-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px 8px 0 0;
  padding: 4px 4px 0;
  gap: 2px;
}

.nuda-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: transparent;
  color: #a1a1aa;
  font: 500 0.85rem ui-monospace, monospace;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.nuda-tabs__tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fafafa;
}

.nuda-tabs__tab.is-active {
  background: rgba(228, 255, 84, 0.08);
  color: #fafafa;
}

.nuda-tabs__tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--tabs-accent);
  box-shadow: 0 0 4px rgba(228, 255, 84, 0.5);
}

.nuda-tabs__tab i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #63636e;
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}

.nuda-tabs__tab i:hover {
  background: rgba(255, 99, 99, 0.15);
  color: #ff6363;
}

How to use Tab Bar

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More code & terminal components

← Browse all NudaUI components