기기
스크린샷, 동영상 또는 실행 중인 데모를 감싸는 휴대전화 본체입니다.
이 페이지의 내용
기기 컴포넌트는 스크린샷, 동영상 또는 실행 중인 데모를 감싸는 휴대전화 본체입니다. 점토로 빚은 모형처럼 살짝 떠 있는 판 형태의 본체, 좁은 베젤, 화면 상단의 카메라 자리에 있는 작은 오목한 영역을 모두 같은 재질로 표현합니다. 데스크톱용 창과 마찬가지로, 프레임은 휴대전화임을 알아볼 수 있게 하고 화면 색상은 표시되는 콘텐츠에 맡깁니다.
기기
<div class="device" style="--device-width: 13.5rem"> <img class="device-screen" src="/demo/moonstone.svg" alt="A pale stone over grey hills"></div><div className="device" style={{ '--device-width': '13.5rem' } as React.CSSProperties}> <img className="device-screen" src="/demo/moonstone.svg" alt="A pale stone over grey hills" /></div><div class="device" style="--device-width: 13.5rem"> <img class="device-screen" src="/demo/moonstone.svg" alt="A pale stone over grey hills"></div><template> <div class="device" style="--device-width: 13.5rem"> <img class="device-screen" src="/demo/moonstone.svg" alt="A pale stone over grey hills"> </div></template>#화면
화면에 표시할 <img>, <video>, <iframe> 또는 마크업 블록에 device-screen 클래스를 적용하세요. 콘텐츠는 베젤 안쪽을 가득 채우며, 이미지는 화면 영역에 맞춰 잘립니다. 화면 모서리의 반지름은 본체 모서리의 반지름에서 베젤 두께를 뺀 값이므로 모서리 곡선을 따라 간격이 일정합니다.
마크업으로 만든 화면의 콘텐츠는 카메라의 오목한 영역 아래에서 시작합니다. 실제 상태 표시줄처럼 상단에 본체 너비의 약 6분의 1만큼 여백을 두세요.
마크업으로 만든 화면
<div class="device" style="--device-width: 13.5rem"> <div class="device-screen bg-surface-base flex flex-col gap-sm px(14) pt(44) pb(14)"> <p class="eyebrow">Wednesday</p> <p class="heading heading-lg">Today</p> <ul class="checklist mt(4)"> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox" checked><span class="checklist-title">Review the contract</span> </label> </li> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox"><span class="checklist-title">Call Grace at three</span> </label> </li> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox"><span class="checklist-title">Book the flight</span> </label> </li> </ul> </div></div><div className="device" style={{ '--device-width': '13.5rem' } as React.CSSProperties}> <div className="device-screen bg-surface-base flex flex-col gap-sm px(14) pt(44) pb(14)"> <p className="eyebrow">Wednesday</p> <p className="heading heading-lg">Today</p> <ul className="checklist mt(4)"> <li className="checklist-item"> <label className="checklist-label"> <input className="checkbox" type="checkbox" defaultChecked /><span className="checklist-title">Review the contract</span> </label> </li> <li className="checklist-item"> <label className="checklist-label"> <input className="checkbox" type="checkbox" /><span className="checklist-title">Call Grace at three</span> </label> </li> <li className="checklist-item"> <label className="checklist-label"> <input className="checkbox" type="checkbox" /><span className="checklist-title">Book the flight</span> </label> </li> </ul> </div></div><div class="device" style="--device-width: 13.5rem"> <div class="device-screen bg-surface-base flex flex-col gap-sm px(14) pt(44) pb(14)"> <p class="eyebrow">Wednesday</p> <p class="heading heading-lg">Today</p> <ul class="checklist mt(4)"> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox" checked><span class="checklist-title">Review the contract</span> </label> </li> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox"><span class="checklist-title">Call Grace at three</span> </label> </li> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox"><span class="checklist-title">Book the flight</span> </label> </li> </ul> </div></div><template> <div class="device" style="--device-width: 13.5rem"> <div class="device-screen bg-surface-base flex flex-col gap-sm px(14) pt(44) pb(14)"> <p class="eyebrow">Wednesday</p> <p class="heading heading-lg">Today</p> <ul class="checklist mt(4)"> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox" checked><span class="checklist-title">Review the contract</span> </label> </li> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox"><span class="checklist-title">Call Grace at three</span> </label> </li> <li class="checklist-item"> <label class="checklist-label"> <input class="checkbox" type="checkbox"><span class="checklist-title">Book the flight</span> </label> </li> </ul> </div> </div></template>#크기
본체의 너비는 280px이고 가로세로 비율은 9:19.5입니다. 너비를 직접 지정하는 대신 --device-width로 크기를 조절하세요. 모서리 반지름은 이 속성 값의 14%, 베젤 두께는 3%이므로 크기를 바꿔도 휴대전화의 형태가 유지됩니다. 구형 휴대전화나 소형 태블릿을 표현하려면 --device-ratio로 비율을 바꾸세요. 측면 버튼은 본체에서 2px 돌출되며, 요소가 양쪽으로 2px씩 더 넓어 버튼까지 포함합니다. 따라서 스크롤 영역 가장자리에 기기를 배치해도 스크롤 범위가 늘어나지 않습니다.
기기 크기
<div class="device" style="--device-width: 7rem"> <img class="device-screen" src="/demo/moonstone.svg" alt></div><div class="device" style="--device-width: 9rem"> <img class="device-screen" src="/demo/moonstone.svg" alt></div><div class="device" style="--device-width: 11rem; --device-ratio: 3 / 4"> <img class="device-screen" src="/demo/moonstone.svg" alt></div><> <div className="device" style={{ '--device-width': '7rem' } as React.CSSProperties}> <img className="device-screen" src="/demo/moonstone.svg" alt="" /> </div> <div className="device" style={{ '--device-width': '9rem' } as React.CSSProperties}> <img className="device-screen" src="/demo/moonstone.svg" alt="" /> </div> <div className="device" style={{ '--device-width': '11rem', '--device-ratio': '3 / 4' } as React.CSSProperties}> <img className="device-screen" src="/demo/moonstone.svg" alt="" /> </div></><div class="device" style="--device-width: 7rem"> <img class="device-screen" src="/demo/moonstone.svg" alt></div><div class="device" style="--device-width: 9rem"> <img class="device-screen" src="/demo/moonstone.svg" alt></div><div class="device" style="--device-width: 11rem; --device-ratio: 3 / 4"> <img class="device-screen" src="/demo/moonstone.svg" alt></div><template> <div class="device" style="--device-width: 7rem"> <img class="device-screen" src="/demo/moonstone.svg" alt> </div> <div class="device" style="--device-width: 9rem"> <img class="device-screen" src="/demo/moonstone.svg" alt> </div> <div class="device" style="--device-width: 11rem; --device-ratio: 3 / 4"> <img class="device-screen" src="/demo/moonstone.svg" alt> </div></template>#접근성
- 프레임은 장식용이므로 스크린 리더가 읽지 않습니다. 화면의 의미를 전달하려면 이미지에 인터페이스가 무엇을 보여 주는지 설명하는
alt를 지정하세요. 옆의 텍스트에 이미 같은 설명이 있다면 빈alt를 지정하세요. - 화면 안에서 실행되는 데모는 그 자체로 작은 웹페이지입니다. 조작 대상은 터치하기에 충분한 크기로 유지하고, 데모를 키보드로 조작할 수 있게 하거나 키보드 탐색에서 제외하세요.
- 강제 색상 모드에서는 본체와 카메라의 오목한 영역에 시스템 윤곽선이 표시됩니다.
- 화면 안에서 자동으로 재생되는 녹화는 소리 없이 재생하세요. 소리나 단계로 내용을 전달하는 녹화에는 자막이나 텍스트 설명도 필요합니다.
#클래스
| 클래스 | 설명 |
|---|---|
device | 본체는 너비 280px, 가로세로 비율 9:19.5의 떠 있는 표면이며, 좁은 베젤과 카메라가 들어가는 홈, 측면 버튼이 있습니다. 버튼은 본체에서 2px 돌출되지만 요소 자체의 상자 안에 들어가므로 상자 밖에는 아무것도 그려지지 않습니다. |
device-screen | 이미지, 동영상, 프레임 또는 마크업 블록에 적용하는 화면 영역입니다. 베젤 안쪽 본체를 채우며, 화면과 본체의 둥근 모서리는 같은 중심점을 공유합니다 |
#사용자 지정 속성
| 속성 | 기본값 | 설명 |
|---|---|---|
--device-width | 17.5rem | 본체의 너비입니다. 모서리 반지름과 베젤 두께는 이 너비를 기준으로 정합니다. |
--device-ratio | 9 / 19.5 | 본체의 가로세로 비율 |
--device-radius | calc(var(--device-width) * .14) | 본체 모서리의 원형 반지름 |
--device-bezel | calc(var(--device-width) * .03) | 화면을 둘러싼 프레임의 너비입니다. |