탐색

v2.1.0
사이트 페이지

가운데 정렬

로그인이나 오류 페이지처럼 한 가지 작업을 뷰포트 중앙에 단독으로 또는 패널과 나란히 배치하는 레이아웃입니다.

가운데 정렬 레이아웃은 로그인, 주소 확인, 오류 안내처럼 한 가지 작업만 뷰포트 중앙에 배치합니다. 프레임은 페이지이므로 dvh 단위로 뷰포트 높이만큼 공간을 확보하며, 두 유틸리티가 그 안의 콘텐츠를 가운데에 정렬합니다.

가운데 정렬

<main class="page items-center justify-center p-lg bg-surface-tray fg-text-body text-sm">  <form class="sheet form w-full max-w(380) p-xl">    <header class="flex flex-col gap-3xs">      <h1 class="heading heading-lg">Sign in to Atlas</h1>      <p class="m(0) fg-text-muted">Welcome back.</p>    </header>    <label class="field">      Email<input class="input" type="email" name="email" autocomplete="username" placeholder="you@example.com" required>    </label>    <label class="field">      Password<input class="input" type="password" name="password" autocomplete="current-password" required>    </label>    <button class="btn btn-primary">Sign in</button>    <p class="m(0) text-center fg-text-muted">      New here? <a class="link" href="#">Create an account</a>    </p>  </form></main>
<main className="page items-center justify-center p-lg bg-surface-tray fg-text-body text-sm">  <form className="sheet form w-full max-w(380) p-xl">    <header className="flex flex-col gap-3xs">      <h1 className="heading heading-lg">Sign in to Atlas</h1>      <p className="m(0) fg-text-muted">Welcome back.</p>    </header>    <label className="field">      Email<input className="input" type="email" name="email" autoComplete="username" placeholder="you@example.com" required />    </label>    <label className="field">      Password<input className="input" type="password" name="password" autoComplete="current-password" required />    </label>    <button className="btn btn-primary">Sign in</button>    <p className="m(0) text-center fg-text-muted">      New here? <a className="link" href="#">Create an account</a>    </p>  </form></main>
<main class="page items-center justify-center p-lg bg-surface-tray fg-text-body text-sm">  <form class="sheet form w-full max-w(380) p-xl">    <header class="flex flex-col gap-3xs">      <h1 class="heading heading-lg">Sign in to Atlas</h1>      <p class="m(0) fg-text-muted">Welcome back.</p>    </header>    <label class="field">      Email<input class="input" type="email" name="email" autocomplete="username" placeholder="you@example.com" required>    </label>    <label class="field">      Password<input class="input" type="password" name="password" autocomplete="current-password" required>    </label>    <button class="btn btn-primary">Sign in</button>    <p class="m(0) text-center fg-text-muted">      New here? <a class="link" href="#">Create an account</a>    </p>  </form></main>
<template>  <main class="page items-center justify-center p-lg bg-surface-tray fg-text-body text-sm">    <form class="sheet form w-full max-w(380) p-xl">      <header class="flex flex-col gap-3xs">        <h1 class="heading heading-lg">Sign in to Atlas</h1>        <p class="m(0) fg-text-muted">Welcome back.</p>      </header>      <label class="field">        Email<input class="input" type="email" name="email" autocomplete="username" placeholder="you@example.com" required>      </label>      <label class="field">        Password<input class="input" type="password" name="password" autocomplete="current-password" required>      </label>      <button class="btn btn-primary">Sign in</button>      <p class="m(0) text-center fg-text-muted">        New here? <a class="link" href="#">Create an account</a>      </p>    </form>  </main></template>

#구성

  • page items-center justify-center. 페이지는 높이가 최소한 뷰포트만큼인 열입니다. 작업이 페이지 전체를 차지하므로 이 열을 <main> 자체에 구성하고, 두 유틸리티로 콘텐츠를 가로와 세로 모두 가운데에 정렬합니다. p-lg는 휴대폰에서 카드가 화면 가장자리에 닿지 않도록 여백을 확보합니다.
  • 카드 너비는 w-full max-w(380). 카드가 휴대폰에서 가용 너비를 채우고, 화면이 넓어지면 필드를 한 열로 배치하기에 적당한 너비까지만 커집니다.
  • 트레이 위의 시트. 프레임에는 bg-surface-tray를 적용하고 카드에는 시트를 사용합니다. 페이지에서 바탕보다 높게 배치되는 요소는 카드 하나뿐입니다.
  • 카드가 뷰포트보다 높으면 페이지가 스크롤됩니다. 높이를 고정하지 않고 최소 높이만 지정하므로 가능한 동작입니다. 휴대폰에서 키보드가 열린 경우가 이에 해당합니다.

카드는 폼이기도 하며, 폼이 필드 사이의 간격을 정합니다.

#패널을 나란히 배치

md 중단점부터 프레임은 너비가 같은 두 열로 나뉩니다. 한쪽에는 작업을, 다른 쪽에는 브랜드나 인용문, 이미지를 담은 패널을 배치합니다. 이 중단점보다 좁아지면 패널이 사라지고 작업만 남습니다.

패널을 나란히 배치

<div class="page bg-surface-base fg-text-body text-sm">  <div class="grow(1) grid grid-cols(2)@md">    <main class="flex items-center justify-center p-lg">      <form class="form w-full max-w(340)">        <header class="flex flex-col gap-3xs">          <h1 class="heading heading-lg">Sign in to Atlas</h1>          <p class="m(0) fg-text-muted">Welcome back.</p>        </header>        <label class="field">          Email<input class="input" type="email" name="email" autocomplete="username" placeholder="you@example.com" required>        </label>        <label class="field">          Password<input class="input" type="password" name="password" autocomplete="current-password" required>        </label>        <button class="btn btn-primary">Sign in</button>        <p class="m(0) text-center fg-text-muted">          New here? <a class="link" href="#">Create an account</a>        </p>      </form>    </main>    <aside class="hidden flex@md flex-col justify-between p-2xl bg-surface-inverse fg-text-inverse">      <p class="m(0) flex items-center gap-xs text-md font-medium">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <circle cx="8" cy="8" r="6" /><path d="M8 4.3333A3.6667 3.6667 0 0 1 8 11.6667Z" fill="currentColor" stroke="none" />        </svg>Atlas      </p>      <figure class="m(0) flex flex-col gap-md max-w(440)">        <blockquote class="m(0)">          <p class="m(0) text-2xl">            We replaced four libraries with a stylesheet, and the interface got quieter.          </p>        </blockquote>        <figcaption class="flex items-center gap-sm text-sm">          <span class="avatar" aria-hidden="true">            <img class="avatar-image" src="/demo/people/seoyeon-kim.webp" alt width="32" height="32"><span class="avatar-fallback">SK</span>          </span>Seo-yeon Kim, Engineering at Orbit        </figcaption>      </figure>    </aside>  </div></div>
import ContrastIcon from '@master/icons-react/native/16/soft/contrast'<div className="page bg-surface-base fg-text-body text-sm">  <div className="grow(1) grid grid-cols(2)@md">    <main className="flex items-center justify-center p-lg">      <form className="form w-full max-w(340)">        <header className="flex flex-col gap-3xs">          <h1 className="heading heading-lg">Sign in to Atlas</h1>          <p className="m(0) fg-text-muted">Welcome back.</p>        </header>        <label className="field">          Email<input className="input" type="email" name="email" autoComplete="username" placeholder="you@example.com" required />        </label>        <label className="field">          Password<input className="input" type="password" name="password" autoComplete="current-password" required />        </label>        <button className="btn btn-primary">Sign in</button>        <p className="m(0) text-center fg-text-muted">          New here? <a className="link" href="#">Create an account</a>        </p>      </form>    </main>    <aside className="hidden flex@md flex-col justify-between p-2xl bg-surface-inverse fg-text-inverse">      <p className="m(0) flex items-center gap-xs text-md font-medium">        <ContrastIcon className="icon" />Atlas      </p>      <figure className="m(0) flex flex-col gap-md max-w(440)">        <blockquote className="m(0)">          <p className="m(0) text-2xl">            We replaced four libraries with a stylesheet, and the interface got quieter.          </p>        </blockquote>        <figcaption className="flex items-center gap-sm text-sm">          <span className="avatar" aria-hidden="true">            <img className="avatar-image" src="/demo/people/seoyeon-kim.webp" alt="" width="32" height="32" /><span className="avatar-fallback">SK</span>          </span>Seo-yeon Kim, Engineering at Orbit        </figcaption>      </figure>    </aside>  </div></div>
<script>  import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast'</script><div class="page bg-surface-base fg-text-body text-sm">  <div class="grow(1) grid grid-cols(2)@md">    <main class="flex items-center justify-center p-lg">      <form class="form w-full max-w(340)">        <header class="flex flex-col gap-3xs">          <h1 class="heading heading-lg">Sign in to Atlas</h1>          <p class="m(0) fg-text-muted">Welcome back.</p>        </header>        <label class="field">          Email<input class="input" type="email" name="email" autocomplete="username" placeholder="you@example.com" required>        </label>        <label class="field">          Password<input class="input" type="password" name="password" autocomplete="current-password" required>        </label>        <button class="btn btn-primary">Sign in</button>        <p class="m(0) text-center fg-text-muted">          New here? <a class="link" href="#">Create an account</a>        </p>      </form>    </main>    <aside class="hidden flex@md flex-col justify-between p-2xl bg-surface-inverse fg-text-inverse">      <p class="m(0) flex items-center gap-xs text-md font-medium">        <ContrastIcon class="icon" />Atlas      </p>      <figure class="m(0) flex flex-col gap-md max-w(440)">        <blockquote class="m(0)">          <p class="m(0) text-2xl">            We replaced four libraries with a stylesheet, and the interface got quieter.          </p>        </blockquote>        <figcaption class="flex items-center gap-sm text-sm">          <span class="avatar" aria-hidden="true">            <img class="avatar-image" src="/demo/people/seoyeon-kim.webp" alt width="32" height="32"><span class="avatar-fallback">SK</span>          </span>Seo-yeon Kim, Engineering at Orbit        </figcaption>      </figure>    </aside>  </div></div>
<script setup>import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'</script><template>  <div class="page bg-surface-base fg-text-body text-sm">    <div class="grow(1) grid grid-cols(2)@md">      <main class="flex items-center justify-center p-lg">        <form class="form w-full max-w(340)">          <header class="flex flex-col gap-3xs">            <h1 class="heading heading-lg">Sign in to Atlas</h1>            <p class="m(0) fg-text-muted">Welcome back.</p>          </header>          <label class="field">            Email<input class="input" type="email" name="email" autocomplete="username" placeholder="you@example.com" required>          </label>          <label class="field">            Password<input class="input" type="password" name="password" autocomplete="current-password" required>          </label>          <button class="btn btn-primary">Sign in</button>          <p class="m(0) text-center fg-text-muted">            New here? <a class="link" href="#">Create an account</a>          </p>        </form>      </main>      <aside class="hidden flex@md flex-col justify-between p-2xl bg-surface-inverse fg-text-inverse">        <p class="m(0) flex items-center gap-xs text-md font-medium">          <ContrastIcon class="icon" />Atlas        </p>        <figure class="m(0) flex flex-col gap-md max-w(440)">          <blockquote class="m(0)">            <p class="m(0) text-2xl">              We replaced four libraries with a stylesheet, and the interface got quieter.            </p>          </blockquote>          <figcaption class="flex items-center gap-sm text-sm">            <span class="avatar" aria-hidden="true">              <img class="avatar-image" src="/demo/people/seoyeon-kim.webp" alt width="32" height="32"><span class="avatar-fallback">SK</span>            </span>Seo-yeon Kim, Engineering at Orbit          </figcaption>        </figure>      </aside>    </div>  </div></template>
태블릿과 휴대폰에서는 패널이 사라지고 페이지에 폼만 남습니다.

grid grid-cols(2)@md로 프레임을 나누고, 패널에는 hidden flex@md를 적용합니다. 프레임 자체가 뷰포트이므로 @md로 컨테이너가 아닌 뷰포트의 너비를 기준으로 삼습니다.

패널은 잉크색 표면으로, bg-surface-inverse와 fg-text-inverse를 적용합니다. 가장 먼저 사라지는 요소이므로 문구는 몇 단어로 제한하며, 독자에게 필요한 정보는 여기에 넣지 않습니다.

#이 프레임으로 만드는 페이지

인증 페이지와 단독으로 서는 페이지는 모두 이 프레임에 다른 카드를 넣은 것입니다.

페이지카드에 넣는 것
로그인, 회원가입로그인 블록의 첫 번째 카드 또는 회원가입 카드
인증같은 블록의 코드 카드. OTP 필드를 감쌉니다
비밀번호 찾기비밀번호 재설정 블록의 카드 두 개
찾을 수 없음, 오류, 점검 중무슨 일이 일어났는지 알리고 다음으로 갈 길 하나를 제시하는 빈 상태 블록

워크스페이스 설정처럼 단계가 둘 이상인 작업에는 별도의 페이지인 다단계 작업이 있습니다.

#접근성

  • 페이지에는 <h1>이 하나 있으며, 카드 안에 있습니다.
  • 패널은 <aside>입니다. 장식만 담고 있다면 aria-hidden="true"로 보조 기술에서 숨깁니다. 인용문을 담고 있다면 콘텐츠이므로 보조 기술에서도 접근할 수 있게 둡니다.
  • 비밀번호 관리자가 필드를 채울 수 있도록 각 필드에 autocomplete 값을 지정합니다.