히어로는 페이지의 첫 화면입니다. 무엇을 소개하는지, 왜 중요한지 설명하고 방문자에게 한 가지 행동을 제안합니다. 블록 너비에 따라 크기가 달라지는 디스플레이 제목을 배치하고 그 아래에 도입 문구를 둡니다. 나머지 요소는 선택 사항입니다.
히어로
<section class="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a class="badge badge-raised badge-pill" href="#"> New: preview comments<svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M13.6362 7.5189A0.4947 0.4947 0 0 0 13.5 7.5L2.4755 7.5006A0.5 0.5 0 0 0 2.4266 8.4946L2.5 8.5H13.5A0.4947 0.4947 0 0 0 13.6362 8.4811A0.7009 0.7009 0 0 0 13.6362 7.5189Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M8 4.5L13.2348 7.8313A0.2 0.2 0 0 1 13.2348 8.1687L8 11.5" /> </svg> </a> <h1 class="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p class="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-brand btn-lg" href="#">Start deploying</a> <a class="btn btn-lg" href="#">Read the docs</a> </div> <p class="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div></section>import ArrowRightIcon from '@master/icons-react/native/16/soft/arrow-right'<section className="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div className="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a className="badge badge-raised badge-pill" href="#"> New: preview comments<ArrowRightIcon className="icon" /> </a> <h1 className="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p className="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div className="flex flex-wrap justify-center gap-sm"> <a className="btn btn-brand btn-lg" href="#">Start deploying</a> <a className="btn btn-lg" href="#">Read the docs</a> </div> <p className="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div></section><script> import ArrowRightIcon from '@master/icons-svelte/native/16/soft/arrow-right'</script><section class="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a class="badge badge-raised badge-pill" href="#"> New: preview comments<ArrowRightIcon class="icon" /> </a> <h1 class="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p class="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-brand btn-lg" href="#">Start deploying</a> <a class="btn btn-lg" href="#">Read the docs</a> </div> <p class="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div></section><script setup>import ArrowRightIcon from '@master/icons-vue/native/16/soft/arrow-right'</script><template> <section class="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a class="badge badge-raised badge-pill" href="#"> New: preview comments<ArrowRightIcon class="icon" /> </a> <h1 class="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p class="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-brand btn-lg" href="#">Start deploying</a> <a class="btn btn-lg" href="#">Read the docs</a> </div> <p class="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div> </section></template>블록은 복사해서 쓰는 마크업입니다. 페이지의 글자 색상과 크기를 따르며, 미리보기에서는 body에 fg-text-body text-sm을 지정합니다. 각 블록은 크기 컨테이너이므로 자체 너비에 맞춰 레이아웃이 바뀝니다.
#구성 요소
- 너비를 제한한 단일 열의 가운데 배치.
gap-lg를 적용한 열에max-w(760) mx-auto text-center를 지정합니다. 도입 문구는 너비를 더 좁게 제한해 제목이 넓게 펼쳐져도 한 줄이 길어지지 않게 합니다. - 디스플레이 제목.
heading heading-display의 크기는 컨테이너 단위로 정합니다. 휴대전화의 열에서는 2.5rem, 넓은 열에서는 4.25rem이며, 어느 크기에서든 줄 길이가 고르게 배분됩니다. 섹션이 컨테이너 역할을 합니다. - 최대 두 가지 동작. 주 동작에는
btn-brand또는btn-primary를 사용하고, 보조 동작에는 기본 버튼이나 강조를 낮춘 버튼을 사용합니다.flex flex-wrap justify-center를 사용하면 쿼리 없이도 좁은 화면에서 버튼을 세로로 배치할 수 있습니다. - 부담을 덜어 주는 짧은 안내 문구. 사용해 보는 데 드는 비용을
text-xs fg-text-muted로 안내합니다.
브랜드 버튼은 시스템에서 유일하게 유채색을 쓰는 컨트롤입니다. 히어로에 이 버튼을 사용한다면 첫 화면에서는 이 버튼에만 유채색을 사용합니다.
#이미지가 있는 히어로
문구 아래에 그림을 배치합니다. 인화 사진에 매트를 둘러 액자에 넣듯 트레이로 그림을 감쌉니다. 이미지가 로드될 때 페이지 레이아웃이 밀리지 않도록 --figure-ratio로 이미지의 가로세로 비율을 지정합니다.
이미지가 있는 히어로
<section class="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p class="eyebrow">Deployments</p> <h1 class="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p class="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-primary btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg" href="#"> See how it works<svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M17.2077 9.4105A0.6234 0.6234 0 0 0 17 9.375L2.9693 9.3758A0.625 0.625 0 0 0 2.9083 10.6182L3 10.625H17A0.6234 0.6234 0 0 0 17.2077 10.5895A0.8258 0.8258 0 0 0 17.2077 9.4105Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M10 5.5L16.7383 9.8318A0.2 0.2 0 0 1 16.7383 10.1682L10 14.5" /> </svg> </a> </div> </div> <figure class="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img class="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt width="2000" height="1125" style="--figure-ratio: 16 / 9"> </figure></section>import ArrowRightIcon from '@master/icons-react/native/20/soft/arrow-right'<section className="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div className="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p className="eyebrow">Deployments</p> <h1 className="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p className="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div className="flex flex-wrap justify-center gap-sm"> <a className="btn btn-primary btn-lg" href="#">Start deploying</a> <a className="btn btn-quiet btn-lg" href="#"> See how it works<ArrowRightIcon className="icon" /> </a> </div> </div> <figure className="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img className="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt="" width="2000" height="1125" style={{ '--figure-ratio': '16 / 9' } as React.CSSProperties} /> </figure></section><script> import ArrowRightIcon from '@master/icons-svelte/native/20/soft/arrow-right'</script><section class="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p class="eyebrow">Deployments</p> <h1 class="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p class="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-primary btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg" href="#">See how it works<ArrowRightIcon class="icon" /></a> </div> </div> <figure class="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img class="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt width="2000" height="1125" style="--figure-ratio: 16 / 9"> </figure></section><script setup>import ArrowRightIcon from '@master/icons-vue/native/20/soft/arrow-right'</script><template> <section class="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p class="eyebrow">Deployments</p> <h1 class="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p class="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-primary btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg" href="#">See how it works<ArrowRightIcon class="icon" /></a> </div> </div> <figure class="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img class="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt width="2000" height="1125" style="--figure-ratio: 16 / 9"> </figure> </section></template>#두 열 히어로
블록 너비가 64rem 이상이면 grid-cols(2)@container(--5xl)을 적용해 문구와 이미지를 나란히 배치합니다. 그보다 좁으면 문구가 위로 오도록 세로로 배치합니다. 첫 번째 열의 콘텐츠는 시작 쪽에 정렬되어 폼을 배치하기에 적합합니다. 이 예에서는 이메일 입력 필드와 버튼을 두고, 그 아래에 부담을 덜어 주는 세 가지 안내를 글머리 기호 목록으로 배치합니다. 목록 항목은 가로로 나열되며 공간이 부족하면 다음 줄로 넘어갑니다.
두 열 히어로
<section class="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div class="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div class="flex flex-col items-start gap-lg"> <p class="eyebrow">Analytics</p> <h1 class="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p class="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Get early access</button> </form> <ul class="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li class="bullets-item">No card needed</li> <li class="bullets-item">14 regions</li> <li class="bullets-item">Cancel any time</li> </ul> </div> <figure class="figure figure-framed"> <img class="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt width="2000" height="1333" style="--figure-ratio: 3 / 2"> </figure> </div></section><section className="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div className="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div className="flex flex-col items-start gap-lg"> <p className="eyebrow">Analytics</p> <h1 className="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p className="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form className="flex flex-wrap gap-xs w-full max-w(420)"> <input className="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autoComplete="email" required /> <button className="btn btn-primary">Get early access</button> </form> <ul className="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li className="bullets-item">No card needed</li> <li className="bullets-item">14 regions</li> <li className="bullets-item">Cancel any time</li> </ul> </div> <figure className="figure figure-framed"> <img className="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt="" width="2000" height="1333" style={{ '--figure-ratio': '3 / 2' } as React.CSSProperties} /> </figure> </div></section><section class="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div class="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div class="flex flex-col items-start gap-lg"> <p class="eyebrow">Analytics</p> <h1 class="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p class="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Get early access</button> </form> <ul class="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li class="bullets-item">No card needed</li> <li class="bullets-item">14 regions</li> <li class="bullets-item">Cancel any time</li> </ul> </div> <figure class="figure figure-framed"> <img class="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt width="2000" height="1333" style="--figure-ratio: 3 / 2"> </figure> </div></section><template> <section class="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div class="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div class="flex flex-col items-start gap-lg"> <p class="eyebrow">Analytics</p> <h1 class="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p class="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Get early access</button> </form> <ul class="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li class="bullets-item">No card needed</li> <li class="bullets-item">14 regions</li> <li class="bullets-item">Cancel any time</li> </ul> </div> <figure class="figure figure-framed"> <img class="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt width="2000" height="1333" style="--figure-ratio: 3 / 2"> </figure> </div> </section></template>#접근성
- 히어로 제목은 페이지의
<h1>입니다. 페이지마다 하나만 둡니다. - 제목 위의 짧은 문구는 제목 요소가 아닌
<p>로 작성합니다. 이어지는 내용의 성격을 알려 주는 문구이며, 스크린 리더의 제목 목록은 히어로 제목부터 시작해야 합니다. - 다른 위치로 이동하는 버튼은 링크이므로
<a class="btn">을 사용합니다. 제출 버튼에는<button>을 사용합니다. - 각 섹션은
aria-labelledby를 사용해 해당 제목을 접근 가능한 이름으로 지정합니다. - 이미지가 제품을 보여 주면
alt에 이미지 내용을 설명합니다. 분위기를 연출하는 용도라면 비워 둡니다. 이 예의 이미지는 분위기를 연출하는 용도이므로alt속성을 비워 두었습니다. - 입력 필드가 하나뿐인 경우에는
aria-label을 지정합니다.required속성을 지정하면 제출하기 전에 브라우저가 어떤 입력이 빠졌는지 알려 줍니다.