free UI sections and components / components
tabs
By Andrea Buttarelli, founder of Feega · Free · Svelte, React, Vue, Astro, HTML
Accessible tablist with arrow-key navigation.
code
<script lang="ts">
const tabs = [
{ label: 'Overview', title: 'Traffic is up this week', body: 'Visits grew 12% against last week, led by the pricing page.' },
{ label: 'Activity', title: 'Three changes today', body: 'Two pages published and one form edited, all by your team.' },
{ label: 'Settings', title: 'Workspace defaults', body: 'Pick who can publish, the default theme and the time zone.' }
];
let active = $state(0);
let buttons: HTMLButtonElement[] = [];
function onkeydown(event: KeyboardEvent) {
const step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;
if (step === 0) {
return;
}
active = (active + step + tabs.length) % tabs.length;
buttons[active].focus();
}
</script>
<div class="fl-tabs">
<div class="list" role="tablist" aria-label="Sections" tabindex="-1" {onkeydown}>
{#each tabs as tab, i}
<button class="tab" role="tab" type="button" id="fl-tab-{i}" aria-controls="fl-panel-{i}" aria-selected={active === i} tabindex={active === i ? 0 : -1} bind:this={buttons[i]} onclick={() => (active = i)}>{tab.label}</button>
{/each}
</div>
{#each tabs as tab, i}
<div class="panel" role="tabpanel" id="fl-panel-{i}" aria-labelledby="fl-tab-{i}" tabindex="0" hidden={active !== i}><h3>{tab.title}</h3><p>{tab.body}</p></div>
{/each}
</div>
<style>
.fl-tabs{font-family:var(--feega-font);font-size:var(--feega-text-body);line-height:1.5;letter-spacing:var(--feega-tracking);color:var(--feega-fg);background:var(--feega-bg);-webkit-font-smoothing:antialiased}
:where(.fl-tabs) *,:where(.fl-tabs) *::before,:where(.fl-tabs) *::after{box-sizing:border-box}
:where(.fl-tabs) :is(h1,h2,h3,h4,p,ul,ol,figure,blockquote,dl,dd){margin:0}
:where(.fl-tabs) a{color:inherit;text-decoration:none}
:where(.fl-tabs) :focus-visible{outline:2px solid var(--feega-focus);outline-offset:3px}
.fl-tabs{padding:var(--feega-space-6) var(--feega-gutter)}
.fl-tabs .list{display:inline-flex;gap:2px;max-width:100%;padding:4px;overflow-x:auto;border-radius:var(--feega-radius-full);background:var(--feega-surface)}
.fl-tabs .tab{min-height:34px;padding:0 var(--feega-space-4);border:0;border-radius:var(--feega-radius-full);background:transparent;color:var(--feega-fg-muted);font:inherit;font-size:var(--feega-text-sm);font-weight:500;letter-spacing:var(--feega-tracking);white-space:nowrap;cursor:pointer;transition:background-color var(--feega-dur) var(--feega-ease),color var(--feega-dur-fast) var(--feega-ease),box-shadow var(--feega-dur) var(--feega-ease)}
.fl-tabs .tab:hover{color:var(--feega-fg)}
.fl-tabs .tab[aria-selected="true"]{background:var(--feega-raised);color:var(--feega-fg);box-shadow:var(--feega-shadow)}
.fl-tabs .panel{display:grid;gap:var(--feega-space-2);max-width:36rem;padding:var(--feega-space-6) var(--feega-space-2);animation:fl-tabs-in var(--feega-dur) var(--feega-ease)}
.fl-tabs .panel[hidden]{display:none}
.fl-tabs .panel h3{font-size:var(--feega-text-xl);font-weight:500;letter-spacing:-0.04em}
.fl-tabs .panel p{color:var(--feega-fg-muted)}
@keyframes fl-tabs-in{from{opacity:0;transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){:where([class^="fl-"]) *,:where([class^="fl-"]) *::before,:where([class^="fl-"]) *::after{animation:none!important;transition:none!important}}
</style>
import { useId, useRef, useState } from 'react';
import type { KeyboardEvent } from 'react';
import './Tabs.css';
const tabs = [
{ label: 'Overview', title: 'Traffic is up this week', body: 'Visits grew 12% against last week, led by the pricing page.' },
{ label: 'Activity', title: 'Three changes today', body: 'Two pages published and one form edited, all by your team.' },
{ label: 'Settings', title: 'Workspace defaults', body: 'Pick who can publish, the default theme and the time zone.' }
];
export function Tabs() {
const uid = useId();
const [active, setActive] = useState(0);
const buttons = useRef<(HTMLButtonElement | null)[]>([]);
function onKeyDown(event: KeyboardEvent) {
const step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;
if (step === 0) {
return;
}
const next = (active + step + tabs.length) % tabs.length;
setActive(next);
buttons.current[next]?.focus();
}
return (
<div className="fl-tabs">
<div className="list" role="tablist" aria-label="Sections" onKeyDown={onKeyDown}>
{tabs.map((tab, i) => (
<button key={tab.label} ref={(el) => { buttons.current[i] = el; }} className="tab" role="tab" type="button" id={`${uid}-tab-${i}`} aria-controls={`${uid}-panel-${i}`} aria-selected={active === i} tabIndex={active === i ? 0 : -1} onClick={() => setActive(i)}>{tab.label}</button>
))}
</div>
{tabs.map((tab, i) => (
<div key={tab.label} className="panel" role="tabpanel" id={`${uid}-panel-${i}`} aria-labelledby={`${uid}-tab-${i}`} tabIndex={0} hidden={active !== i}><h3>{tab.title}</h3><p>{tab.body}</p></div>
))}
</div>
);
}
.fl-tabs{font-family:var(--feega-font);font-size:var(--feega-text-body);line-height:1.5;letter-spacing:var(--feega-tracking);color:var(--feega-fg);background:var(--feega-bg);-webkit-font-smoothing:antialiased}
:where(.fl-tabs) *,:where(.fl-tabs) *::before,:where(.fl-tabs) *::after{box-sizing:border-box}
:where(.fl-tabs) :is(h1,h2,h3,h4,p,ul,ol,figure,blockquote,dl,dd){margin:0}
:where(.fl-tabs) a{color:inherit;text-decoration:none}
:where(.fl-tabs) :focus-visible{outline:2px solid var(--feega-focus);outline-offset:3px}
.fl-tabs{padding:var(--feega-space-6) var(--feega-gutter)}
.fl-tabs .list{display:inline-flex;gap:2px;max-width:100%;padding:4px;overflow-x:auto;border-radius:var(--feega-radius-full);background:var(--feega-surface)}
.fl-tabs .tab{min-height:34px;padding:0 var(--feega-space-4);border:0;border-radius:var(--feega-radius-full);background:transparent;color:var(--feega-fg-muted);font:inherit;font-size:var(--feega-text-sm);font-weight:500;letter-spacing:var(--feega-tracking);white-space:nowrap;cursor:pointer;transition:background-color var(--feega-dur) var(--feega-ease),color var(--feega-dur-fast) var(--feega-ease),box-shadow var(--feega-dur) var(--feega-ease)}
.fl-tabs .tab:hover{color:var(--feega-fg)}
.fl-tabs .tab[aria-selected="true"]{background:var(--feega-raised);color:var(--feega-fg);box-shadow:var(--feega-shadow)}
.fl-tabs .panel{display:grid;gap:var(--feega-space-2);max-width:36rem;padding:var(--feega-space-6) var(--feega-space-2);animation:fl-tabs-in var(--feega-dur) var(--feega-ease)}
.fl-tabs .panel[hidden]{display:none}
.fl-tabs .panel h3{font-size:var(--feega-text-xl);font-weight:500;letter-spacing:-0.04em}
.fl-tabs .panel p{color:var(--feega-fg-muted)}
@keyframes fl-tabs-in{from{opacity:0;transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){:where([class^="fl-"]) *,:where([class^="fl-"]) *::before,:where([class^="fl-"]) *::after{animation:none!important;transition:none!important}}
<script setup lang="ts">
import { ref } from 'vue';
const tabs = [
{ label: 'Overview', title: 'Traffic is up this week', body: 'Visits grew 12% against last week, led by the pricing page.' },
{ label: 'Activity', title: 'Three changes today', body: 'Two pages published and one form edited, all by your team.' },
{ label: 'Settings', title: 'Workspace defaults', body: 'Pick who can publish, the default theme and the time zone.' }
];
const active = ref(0);
const buttons = ref<HTMLButtonElement[]>([]);
function onKeydown(event: KeyboardEvent) {
const step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;
if (step === 0) {
return;
}
active.value = (active.value + step + tabs.length) % tabs.length;
buttons.value[active.value]?.focus();
}
</script>
<template>
<div class="fl-tabs">
<div class="list" role="tablist" aria-label="Sections" @keydown="onKeydown">
<button v-for="(tab, i) in tabs" :key="tab.label" ref="buttons" class="tab" role="tab" type="button" :id="`fl-tab-${i}`" :aria-controls="`fl-panel-${i}`" :aria-selected="active === i" :tabindex="active === i ? 0 : -1" @click="active = i">{{ tab.label }}</button>
</div>
<div v-for="(tab, i) in tabs" :key="tab.label" class="panel" role="tabpanel" :id="`fl-panel-${i}`" :aria-labelledby="`fl-tab-${i}`" tabindex="0" :hidden="active !== i"><h3>{{ tab.title }}</h3><p>{{ tab.body }}</p></div>
</div>
</template>
<style scoped>
.fl-tabs{font-family:var(--feega-font);font-size:var(--feega-text-body);line-height:1.5;letter-spacing:var(--feega-tracking);color:var(--feega-fg);background:var(--feega-bg);-webkit-font-smoothing:antialiased}
:where(.fl-tabs) *,:where(.fl-tabs) *::before,:where(.fl-tabs) *::after{box-sizing:border-box}
:where(.fl-tabs) :is(h1,h2,h3,h4,p,ul,ol,figure,blockquote,dl,dd){margin:0}
:where(.fl-tabs) a{color:inherit;text-decoration:none}
:where(.fl-tabs) :focus-visible{outline:2px solid var(--feega-focus);outline-offset:3px}
.fl-tabs{padding:var(--feega-space-6) var(--feega-gutter)}
.fl-tabs .list{display:inline-flex;gap:2px;max-width:100%;padding:4px;overflow-x:auto;border-radius:var(--feega-radius-full);background:var(--feega-surface)}
.fl-tabs .tab{min-height:34px;padding:0 var(--feega-space-4);border:0;border-radius:var(--feega-radius-full);background:transparent;color:var(--feega-fg-muted);font:inherit;font-size:var(--feega-text-sm);font-weight:500;letter-spacing:var(--feega-tracking);white-space:nowrap;cursor:pointer;transition:background-color var(--feega-dur) var(--feega-ease),color var(--feega-dur-fast) var(--feega-ease),box-shadow var(--feega-dur) var(--feega-ease)}
.fl-tabs .tab:hover{color:var(--feega-fg)}
.fl-tabs .tab[aria-selected="true"]{background:var(--feega-raised);color:var(--feega-fg);box-shadow:var(--feega-shadow)}
.fl-tabs .panel{display:grid;gap:var(--feega-space-2);max-width:36rem;padding:var(--feega-space-6) var(--feega-space-2);animation:fl-tabs-in var(--feega-dur) var(--feega-ease)}
.fl-tabs .panel[hidden]{display:none}
.fl-tabs .panel h3{font-size:var(--feega-text-xl);font-weight:500;letter-spacing:-0.04em}
.fl-tabs .panel p{color:var(--feega-fg-muted)}
@keyframes fl-tabs-in{from{opacity:0;transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){:where([class^="fl-"]) *,:where([class^="fl-"]) *::before,:where([class^="fl-"]) *::after{animation:none!important;transition:none!important}}
</style>
---
---
<div class="fl-tabs">
<div class="list" role="tablist" aria-label="Sections">
<button class="tab" role="tab" type="button" id="fl-tab-1" aria-controls="fl-panel-1" aria-selected="true">Overview</button>
<button class="tab" role="tab" type="button" id="fl-tab-2" aria-controls="fl-panel-2" aria-selected="false" tabindex="-1">Activity</button>
<button class="tab" role="tab" type="button" id="fl-tab-3" aria-controls="fl-panel-3" aria-selected="false" tabindex="-1">Settings</button>
</div>
<div class="panel" role="tabpanel" id="fl-panel-1" aria-labelledby="fl-tab-1" tabindex="0"><h3>Traffic is up this week</h3><p>Visits grew 12% against last week, led by the pricing page.</p></div>
<div class="panel" role="tabpanel" id="fl-panel-2" aria-labelledby="fl-tab-2" tabindex="0" hidden><h3>Three changes today</h3><p>Two pages published and one form edited, all by your team.</p></div>
<div class="panel" role="tabpanel" id="fl-panel-3" aria-labelledby="fl-tab-3" tabindex="0" hidden><h3>Workspace defaults</h3><p>Pick who can publish, the default theme and the time zone.</p></div>
</div>
<script>
document.querySelectorAll<HTMLElement>('.fl-tabs:not([data-ready])').forEach((root) => {
root.setAttribute('data-ready', '');
const tabs = Array.from(root.querySelectorAll<HTMLButtonElement>('[role="tab"]'));
const panels = Array.from(root.querySelectorAll<HTMLElement>('[role="tabpanel"]'));
function select(index: number) {
tabs.forEach((tab, i) => {
tab.setAttribute('aria-selected', String(i === index));
tab.tabIndex = i === index ? 0 : -1;
panels[i].hidden = i !== index;
});
tabs[index].focus();
}
tabs.forEach((tab, i) => tab.addEventListener('click', () => select(i)));
root.querySelector('[role="tablist"]')?.addEventListener('keydown', (event) => {
const key = (event as KeyboardEvent).key;
const step = key === 'ArrowRight' ? 1 : key === 'ArrowLeft' ? -1 : 0;
if (step === 0) {
return;
}
select((tabs.indexOf(document.activeElement as HTMLButtonElement) + step + tabs.length) % tabs.length);
});
});
</script>
<style>
.fl-tabs{font-family:var(--feega-font);font-size:var(--feega-text-body);line-height:1.5;letter-spacing:var(--feega-tracking);color:var(--feega-fg);background:var(--feega-bg);-webkit-font-smoothing:antialiased}
:where(.fl-tabs) *,:where(.fl-tabs) *::before,:where(.fl-tabs) *::after{box-sizing:border-box}
:where(.fl-tabs) :is(h1,h2,h3,h4,p,ul,ol,figure,blockquote,dl,dd){margin:0}
:where(.fl-tabs) a{color:inherit;text-decoration:none}
:where(.fl-tabs) :focus-visible{outline:2px solid var(--feega-focus);outline-offset:3px}
.fl-tabs{padding:var(--feega-space-6) var(--feega-gutter)}
.fl-tabs .list{display:inline-flex;gap:2px;max-width:100%;padding:4px;overflow-x:auto;border-radius:var(--feega-radius-full);background:var(--feega-surface)}
.fl-tabs .tab{min-height:34px;padding:0 var(--feega-space-4);border:0;border-radius:var(--feega-radius-full);background:transparent;color:var(--feega-fg-muted);font:inherit;font-size:var(--feega-text-sm);font-weight:500;letter-spacing:var(--feega-tracking);white-space:nowrap;cursor:pointer;transition:background-color var(--feega-dur) var(--feega-ease),color var(--feega-dur-fast) var(--feega-ease),box-shadow var(--feega-dur) var(--feega-ease)}
.fl-tabs .tab:hover{color:var(--feega-fg)}
.fl-tabs .tab[aria-selected="true"]{background:var(--feega-raised);color:var(--feega-fg);box-shadow:var(--feega-shadow)}
.fl-tabs .panel{display:grid;gap:var(--feega-space-2);max-width:36rem;padding:var(--feega-space-6) var(--feega-space-2);animation:fl-tabs-in var(--feega-dur) var(--feega-ease)}
.fl-tabs .panel[hidden]{display:none}
.fl-tabs .panel h3{font-size:var(--feega-text-xl);font-weight:500;letter-spacing:-0.04em}
.fl-tabs .panel p{color:var(--feega-fg-muted)}
@keyframes fl-tabs-in{from{opacity:0;transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){:where([class^="fl-"]) *,:where([class^="fl-"]) *::before,:where([class^="fl-"]) *::after{animation:none!important;transition:none!important}}
</style>
<div class="fl-tabs">
<div class="list" role="tablist" aria-label="Sections">
<button class="tab" role="tab" type="button" id="fl-tab-1" aria-controls="fl-panel-1" aria-selected="true">Overview</button>
<button class="tab" role="tab" type="button" id="fl-tab-2" aria-controls="fl-panel-2" aria-selected="false" tabindex="-1">Activity</button>
<button class="tab" role="tab" type="button" id="fl-tab-3" aria-controls="fl-panel-3" aria-selected="false" tabindex="-1">Settings</button>
</div>
<div class="panel" role="tabpanel" id="fl-panel-1" aria-labelledby="fl-tab-1" tabindex="0"><h3>Traffic is up this week</h3><p>Visits grew 12% against last week, led by the pricing page.</p></div>
<div class="panel" role="tabpanel" id="fl-panel-2" aria-labelledby="fl-tab-2" tabindex="0" hidden><h3>Three changes today</h3><p>Two pages published and one form edited, all by your team.</p></div>
<div class="panel" role="tabpanel" id="fl-panel-3" aria-labelledby="fl-tab-3" tabindex="0" hidden><h3>Workspace defaults</h3><p>Pick who can publish, the default theme and the time zone.</p></div>
</div>
<script>
document.querySelectorAll('.fl-tabs:not([data-ready])').forEach((root) => {
root.setAttribute('data-ready', '');
const tabs = [...root.querySelectorAll('[role="tab"]')];
const panels = [...root.querySelectorAll('[role="tabpanel"]')];
function select(index) {
tabs.forEach((tab, i) => {
tab.setAttribute('aria-selected', String(i === index));
tab.tabIndex = i === index ? 0 : -1;
panels[i].hidden = i !== index;
});
tabs[index].focus();
}
tabs.forEach((tab, i) => tab.addEventListener('click', () => select(i)));
root.querySelector('[role="tablist"]').addEventListener('keydown', (event) => {
const key = (event).key;
const step = key === 'ArrowRight' ? 1 : key === 'ArrowLeft' ? -1 : 0;
if (step === 0) {
return;
}
select((tabs.indexOf(document.activeElement) + step + tabs.length) % tabs.length);
});
});
</script>
.fl-tabs{font-family:var(--feega-font);font-size:var(--feega-text-body);line-height:1.5;letter-spacing:var(--feega-tracking);color:var(--feega-fg);background:var(--feega-bg);-webkit-font-smoothing:antialiased}
:where(.fl-tabs) *,:where(.fl-tabs) *::before,:where(.fl-tabs) *::after{box-sizing:border-box}
:where(.fl-tabs) :is(h1,h2,h3,h4,p,ul,ol,figure,blockquote,dl,dd){margin:0}
:where(.fl-tabs) a{color:inherit;text-decoration:none}
:where(.fl-tabs) :focus-visible{outline:2px solid var(--feega-focus);outline-offset:3px}
.fl-tabs{padding:var(--feega-space-6) var(--feega-gutter)}
.fl-tabs .list{display:inline-flex;gap:2px;max-width:100%;padding:4px;overflow-x:auto;border-radius:var(--feega-radius-full);background:var(--feega-surface)}
.fl-tabs .tab{min-height:34px;padding:0 var(--feega-space-4);border:0;border-radius:var(--feega-radius-full);background:transparent;color:var(--feega-fg-muted);font:inherit;font-size:var(--feega-text-sm);font-weight:500;letter-spacing:var(--feega-tracking);white-space:nowrap;cursor:pointer;transition:background-color var(--feega-dur) var(--feega-ease),color var(--feega-dur-fast) var(--feega-ease),box-shadow var(--feega-dur) var(--feega-ease)}
.fl-tabs .tab:hover{color:var(--feega-fg)}
.fl-tabs .tab[aria-selected="true"]{background:var(--feega-raised);color:var(--feega-fg);box-shadow:var(--feega-shadow)}
.fl-tabs .panel{display:grid;gap:var(--feega-space-2);max-width:36rem;padding:var(--feega-space-6) var(--feega-space-2);animation:fl-tabs-in var(--feega-dur) var(--feega-ease)}
.fl-tabs .panel[hidden]{display:none}
.fl-tabs .panel h3{font-size:var(--feega-text-xl);font-weight:500;letter-spacing:-0.04em}
.fl-tabs .panel p{color:var(--feega-fg-muted)}
@keyframes fl-tabs-in{from{opacity:0;transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){:where([class^="fl-"]) *,:where([class^="fl-"]) *::before,:where([class^="fl-"]) *::after{animation:none!important;transition:none!important}}
tokens.css, the shared file every template reads
:root,
[data-theme="light"] {
color-scheme: light;
--feega-bg: #f7f6f2;
--feega-surface: #efede7;
--feega-raised: #ffffff;
--feega-input: #ffffff;
--feega-fg: #121212;
--feega-fg-muted: #5c5a55;
--feega-fg-subtle: #6d6a63;
--feega-line: #e2dfd7;
--feega-line-strong: #cdc9bf;
--feega-dot: #d3cfc5;
--feega-accent: #ff4f00;
--feega-accent-hover: #ff6a26;
--feega-accent-fg: #121212;
--feega-accent-soft: #ffe8dc;
--feega-accent-text: #b83800;
--feega-danger: #c0231a;
--feega-danger-fg: #ffffff;
--feega-danger-soft: #fde6e3;
--feega-success: #12703a;
--feega-success-soft: #e0f3e6;
--feega-focus: #ff4f00;
--feega-overlay: rgb(18 18 18 / 0.4);
--feega-shadow: 0 1px 2px rgb(18 18 18 / 0.05), 0 8px 24px -8px rgb(18 18 18 / 0.12);
--feega-shadow-float: 0 2px 4px rgb(18 18 18 / 0.06), 0 24px 48px -12px rgb(18 18 18 / 0.22);
--feega-radius-xs: 2px;
--feega-radius-sm: 6px;
--feega-radius-md: 10px;
--feega-radius-lg: 16px;
--feega-radius-full: 999px;
--feega-font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--feega-font-display: var(--feega-font);
--feega-font-mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
--feega-tracking: -0.02em;
--feega-tracking-tight: -0.05em;
--feega-text-xs: 0.75rem;
--feega-text-sm: 0.875rem;
--feega-text-body: 1rem;
--feega-text-lg: clamp(1.0625rem, 1.6vw, 1.25rem);
--feega-text-xl: 1.5rem;
--feega-text-title: clamp(2.5rem, 6vw, 4.5rem);
--feega-text-display: clamp(3rem, 9.5vw, 7rem);
--feega-ease: cubic-bezier(0.16, 1, 0.3, 1);
--feega-dur-fast: 160ms;
--feega-dur: 420ms;
--feega-space-1: 0.25rem;
--feega-space-2: 0.5rem;
--feega-space-3: 0.75rem;
--feega-space-4: 1rem;
--feega-space-6: 1.5rem;
--feega-space-8: 2rem;
--feega-space-12: 3rem;
--feega-space-16: 4rem;
--feega-space-section: clamp(4.5rem, 11vw, 9rem);
--feega-gutter: clamp(1rem, 4vw, 2rem);
--feega-max-width: 76rem;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
color-scheme: dark;
--feega-bg: #050505;
--feega-surface: #121212;
--feega-raised: #1a1a1a;
--feega-input: #0d0d0d;
--feega-fg: #f0eee9;
--feega-fg-muted: #a3a09a;
--feega-fg-subtle: #8a877f;
--feega-line: #232323;
--feega-line-strong: #363636;
--feega-dot: #2c2c2c;
--feega-accent: #ff5a14;
--feega-accent-hover: #ff7333;
--feega-accent-fg: #121212;
--feega-accent-soft: #2b1206;
--feega-accent-text: #ff7a3d;
--feega-danger: #ff6b5e;
--feega-danger-fg: #121212;
--feega-danger-soft: #2e0f0c;
--feega-success: #4cc47a;
--feega-success-soft: #0d2617;
--feega-focus: #ff5a14;
--feega-overlay: rgb(0 0 0 / 0.7);
--feega-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 8px 24px -8px rgb(0 0 0 / 0.6);
--feega-shadow-float: 0 2px 4px rgb(0 0 0 / 0.5), 0 24px 48px -12px rgb(0 0 0 / 0.8);
}
}
[data-theme="dark"] {
color-scheme: dark;
--feega-bg: #050505;
--feega-surface: #121212;
--feega-raised: #1a1a1a;
--feega-input: #0d0d0d;
--feega-fg: #f0eee9;
--feega-fg-muted: #a3a09a;
--feega-fg-subtle: #8a877f;
--feega-line: #232323;
--feega-line-strong: #363636;
--feega-dot: #2c2c2c;
--feega-accent: #ff5a14;
--feega-accent-hover: #ff7333;
--feega-accent-fg: #121212;
--feega-accent-soft: #2b1206;
--feega-accent-text: #ff7a3d;
--feega-danger: #ff6b5e;
--feega-danger-fg: #121212;
--feega-danger-soft: #2e0f0c;
--feega-success: #4cc47a;
--feega-success-soft: #0d2617;
--feega-focus: #ff5a14;
--feega-overlay: rgb(0 0 0 / 0.7);
--feega-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 8px 24px -8px rgb(0 0 0 / 0.6);
--feega-shadow-float: 0 2px 4px rgb(0 0 0 / 0.5), 0 24px 48px -12px rgb(0 0 0 / 0.8);
}
what it is
Tabs is a free component. Accessible tablist with arrow-key navigation. It is tagged tabs and navigation.
It has behaviour: a few lines of script in the plain HTML version, and framework state in the Svelte, React and Vue versions.
Size per version: Svelte 1 file, 50 lines; React 2 files, 56 lines; Vue 1 file, 50 lines; Astro 1 file, 60 lines; HTML 2 files, 55 lines.
tokens this template reads
| Token | Controls | Uses |
|---|---|---|
| --feega-ease | the animation curve | 4 |
| --feega-dur | the animation duration | 3 |
| --feega-fg | main text | 3 |
| --feega-fg-muted | secondary text | 2 |
| --feega-radius-full | fully round pills and buttons | 2 |
| --feega-space-2 | spacing step 2 | 2 |
| --feega-space-6 | spacing step 6 | 2 |
| --feega-tracking | letter spacing for body text | 2 |
| --feega-bg | the page background | 1 |
| --feega-dur-fast | the short animation duration | 1 |
| --feega-focus | the keyboard focus ring | 1 |
| --feega-font | the body typeface | 1 |
To restyle it, set any of these custom properties on :root, or on an ancestor of the template to change it in one place only. For example, --feega-accent changes the brand colour in light and dark alike. Add the shared tokens.css once per project.
fonts
It uses Inter Tight (400, 500, 600) from Google Fonts. Without them the font tokens fall back to a system stack.
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600&display=swap" />insert with Feega
Open Add, then Library, and click Insert or drag it into your running app. Feega writes the component, tokens and fonts for your framework. One undo. how it works
Free VS Code extension. No account, no AI.
get feega →