조건부 노출

Conditional reveal

사용자가 입력한 값에 반응해, 그 값에 맞는 다음 선택지(예: 이메일을 적으면 "메일로 받기")만 그 자리에서 나타나게 하는 점진적 공개.

다른 이름: Conditional logicContextual revealDependent field입력에 따른 노출
···
html
<div class="card">
  <label>Email<div class="inp"><span id="t"></span><i class="caret"></i></div></label>
  <div class="opt" id="opt"><span class="box" id="box"></span>메일로 사본 받기</div>
  <button>Submit</button>
</div>
css
.card{width:min(86%,360px);padding:5%;border:1px solid var(--line);border-radius:14px;background:var(--surface);display:flex;flex-direction:column;gap:10px;font:600 clamp(10px,3.4vmin,14px) sans-serif;color:var(--fg)}
.inp{margin-top:4px;height:2.4em;border:1px solid var(--line);border-radius:8px;background:var(--bg);display:flex;align-items:center;padding:0 10px;font-weight:500}
.caret{width:1px;height:1.2em;background:var(--fg);margin-left:1px;animation:bl 1s steps(1) infinite}
@keyframes bl{50%{opacity:0}}
.opt{display:flex;align-items:center;gap:8px;max-height:0;opacity:0;overflow:hidden;transition:max-height .4s ease,opacity .4s ease;font-weight:500}
.opt.on{max-height:3em;opacity:1}
.box{width:1.1em;height:1.1em;border:1.5px solid var(--accent);border-radius:4px;display:inline-block;transition:background .3s}
.box.on{background:var(--accent)}
button{align-self:flex-start;border:0;border-radius:8px;padding:.6em 1.2em;background:var(--accent);color:#fff;font:inherit}
js
const text='hello@atlas.dev',t=document.getElementById('t'),opt=document.getElementById('opt'),box=document.getElementById('box');
const wait=ms=>new Promise(r=>setTimeout(r,ms));
(async()=>{for(;;){t.textContent='';opt.classList.remove('on');box.classList.remove('on');await wait(900);
  for(const ch of text){t.textContent+=ch;await wait(110);if(t.textContent==='hello@atlas.dev')opt.classList.add('on')}
  await wait(700);box.classList.add('on');await wait(1800);
  while(t.textContent.length){t.textContent=t.textContent.slice(0,-1);await wait(35);if(t.textContent.indexOf('@')<0)opt.classList.remove('on')}
  await wait(500)}})();

점진적 공개(→ progressive-disclosure)가 "더 보기"를 누르면 펼쳐지는 방식이라면, 조건부 노출은 **사용자의 입력이 열쇠**입니다. 이메일 칸에 주소를 적기 전에는 "메일로 받기" 옵션이 없고, 유효한 주소가 들어오는 순간 옵션이 부드럽게 나타납니다. 사용자는 단추를 찾지 않아도 다음 단계가 알아서 열립니다.

만들 때 지킬 점이 셋 있습니다. 첫째, **트리거가 분명해야** 합니다(유효한 이메일 형식일 때, 특정 항목을 선택했을 때). 둘째, 나타나는 요소가 **레이아웃을 밀어내지 않게** 자리를 예약하거나 부드럽게 펼칩니다. 셋째, 값을 지우면 **다시 사라지고**, 이미 입력한 하위 값은 보존할지 정합니다.

접근성도 챙겨야 합니다. 새로 나타난 요소는 스크린 리더가 알 수 있게 `aria-live` 영역이나 `aria-expanded`/`aria-controls` 로 알려 주세요.

언제 쓰나

가입·결제·문의 폼처럼 입력에 따라 다음 질문이 달라질 때. 선택지가 숨어 있는 걸 사용자가 모를 수 있으니 핵심 경로는 처음부터 보이게 두세요.

페이지로 열기 ↗

항목 추가 요청

아틀라스에 없는 용어·효과·컴포넌트를 알려 주세요. 하나씩 보고 추가합니다.