Tab Bar

탭 바

A fixed row of 3–5 icon-plus-label buttons at the bottom of the screen; whichever is selected is also the top-level screen you are looking at.

Also known as: Bottom navigation하단 내비게이션
···
html
<div class="stage"><div class="phone"><div class="notch"></div><div class="screen" id="screen">
<div class="content">
  <div class="tabpanel active">Home feed</div>
  <div class="tabpanel">Search</div>
  <div class="tabpanel">Likes</div>
  <div class="tabpanel">Profile</div>
</div>
<div class="tabbar">
  <button class="tab active"><span class="ic ic0"></span>Home</button>
  <button class="tab"><span class="ic ic1"></span>Search</button>
  <button class="tab"><span class="ic ic2"></span>Likes</button>
  <button class="tab"><span class="ic ic3"></span>Profile</button>
</div></div><div class="home"></div></div></div>
css
.stage{position:absolute;inset:0;display:grid;place-items:center;overflow:hidden}
.phone{position:relative;height:90vmin;max-height:640px;aspect-ratio:9/19.5;background:#08080c;
  border-radius:20%/8.6%;box-shadow:0 0 0 2px rgba(255,255,255,.08) inset,0 12px 30px rgba(0,0,0,.35)}
.phone .notch{position:absolute;left:50%;top:0;transform:translateX(-50%);width:38%;height:5.6%;
  background:#08080c;border-radius:0 0 46% 46%;z-index:80}
.phone .screen{position:absolute;top:7.6%;left:3%;right:3%;bottom:3%;border-radius:11%/4.6%;overflow:hidden;
  background:var(--surface);color:var(--fg)}
.phone .home{position:absolute;left:50%;bottom:1.1%;transform:translateX(-50%);width:32%;height:3px;
  border-radius:2px;background:rgba(255,255,255,.45);z-index:80}
.pfx{position:absolute;left:0;top:0;width:16px;height:16px;margin:-8px 0 0 -8px;border-radius:50%;
  background:color-mix(in srgb,var(--accent) 55%,transparent);
  box-shadow:0 0 0 6px color-mix(in srgb,var(--accent) 15%,transparent);pointer-events:none;z-index:999;
  transition:opacity .2s}
.pfx.hold{width:30px;height:30px;margin:-15px 0 0 -15px;
  box-shadow:0 0 0 9px color-mix(in srgb,var(--accent) 20%,transparent);
  transition:width .5s linear,height .5s linear,margin .5s linear,box-shadow .5s linear,opacity .2s}

.content{position:absolute;inset:0 0 15%;display:grid}
.tabpanel{grid-area:1/1;display:none;place-items:center;font-weight:700;font-size:clamp(9px,3.4vmin,13px);color:var(--muted)}
.tabpanel.active{display:grid}
.tabbar{position:absolute;left:0;right:0;bottom:0;height:15%;display:grid;grid-auto-flow:column;
  border-top:1px solid var(--line);background:var(--surface)}
.tab{border:none;background:none;display:grid;justify-items:center;align-content:center;gap:3px;
  font-size:clamp(4.5px,1.7vmin,6.5px);color:var(--muted);font-weight:600;padding:0;transition:transform .12s}
.tab.active{color:var(--accent)}
.ic{width:clamp(6px,3.6vmin,11px);height:clamp(6px,3.6vmin,11px);border-radius:30%;background:currentColor;opacity:.85}
.ic1{border-radius:50%}
.ic2{border-radius:50% 50% 50% 4%;transform:rotate(-45deg)}
.ic3{border-radius:50%;box-shadow:inset 0 0 0 1.6px var(--bg)}
js
const pfx=document.createElement('div');pfx.className='pfx';document.body.appendChild(pfx);
const screenEl=document.getElementById('screen');
let pfxAuto=true;
function pfxHide(){pfx.style.opacity='0';}
addEventListener('pointerdown',()=>{pfxAuto=false;pfxHide();},{capture:true});
function pfxAt(fx,fy){
  const r=screenEl.getBoundingClientRect();
  const x=r.left+r.width*fx, y=r.top+r.height*fy;
  pfx.style.transform='translate('+x+'px,'+y+'px)';
  return {x,y};
}
function pfxWalk(x0,y0,x1,y1,ms){
  return new Promise(res=>{
    const start=performance.now();
    function step(now){
      if(!pfxAuto) return res();
      const p=Math.min(1,(now-start)/ms), e=1-Math.pow(1-p,3);
      pfxAt(x0+(x1-x0)*e, y0+(y1-y0)*e);
      if(p<1) requestAnimationFrame(step); else res();
    }
    requestAnimationFrame(step);
  });
}
function pfxWait(ms){
  return new Promise(res=>{
    const start=performance.now();
    function step(now){ if(!pfxAuto) return res(); if(now-start<ms) requestAnimationFrame(step); else res(); }
    requestAnimationFrame(step);
  });
}

const tabs=[...document.querySelectorAll('.tab')];
const panels=[...document.querySelectorAll('.tabpanel')];
function setTab(i){
  tabs.forEach((t,j)=>t.classList.toggle('active',j===i));
  panels.forEach((p,j)=>p.classList.toggle('active',j===i));
}
tabs.forEach((t,i)=>t.addEventListener('pointerdown',()=>{ pfxAuto=false; pfxHide(); setTab(i); }));
async function autoSeq(){
  let i=0;
  while(pfxAuto){
    const t=tabs[i], r=t.getBoundingClientRect(), sr=screenEl.getBoundingClientRect();
    const fx=(r.left+r.width/2-sr.left)/sr.width, fy=(r.top+r.height/2-sr.top)/sr.height;
    await pfxWalk(fx,fy,fx,fy,350); if(!pfxAuto)break;
    setTab(i);
    t.style.transform='scale(.82)'; await pfxWait(110); t.style.transform='';
    await pfxWait(600);
    i=(i+1)%tabs.length;
  }
}
autoSeq();

A tab bar represents "which top-level section am I in," not a screen you navigate to. So tapping a tab shouldn't push a new screen — each tab keeps its own content, scroll position, and navigation stack alive independently, and switching just changes which one is visible (commonly by toggling `display` or stacking views). That way scrolling down the home tab, visiting search, and coming back leaves the scroll position untouched.

iOS calls this a Tab Bar, managed by `UITabBarController`; Android calls it Bottom Navigation, managed by Material's `BottomNavigationView`. The name and fine print — icon size, badge placement, item limits — differ by platform, but the role is the same: an always-visible top-level table of contents.

Past five items the icons get cramped and any single tab becomes hard to read at a glance. Rather than bundling the overflow into a "more" tab, it's usually better to keep only what's genuinely used often on the bar and move the rest somewhere else — settings, a profile menu.

When to use

Use it for an app with 3–5 top-level sections spanning the whole experience — home, search, notifications, profile. For switching sub-categories within a single screen, a segmented control fits better.