@manufosela/tab-nav

@manufosela/tab-nav

Accessible tab navigation web component with keyboard support

Tab Nav

Accessible tab navigation with keyboard support and smooth transitions.

Basic Usage

Click tabs to switch content. Keyboard: Arrow keys, Home, End.

Overview

Welcome to the overview panel. This is the default tab content.

Features

Here you can see all the amazing features of this component.

  • Keyboard navigation
  • ARIA accessibility
  • Smooth transitions

Documentation

Read the full documentation for usage examples and API reference.

Click a tab...
<tab-nav> <tab-panel label="Overview"> <h3>Overview</h3> <p>Welcome to the overview panel. This is the default tab content.</p> </tab-panel> <tab-panel label="Features"> <h3>Features</h3> <p>Here you can see all the amazing features of this component.</p> <ul> <li>Keyboard navigation</li> <li>ARIA accessibility</li> <li>Smooth transitions</li> </ul> </tab-panel> <tab-panel label="Documentation"> <h3>Documentation</h3> <p>Read the full documentation for usage examples and API reference.</p> </tab-panel> </tab-nav>

Pre-selected Tab

Start with a specific tab selected.

First tab content This tab starts selected! Third tab content
<tab-nav selected="1"> <tab-panel label="First">First tab content</tab-panel> <tab-panel label="Second (Selected)">This tab starts selected!</tab-panel> <tab-panel label="Third">Third tab content</tab-panel> </tab-nav>

With Icons

Add icons to tabs using the icon attribute.

Home panel with house icon.

Settings panel with gear icon.

Profile panel with person icon.

<tab-nav> <tab-panel label="Home" icon="🏠"> <p>Home panel with house icon.</p> </tab-panel> <tab-panel label="Settings" icon="⚙️"> <p>Settings panel with gear icon.</p> </tab-panel> <tab-panel label="Profile" icon="👤"> <p>Profile panel with person icon.</p> </tab-panel> </tab-nav>

Disabled Tab

Disable specific tabs.

This tab works normally. You can't access this content. This tab also works.
<tab-nav> <tab-panel label="Active Tab">This tab works normally.</tab-panel> <tab-panel label="Disabled" disabled>You can't access this content.</tab-panel> <tab-panel label="Another Active">This tab also works.</tab-panel> </tab-nav>

Fill Width

Tabs fill available width equally.

Content for tab 1 Content for tab 2 Content for tab 3
<tab-nav fill> <tab-panel label="Tab 1">Content for tab 1</tab-panel> <tab-panel label="Tab 2">Content for tab 2</tab-panel> <tab-panel label="Tab 3">Content for tab 3</tab-panel> </tab-nav>

Bottom Position

Tabs at the bottom of the content.

Content A with tabs below. Content B with tabs below.
<tab-nav position="bottom"> <tab-panel label="Panel A">Content A with tabs below.</tab-panel> <tab-panel label="Panel B">Content B with tabs below.</tab-panel> </tab-nav>

Left Position

Vertical tabs on the left.

General settings panel. Security settings panel. Privacy settings panel.
<tab-nav position="left" style="height: 200px;"> <tab-panel label="General">General settings panel.</tab-panel> <tab-panel label="Security">Security settings panel.</tab-panel> <tab-panel label="Privacy">Privacy settings panel.</tab-panel> </tab-nav>

Programmatic Control

Control tabs with JavaScript.

Content 0 Content 1 Content 2
<tab-nav id="programmatic"> <tab-panel label="Tab 0">Content 0</tab-panel> <tab-panel label="Tab 1">Content 1</tab-panel> <tab-panel label="Tab 2">Content 2</tab-panel> </tab-nav> <script> const tabNav = document.getElementById('programmatic'); tabNav.select(1); // Select Tab 1 </script>

Custom Styling

Theme with CSS custom properties.

Amber themed tab content. Custom styled tabs.
<tab-nav style=" --tab-bg: #fef3c7; --tab-border: #f59e0b; --tab-text: #92400e; --tab-active-text: #78350f; --tab-active-border: #d97706; --tab-hover-bg: #fde68a; "> <tab-panel label="Amber">Amber themed tab content.</tab-panel> <tab-panel label="Theme">Custom styled tabs.</tab-panel> </tab-nav>
Demo code (CodePen-ready HTML, CSS, JS)
HTML (html)
<h1>Tab Nav</h1>
<p class="subtitle">Accessible tab navigation with keyboard support and smooth transitions.</p>
<div class="demo-links">
  <a href="https://manufosela.dev/ui-components/">← Back to components</a>
  <a href="https://github.com/manufosela/ui-components/tree/main/packages/tab-nav" target="_blank" rel="noopener">GitHub Repo</a>
  <a href="playground.html">Playground</a>
  <a href="https://www.npmjs.com/package/@manufosela/tab-nav" target="_blank" rel="noopener">npm</a>
</div>
<div class="demo-theme-toggle">
  <theme-toggle theme="dark"></theme-toggle>
</div>
<div class="demo-section">
    <h2>Basic Usage</h2>
    <p>Click tabs to switch content. Keyboard: Arrow keys, Home, End.</p>
    <tab-nav id="basic">
      <tab-panel label="Overview">
        <h3>Overview</h3>
        <p>Welcome to the overview panel. This is the default tab content.</p>
      </tab-panel>
      <tab-panel label="Features">
        <h3>Features</h3>
        <p>Here you can see all the amazing features of this component.</p>
        <ul>
          <li>Keyboard navigation</li>
          <li>ARIA accessibility</li>
          <li>Smooth transitions</li>
        </ul>
      </tab-panel>
      <tab-panel label="Documentation">
        <h3>Documentation</h3>
        <p>Read the full documentation for usage examples and API reference.</p>
      </tab-panel>
    </tab-nav>
    <div class="output" id="basicOutput">Click a tab...</div>
    <div class="code-block">&lt;tab-nav&gt;
  &lt;tab-panel label="Overview"&gt;
    &lt;h3&gt;Overview&lt;/h3&gt;
    &lt;p&gt;Welcome to the overview panel. This is the default tab content.&lt;/p&gt;
  &lt;/tab-panel&gt;
  &lt;tab-panel label="Features"&gt;
    &lt;h3&gt;Features&lt;/h3&gt;
    &lt;p&gt;Here you can see all the amazing features of this component.&lt;/p&gt;
    &lt;ul&gt;
      &lt;li&gt;Keyboard navigation&lt;/li&gt;
      &lt;li&gt;ARIA accessibility&lt;/li&gt;
      &lt;li&gt;Smooth transitions&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/tab-panel&gt;
  &lt;tab-panel label="Documentation"&gt;
    &lt;h3&gt;Documentation&lt;/h3&gt;
    &lt;p&gt;Read the full documentation for usage examples and API reference.&lt;/p&gt;
  &lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
      
  </div>

  <div class="demo-section">
    <h2>Pre-selected Tab</h2>
    <p>Start with a specific tab selected.</p>
    <tab-nav selected="1">
      <tab-panel label="First">First tab content</tab-panel>
      <tab-panel label="Second (Selected)">This tab starts selected!</tab-panel>
      <tab-panel label="Third">Third tab content</tab-panel>
    </tab-nav>
    <div class="code-block">&lt;tab-nav selected="1"&gt;
  &lt;tab-panel label="First"&gt;First tab content&lt;/tab-panel&gt;
  &lt;tab-panel label="Second (Selected)"&gt;This tab starts selected!&lt;/tab-panel&gt;
  &lt;tab-panel label="Third"&gt;Third tab content&lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
  </div>

  <div class="demo-section">
    <h2>With Icons</h2>
    <p>Add icons to tabs using the icon attribute.</p>
    <tab-nav>
      <tab-panel label="Home" icon="🏠">
        <p>Home panel with house icon.</p>
      </tab-panel>
      <tab-panel label="Settings" icon="⚙️">
        <p>Settings panel with gear icon.</p>
      </tab-panel>
      <tab-panel label="Profile" icon="👤">
        <p>Profile panel with person icon.</p>
      </tab-panel>
    </tab-nav>
    <div class="code-block">&lt;tab-nav&gt;
  &lt;tab-panel label="Home" icon="🏠"&gt;
    &lt;p&gt;Home panel with house icon.&lt;/p&gt;
  &lt;/tab-panel&gt;
  &lt;tab-panel label="Settings" icon="⚙️"&gt;
    &lt;p&gt;Settings panel with gear icon.&lt;/p&gt;
  &lt;/tab-panel&gt;
  &lt;tab-panel label="Profile" icon="👤"&gt;
    &lt;p&gt;Profile panel with person icon.&lt;/p&gt;
  &lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
  </div>

  <div class="demo-section">
    <h2>Disabled Tab</h2>
    <p>Disable specific tabs.</p>
    <tab-nav>
      <tab-panel label="Active Tab">This tab works normally.</tab-panel>
      <tab-panel label="Disabled" disabled>You can't access this content.</tab-panel>
      <tab-panel label="Another Active">This tab also works.</tab-panel>
    </tab-nav>
    <div class="code-block">&lt;tab-nav&gt;
  &lt;tab-panel label="Active Tab"&gt;This tab works normally.&lt;/tab-panel&gt;
  &lt;tab-panel label="Disabled" disabled&gt;You can't access this content.&lt;/tab-panel&gt;
  &lt;tab-panel label="Another Active"&gt;This tab also works.&lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
  </div>

  <div class="demo-section">
    <h2>Fill Width</h2>
    <p>Tabs fill available width equally.</p>
    <tab-nav fill>
      <tab-panel label="Tab 1">Content for tab 1</tab-panel>
      <tab-panel label="Tab 2">Content for tab 2</tab-panel>
      <tab-panel label="Tab 3">Content for tab 3</tab-panel>
    </tab-nav>
    <div class="code-block">&lt;tab-nav fill&gt;
  &lt;tab-panel label="Tab 1"&gt;Content for tab 1&lt;/tab-panel&gt;
  &lt;tab-panel label="Tab 2"&gt;Content for tab 2&lt;/tab-panel&gt;
  &lt;tab-panel label="Tab 3"&gt;Content for tab 3&lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
  </div>

  <div class="demo-section">
    <h2>Bottom Position</h2>
    <p>Tabs at the bottom of the content.</p>
    <tab-nav position="bottom">
      <tab-panel label="Panel A">Content A with tabs below.</tab-panel>
      <tab-panel label="Panel B">Content B with tabs below.</tab-panel>
    </tab-nav>
    <div class="code-block">&lt;tab-nav position="bottom"&gt;
  &lt;tab-panel label="Panel A"&gt;Content A with tabs below.&lt;/tab-panel&gt;
  &lt;tab-panel label="Panel B"&gt;Content B with tabs below.&lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
  </div>

  <div class="demo-section">
    <h2>Left Position</h2>
    <p>Vertical tabs on the left.</p>
    <tab-nav position="left" style="height: 200px;">
      <tab-panel label="General">General settings panel.</tab-panel>
      <tab-panel label="Security">Security settings panel.</tab-panel>
      <tab-panel label="Privacy">Privacy settings panel.</tab-panel>
    </tab-nav>
    <div class="code-block">&lt;tab-nav position="left" style="height: 200px;"&gt;
  &lt;tab-panel label="General"&gt;General settings panel.&lt;/tab-panel&gt;
  &lt;tab-panel label="Security"&gt;Security settings panel.&lt;/tab-panel&gt;
  &lt;tab-panel label="Privacy"&gt;Privacy settings panel.&lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
  </div>

  <div class="demo-section">
    <h2>Programmatic Control</h2>
    <p>Control tabs with JavaScript.</p>
    <tab-nav id="programmatic">
      <tab-panel label="Tab 0">Content 0</tab-panel>
      <tab-panel label="Tab 1">Content 1</tab-panel>
      <tab-panel label="Tab 2">Content 2</tab-panel>
    </tab-nav>
    <div class="controls">
      <button onclick="document.getElementById('programmatic').select(0)">Select Tab 0</button>
      <button onclick="document.getElementById('programmatic').select(1)">Select Tab 1</button>
      <button onclick="document.getElementById('programmatic').select(2)">Select Tab 2</button>
    </div>
    <div class="code-block">&lt;tab-nav id="programmatic"&gt;
  &lt;tab-panel label="Tab 0"&gt;Content 0&lt;/tab-panel&gt;
  &lt;tab-panel label="Tab 1"&gt;Content 1&lt;/tab-panel&gt;
  &lt;tab-panel label="Tab 2"&gt;Content 2&lt;/tab-panel&gt;
&lt;/tab-nav&gt;

&lt;script&gt;
  const tabNav = document.getElementById('programmatic');
  tabNav.select(1); // Select Tab 1
&lt;/script&gt;</div>
  </div>

  <div class="demo-section">
    <h2>Custom Styling</h2>
    <p>Theme with CSS custom properties.</p>
    <tab-nav style="
      --tab-bg: #fef3c7;
      --tab-border: #f59e0b;
      --tab-text: #92400e;
      --tab-active-text: #78350f;
      --tab-active-border: #d97706;
      --tab-hover-bg: #fde68a;
    ">
      <tab-panel label="Amber">Amber themed tab content.</tab-panel>
      <tab-panel label="Theme">Custom styled tabs.</tab-panel>
    </tab-nav>
    <div class="code-block">&lt;tab-nav style="
  --tab-bg: #fef3c7;
  --tab-border: #f59e0b;
  --tab-text: #92400e;
  --tab-active-text: #78350f;
  --tab-active-border: #d97706;
  --tab-hover-bg: #fde68a;
"&gt;
  &lt;tab-panel label="Amber"&gt;Amber themed tab content.&lt;/tab-panel&gt;
  &lt;tab-panel label="Theme"&gt;Custom styled tabs.&lt;/tab-panel&gt;
&lt;/tab-nav&gt;</div>
  </div>
CSS (css)
:root {
  --bg: #0c0f14;
  --bg-elevated: #141923;
  --bg-panel: #171d28;
  --border: #262f3f;
  --text: #f4f6fb;
  --text-muted: #a7b0c2;
  --text-dim: #7d879b;
  --accent: #ff8a3d;
  --accent-strong: #ff6a00;
  --accent-soft: rgba(255, 138, 61, 0.16);
  --shadow: 0 20px 50px rgba(5, 8, 14, 0.45);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1160px;
}

h1 { color: #1d1d1f; }
    .demo-section {
      background: white;
      padding: 2rem;
      border-radius: 12px;
      margin-bottom: 2rem;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    h2 { margin-top: 0; color: #1d1d1f; }
    p { color: #86868b; line-height: 1.6; }
    a { color: #3b82f6; }
    .code-block {
      background: #1d1d1f;
      color: #f5f5f7;
      padding: 1rem;
      border-radius: 8px;
      font-family: monospace;
      font-size: 0.8rem;
      margin-top: 1rem;
      overflow: auto;
      max-height: 300px;
      white-space: pre;
    }
    .output {
      margin-top: 1rem;
      padding: 1rem;
      background: #f5f5f7;
      border-radius: 8px;
      font-family: monospace;
    }
    .controls {
      display: flex;
      gap: 0.5rem;
      margin-top: 1rem;
    }
    .controls button {
      padding: 0.5rem 1rem;
      border: 1px solid #e5e7eb;
      border-radius: 6px;
      background: white;
      cursor: pointer;
    }
    .controls button:hover {
      background: #f3f4f6;
    }
  
    footer {
      text-align: center;
      margin-top: 3rem;
      padding-top: 2rem;
      border-top: 1px solid #d2d2d7;
      color: #86868b;
      font-size: 0.9rem;
    }
    footer a { color: #1d1d1f; text-decoration: none; }
    footer a:hover { text-decoration: underline; }
  


@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --bg-spot-1: #f8e9d0;
  --bg-spot-2: #e8eef8;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #ffb000;
  --accent-2: #00a7d6;
  --accent-soft: rgba(255, 176, 0, 0.18);
  --surface-1: #f3f4f6;
  --surface-2: #eef2f7;
  --code-bg: #111827;
  --code-text: #f9fafb;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --overlay-bg: rgba(255, 255, 255, 0.98);
}

:root.dark {
  --bg: #0f1117;
  --bg-2: #151a26;
  --bg-spot-1: #1a2136;
  --bg-spot-2: #1d1b34;
  --card: #1c2233;
  --text: #f3f6ff;
  --muted: #b8c0d9;
  --line: #2b3247;
  --accent: #ffb000;
  --accent-2: #00d0ff;
  --accent-soft: rgba(255, 176, 0, 0.25);
  --surface-1: #0b0f1a;
  --surface-2: #263046;
  --code-bg: #0b0f1a;
  --code-text: #d6d9e6;
  --panel-bg: rgba(28, 34, 51, 0.8);
  --overlay-bg: rgba(15, 17, 23, 0.98);
}

* {
  box-sizing: border-box;
}

a {
  color: var(--accent);
}

h1 {
  color: var(--accent);
}

.demo-links {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.demo-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.demo-links a:hover {
  color: var(--text);
  border-color: var(--accent-2);
}

.demo-theme-toggle {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

header {
  border-bottom: 1px solid var(--line);
}

.demo-card,
.section,
.demo-section,
.panel,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  box-shadow: 0 18px 36px rgba(6, 10, 24, 0.45);
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demo-card .code-block {
  margin-top: auto;
}

.demo-grid,
.grid {
  align-items: stretch;
}

.demo-card h2,
.demo-card h3,
.section h2,
.demo-section h2,
.panel-header {
  color: var(--text);
}

.label,
.stat-label,
.category-title,
.subtitle,
.hint,
.note {
  color: var(--muted);
}

.info-item,
.capability,
.preference,
.option-group,
.output,
.current-url,
.event-log,
.result-card,
.log,
.stat {
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--text);
}

.info-item .label,
.capability .name {
  color: var(--muted);
}

.panel-header,
.options,
.topbar,
.top-links {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.subtitle,
.hint,
.note,
.demo-card p,
.section p,
.demo-section p {
  color: var(--muted);
}

.code-block,
pre,
code {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
}

.value-display,
.output,
.result,
.demo-output {
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--text);
}

button {
  background: linear-gradient(120deg, var(--accent), #ff6a00);
  color: #111;
  border: none;
}

button:hover {
  filter: brightness(1.05);
}

input,
select,
textarea {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--line);
}

footer {
  color: var(--muted);
}

footer a {
  color: var(--text);
}

arc-slider {
  --arc-slider-text-color: var(--text);
  --arc-slider-value-bg: var(--surface-1);
  --arc-slider-value-border: var(--line);
  --arc-slider-value-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

rich-select {
  --caller-background: var(--card);
  --caller-color: var(--text);
  --caller-border: 1px solid var(--line);
  --caller-hover-background: var(--surface-2);
  --caller-hover-color: var(--text);
  --caller-hover-border-color: var(--line);
  --caller-focus-border-color: var(--accent-2);
  --caller-focus-shadow: 0 0 0 3px rgba(0, 208, 255, 0.25);
  --caller-disabled-background: var(--surface-1);
  --caller-disabled-color: #6b7280;
  --caller-disabled-border-color: var(--line);
  --arrow-color: var(--muted);
  --selectOptions-background: var(--card);
  --selectOptions-border: 1px solid var(--line);
  --selectOptions-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
  --input-background: var(--surface-1);
  --input-border: 1px solid var(--line);
  --input-color: var(--text);
  --input-placeholder-color: #6b7280;
  --option-color: var(--text);
  --option-hover-background: var(--surface-2);
  --option-hover-color: var(--text);
  --option-active-background: var(--accent);
  --option-active-color: #111;
  --option-selected-background: var(--accent-soft);
  --option-selected-color: var(--text);
  --option-disabled-background: var(--surface-1);
  --option-disabled-color: #6b7280;
}

multi-select {
  --multi-select-bg: var(--card);
  --multi-select-border-color: var(--line);
  --multi-select-border-hover: var(--line);
  --multi-select-border-focus: var(--accent-2);
  --multi-select-text-color: var(--text);
  --multi-select-placeholder-color: #6b7280;
  --multi-select-arrow-color: var(--muted);
  --multi-select-dropdown-bg: var(--card);
  --multi-select-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
  --multi-select-option-hover-bg: var(--surface-2);
  --multi-select-option-selected-bg: var(--accent-soft);
}

tab-nav {
  --tab-bg: var(--card);
  --tab-border: var(--line);
  --tab-text: var(--muted);
  --tab-active-text: var(--text);
  --tab-hover-bg: var(--surface-2);
  --tab-active-border: var(--accent);
  --tab-disabled: #9ca3af;
}

slider-underline {
  --slider-track: var(--surface-2);
  --slider-fill: var(--accent);
  --slider-thumb: var(--accent);
  --slider-label-color: var(--text);
  --slider-tick-color: #9ca3af;
  --slider-tick-value-color: var(--muted);
}

header-nav {
  --header-bg: var(--card);
  --header-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  --header-link-color: var(--text);
  --header-link-hover: var(--accent);
  --header-mobile-hover-bg: var(--surface-2);
}

calendar-inline {
  --calendar-bg: var(--card);
  --calendar-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  --calendar-text: var(--text);
  --calendar-accent: var(--accent);
  --calendar-today: var(--accent-soft);
  --calendar-selected: var(--accent);
  --calendar-hover-bg: var(--surface-2);
  --calendar-muted: var(--muted);
  --calendar-muted-strong: #9ca3af;
  --calendar-other-month: #9ca3af;
  --calendar-disabled: #cbd5e1;
  --calendar-holiday: #ef4444;
  --calendar-holiday-selected: #111;
}

marked-calendar {
  --calendar-bg: var(--card);
  --calendar-border: var(--line);
  --calendar-title: var(--text);
  --calendar-muted: var(--muted);
  --calendar-surface: var(--surface-1);
  --calendar-accent: var(--accent);
  --calendar-accent-hover: #ff7a1a;
  --calendar-border-strong: var(--line);
  --calendar-contrast: #111;
  --calendar-nav-bg: var(--surface-1);
  --calendar-nav-hover: var(--surface-2);
}

radar-chart {
  --radar-bg: var(--card);
  --radar-grid-color: var(--line);
  --radar-axis-color: #94a3b8;
  --radar-label-color: var(--muted);
}

multi-carousel {
  --carousel-bg: var(--card);
  --carousel-arrow-bg: var(--surface-1);
  --carousel-arrow-color: var(--text);
  --carousel-arrow-hover-bg: var(--surface-2);
  --carousel-arrow-hover-color: var(--text);
  --carousel-nav-bg: var(--surface-1);
  --carousel-nav-color: var(--muted);
  --carousel-nav-hover: #9ca3af;
  --carousel-nav-active: var(--accent);
  --carousel-focus-color: var(--accent-2);
}

nav-list {
  --nav-list-bg: var(--card);
  --nav-list-border-color: var(--line);
  --nav-list-selected-border-color: var(--accent);
  --nav-list-selected-bg: var(--surface-2);
  --nav-list-hover-bg: var(--surface-2);
  --nav-list-selected-color: var(--text);
}

theme-toggle {
  --theme-toggle-bg: var(--card);
  --theme-toggle-icon-color: var(--muted);
  --theme-toggle-hover-bg: var(--surface-2);
  --theme-toggle-active-bg: var(--surface-1);
  --theme-toggle-active-color: var(--text);
  --theme-toggle-dark-bg: var(--card);
  --theme-toggle-dark-border: var(--line);
  --theme-toggle-dark-icon-color: var(--muted);
  --theme-toggle-dark-active-bg: var(--surface-1);
  --theme-toggle-dark-active-color: var(--text);
  --theme-toggle-dark-hover-bg: var(--surface-2);
}

qr-code {
  --qr-fg: #0f1117;
  --qr-bg: #f3f6ff;
}

click-clock {
  --clock-color: var(--text);
  --clock-bg: var(--card);
  --clock-muted-color: var(--muted);
}

historical-line {
  --title-color: var(--text);
  --border-color: var(--line);
  --year-bg: var(--surface-1);
}

circle-steps {
  --steps-muted: var(--muted);
  --steps-text: var(--text);
  --steps-pending: var(--surface-2);
}

rich-inputfile {
  --input-border: var(--line);
  --input-border-focus: var(--accent-2);
  --input-bg: var(--card);
  --input-label-color: var(--text);
  --input-hover-bg: var(--surface-2);
  --input-drag-bg: var(--accent-soft);
  --input-disabled-bg: var(--surface-1);
  --input-success-border: #22c55e;
  --input-success-bg: rgba(34, 197, 94, 0.12);
  --input-icon-color: #94a3b8;
  --input-text-color: var(--muted);
  --input-accent-color: var(--accent-2);
  --input-file-bg: var(--surface-1);
  --input-preview-bg: var(--surface-1);
  --input-file-name-color: var(--text);
  --input-file-size-color: var(--muted);
  --input-error-color: #ef4444;
  --input-hint-color: var(--muted);
}

data-card {
  --data-card-bg: var(--card);
  --data-card-border-color: var(--line);
  --data-card-title-color: var(--text);
  --data-card-desc-color: var(--muted);
  --data-card-info-bg: var(--overlay-bg);
  --data-card-info-close-bg: var(--surface-2);
  --data-card-info-close-color: var(--text);
  --data-card-info-close-hover-bg: var(--surface-1);
  --data-card-info-text: var(--text);
  --data-card-loading-color: var(--muted);
  --data-card-info-trigger-hover: var(--accent);
}

app-modal {
  --app-modal-bg: var(--card);
  --app-modal-body-color: var(--text);
  --app-modal-standalone-bg: rgba(255, 176, 0, 0.35);
  --app-modal-standalone-color: #111;
  --app-modal-standalone-hover-bg: rgba(255, 176, 0, 0.6);
}
JS (js)
document.querySelectorAll('.footer-year').forEach(el => el.textContent = new Date().getFullYear());
  

    import "https://esm.sh/@manufosela/tab-nav";

    // Basic event listener
    const basic = document.getElementById('basic');
    const basicOutput = document.getElementById('basicOutput');
    basic.addEventListener('tab-change', (e) => {
      basicOutput.textContent = `Selected tab ${e.detail.index}: "${e.detail.label}"`;
    });
  

  import '../../theme-toggle/src/theme-toggle.js';

  const root = document.documentElement;
  root.classList.add('dark');

  const toggle = document.querySelector('theme-toggle');
  if (toggle) {
    toggle.theme = root.classList.contains('dark') ? 'dark' : 'light';
    toggle.addEventListener('theme-changed', (event) => {
      const theme = event.detail?.theme;
      if (!theme) return;
      root.classList.toggle('dark', theme === 'dark');
    });
  }