입력 필드
표면을 파낸 듯한 텍스트 입력 필드와 레이블, 힌트, 오류, 입력 그룹.
이 페이지의 내용
텍스트 입력 필드는 표면을 파낸 듯한 오목한 영역으로, 0.5px 두께의 윤곽선으로 둘러싸입니다. 포커스를 받으면 주변 표면과 같은 높이로 올라오고, 전경색 윤곽선 하나와 은은한 후광이 나타납니다. <input>과 <textarea>에는 .input을, 필드를 감싸는 <label>에는 .field를 사용하세요.
입력 필드
<label class="field"> Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"></label><label className="field"> Email <input className="input" type="email" autoComplete="email" placeholder="you@example.com" /></label><label class="field"> Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"></label><template> <label class="field"> Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"> </label></template>#힌트와 오류
aria-describedby로 힌트나 오류를 해당 필드에 연결하고, 유효하지 않은 값은 aria-invalid="true"로 표시하세요. field-error는 필드가 유효하지 않을 때만 힌트 대신 표시되므로, 처음부터 둘 다 마크업에 넣어 둘 수 있습니다.
힌트와 오류
<div class="field"> <label for="project-name">Project name</label> <input class="input" id="project-name" value="atlas" aria-describedby="name-hint"> <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span></div><div class="field"> <label for="project-domain">Domain</label> <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error"> <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span></div><> <div className="field"> <label htmlFor="project-name">Project name</label> <input className="input" id="project-name" defaultValue="atlas" aria-describedby="name-hint" /> <span className="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span> </div> <div className="field"> <label htmlFor="project-domain">Domain</label> <input className="input" id="project-domain" defaultValue="atlas" aria-invalid="true" aria-describedby="domain-error" /> <span className="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span> </div></><div class="field"> <label for="project-name">Project name</label> <input class="input" id="project-name" value="atlas" aria-describedby="name-hint"> <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span></div><div class="field"> <label for="project-domain">Domain</label> <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error"> <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span></div><template> <div class="field"> <label for="project-name">Project name</label> <input class="input" id="project-name" value="atlas" aria-describedby="name-hint"> <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span> </div> <div class="field"> <label for="project-domain">Domain</label> <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error"> <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span> </div></template>#브라우저 기본 유효성 검사
스크립트 없이도 브라우저 자체의 제약 조건에 따라 같은 상태가 표시됩니다. required, type, pattern 중 하나가 지정된 필드에는 :user-invalid를 통해 오류 윤곽선이 표시됩니다. 이 선택자는 사용자가 필드를 편집하거나 폼 제출을 시도한 뒤에만 유효하지 않은 필드에 적용되며, 폼을 처음 열었을 때는 적용되지 않습니다. 이때 field-error도 함께 표시됩니다.
브라우저 기본 유효성 검사
<form class="flex flex-col gap-md"> <div class="field"> <label for="work-email">Work email</label> <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error"> <span class="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span class="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" class="btn btn-primary self-start">Continue</button></form><form className="flex flex-col gap-md"> <div className="field"> <label htmlFor="work-email">Work email</label> <input className="input" id="work-email" type="email" autoComplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error" /> <span className="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span className="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" className="btn btn-primary self-start">Continue</button></form><form class="flex flex-col gap-md"> <div class="field"> <label for="work-email">Work email</label> <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error"> <span class="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span class="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" class="btn btn-primary self-start">Continue</button></form><template> <form class="flex flex-col gap-md"> <div class="field"> <label for="work-email">Work email</label> <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error"> <span class="field-hint" id="work-email-hint"> Type something that is not an email, then leave the field. </span> <span class="field-error" id="work-email-error"> Enter an email address, such as ada@example.com. </span> </div> <button type="submit" class="btn btn-primary self-start">Continue</button> </form></template>#크기
필드 높이는 32px, 38px, 44px입니다. 버튼, 선택 상자, 세그먼트 컨트롤도 같은 높이를 사용하므로 같은 크기끼리 한 줄에 놓으면 마우스를 쓰든 손가락을 쓰든 높이 차이 없이 나란히 정렬됩니다. 터치 화면에서도 필드는 높이와 글자 크기를 유지하며, 포커스를 받을 때 iOS가 페이지를 확대하지 않도록 페이지의 뷰포트에서 막습니다.
크기
<input class="input input-sm" placeholder="Small" aria-label="Small"><input class="input" placeholder="Medium" aria-label="Medium"><input class="input input-lg" placeholder="Large" aria-label="Large"><> <input className="input input-sm" placeholder="Small" aria-label="Small" /> <input className="input" placeholder="Medium" aria-label="Medium" /> <input className="input input-lg" placeholder="Large" aria-label="Large" /></><input class="input input-sm" placeholder="Small" aria-label="Small"><input class="input" placeholder="Medium" aria-label="Medium"><input class="input input-lg" placeholder="Large" aria-label="Large"><template> <input class="input input-sm" placeholder="Small" aria-label="Small"> <input class="input" placeholder="Medium" aria-label="Medium"> <input class="input input-lg" placeholder="Large" aria-label="Large"></template>#여러 줄 입력
.input을 지정한 <textarea>는 지정한 줄 수와 세로 크기 조절 손잡이를 유지합니다. 내용에 맞춰 높이가 늘어나게 하려면 input-auto를 추가하세요. field-sizing: content는 높이를 3줄에서 최대 12줄까지 조절하며, 그 이상은 스크롤로 볼 수 있습니다. 범위를 바꾸려면 --input-rows와 --input-max-rows를 설정하세요. field-sizing을 지원하지 않는 브라우저에서는 최소 높이와 손잡이가 유지됩니다.
여러 줄 입력
<label class="field"> Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea></label><label class="field"> Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea></label><> <label className="field"> Message <textarea className="input" rows={3} placeholder="A fixed height with a resize handle">{``}</textarea> </label> <label className="field"> Notes <textarea className="input input-auto" placeholder="Keep typing: this one grows with its content">{``}</textarea> </label></><label class="field"> Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea></label><label class="field"> Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea></label><template> <label class="field"> Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea> </label> <label class="field"> Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea> </label></template>#입력 그룹
input-group은 별도 스타일이 없는 필드와 그에 딸린 아이콘, 단위, 단축키 또는 버튼을 하나의 오목한 영역으로 감쌉니다. 그룹은 :has()를 통해 내부 필드의 호버, 포커스, 유효하지 않음, 비활성화 상태를 표시합니다. input-group-field는 입력 요소 자체의 의미론과 텍스트 커서를 유지합니다. 오목한 영역 어디를 눌러도 필드에 포커스가 가도록 그룹을 <label>로 만드세요.
입력 그룹
<label class="input-group"> <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="7" cy="7" r="4.5" /><path d="M10.182 10.182L14 14" /> </svg> <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects"> <kbd class="kbd">⌘K</kbd></label><label class="input-group"> <span class="input-group-addon">https://</span> <input class="input-group-field" value="atlas" aria-label="Subdomain"> <span class="input-group-addon">.master.co</span></label><label class="input-group"> <input class="input-group-field" type="number" value="24" aria-label="Timeout"> <span class="input-group-addon">seconds</span></label>import SearchIcon from '@master/icons-react/native/16/soft/search'<> <label className="input-group"> <SearchIcon className="icon" /> <input className="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects" /> <kbd className="kbd">⌘K</kbd> </label> <label className="input-group"> <span className="input-group-addon">https://</span> <input className="input-group-field" defaultValue="atlas" aria-label="Subdomain" /> <span className="input-group-addon">.master.co</span> </label> <label className="input-group"> <input className="input-group-field" type="number" defaultValue="24" aria-label="Timeout" /> <span className="input-group-addon">seconds</span> </label></><script> import SearchIcon from '@master/icons-svelte/native/16/soft/search'</script><label class="input-group"> <SearchIcon class="icon" /> <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects"> <kbd class="kbd">⌘K</kbd></label><label class="input-group"> <span class="input-group-addon">https://</span> <input class="input-group-field" value="atlas" aria-label="Subdomain"> <span class="input-group-addon">.master.co</span></label><label class="input-group"> <input class="input-group-field" type="number" value="24" aria-label="Timeout"> <span class="input-group-addon">seconds</span></label><script setup>import SearchIcon from '@master/icons-vue/native/16/soft/search'</script><template> <label class="input-group"> <SearchIcon class="icon" /> <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects"> <kbd class="kbd">⌘K</kbd> </label> <label class="input-group"> <span class="input-group-addon">https://</span> <input class="input-group-field" value="atlas" aria-label="Subdomain"> <span class="input-group-addon">.master.co</span> </label> <label class="input-group"> <input class="input-group-field" type="number" value="24" aria-label="Timeout"> <span class="input-group-addon">seconds</span> </label></template>그룹 안의 버튼은 오목한 영역의 가장자리에서 4px 안쪽에 놓이고, 모서리 반경은 오목한 영역의 모서리 반경보다 4px 작습니다. 따라서 어느 크기에서든 두 모서리의 중심이 일치합니다. 그룹에 버튼이 들어갈 때는 그룹에 <div>를 사용하세요.
버튼이 있는 입력 그룹
<form class="input-group"> <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email"> <button type="submit" class="btn btn-primary">Subscribe</button></form><div class="input-group input-group-sm"> <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link"> <button type="button" class="btn">Copy</button></div><> <form className="input-group"> <input className="input-group-field" type="email" autoComplete="email" placeholder="you@example.com" aria-label="Email" /> <button type="submit" className="btn btn-primary">Subscribe</button> </form> <div className="input-group input-group-sm"> <input className="input-group-field" defaultValue="https://atlas.dev/p/9f2c" readOnly aria-label="Share link" /> <button type="button" className="btn">Copy</button> </div></><form class="input-group"> <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email"> <button type="submit" class="btn btn-primary">Subscribe</button></form><div class="input-group input-group-sm"> <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link"> <button type="button" class="btn">Copy</button></div><template> <form class="input-group"> <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email"> <button type="submit" class="btn btn-primary">Subscribe</button> </form> <div class="input-group input-group-sm"> <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link"> <button type="button" class="btn">Copy</button> </div></template>필드와 버튼을 분리해 배치하려면 <form class="flex gap-xs">로 플렉스 행에 넣으세요.
#여러 값 입력
input-group-wrap을 사용하면 그룹에서 수신자, 태그, 필터처럼 여러 값을 입력받을 수 있습니다. 각 값은 오목한 영역 안에 칩으로 표시되고, 필드는 마지막 줄의 남은 공간을 차지합니다. 값을 더 배치할 공간이 마지막 줄에 부족하면 영역이 한 줄 늘어납니다. 칩은 영역의 가장자리에서 6px 안쪽에 놓이며, 칩과 영역의 둥근 모서리는 중심이 일치합니다.
값의 배치는 스타일시트가 처리합니다. 태그 입력은 Enter로 값을 추가하며, 빈 필드에서 Backspace를 누르면 마지막 값으로 이동하고 한 번 더 누르면 그 값을 제거합니다. 여러 값을 선택하는 콤보박스는 목록에서 값을 고릅니다.
여러 값 입력
<div class="field max-w(420) mx-auto"> <label for="input-teams">Teams</label> <div class="input-group input-group-wrap"> <span class="chip"> Design<button type="button" class="chip-remove" aria-label="Remove Design"> <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="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <span class="chip"> Research<button type="button" class="chip-remove" aria-label="Remove Research"> <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="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <span class="chip"> Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering"> <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="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <span class="chip"> Operations<button type="button" class="chip-remove" aria-label="Remove Operations"> <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="M4 4L12 12" /><path d="M4 12L12 4" /> </svg> </button> </span> <input class="input-group-field" id="input-teams" placeholder="Add a team"> </div></div>import XIcon from '@master/icons-react/native/16/soft/x'<div className="field max-w(420) mx-auto"> <label htmlFor="input-teams">Teams</label> <div className="input-group input-group-wrap"> <span className="chip"> Design<button type="button" className="chip-remove" aria-label="Remove Design"> <XIcon className="icon" /> </button> </span> <span className="chip"> Research<button type="button" className="chip-remove" aria-label="Remove Research"> <XIcon className="icon" /> </button> </span> <span className="chip"> Engineering<button type="button" className="chip-remove" aria-label="Remove Engineering"> <XIcon className="icon" /> </button> </span> <span className="chip"> Operations<button type="button" className="chip-remove" aria-label="Remove Operations"> <XIcon className="icon" /> </button> </span> <input className="input-group-field" id="input-teams" placeholder="Add a team" /> </div></div><script> import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="field max-w(420) mx-auto"> <label for="input-teams">Teams</label> <div class="input-group input-group-wrap"> <span class="chip"> Design<button type="button" class="chip-remove" aria-label="Remove Design"> <XIcon class="icon" /> </button> </span> <span class="chip"> Research<button type="button" class="chip-remove" aria-label="Remove Research"> <XIcon class="icon" /> </button> </span> <span class="chip"> Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering"> <XIcon class="icon" /> </button> </span> <span class="chip"> Operations<button type="button" class="chip-remove" aria-label="Remove Operations"> <XIcon class="icon" /> </button> </span> <input class="input-group-field" id="input-teams" placeholder="Add a team"> </div></div><script setup>import XIcon from '@master/icons-vue/native/16/soft/x'</script><template> <div class="field max-w(420) mx-auto"> <label for="input-teams">Teams</label> <div class="input-group input-group-wrap"> <span class="chip"> Design<button type="button" class="chip-remove" aria-label="Remove Design"> <XIcon class="icon" /> </button> </span> <span class="chip"> Research<button type="button" class="chip-remove" aria-label="Remove Research"> <XIcon class="icon" /> </button> </span> <span class="chip"> Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering"> <XIcon class="icon" /> </button> </span> <span class="chip"> Operations<button type="button" class="chip-remove" aria-label="Remove Operations"> <XIcon class="icon" /> </button> </span> <input class="input-group-field" id="input-teams" placeholder="Add a team"> </div> </div></template>#검색과 자동 채우기
type="search" 필드는 브라우저의 지우기 버튼을 유지하며, 버튼 모양은 아이콘 전경색의 가는 ×로 바뀝니다. 브라우저가 필드를 자동으로 채우면 브라우저 엔진의 기본 노란색이나 파란색 대신 정보 색상이 오목한 영역에 옅게 적용되어 폼 전체의 모양이 일관되게 유지됩니다.
검색
<input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search"><input className="input max-w(360) mx-auto" type="search" defaultValue="moonstone" aria-label="Search" /><input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search"><template> <input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search"></template>#파일
<input type="file">에서 브라우저 기본 버튼은 세그먼트 트랙의 옵션처럼 오목한 영역 안에 놓인 작은 볼록한 컨트롤로 표시됩니다.
파일
<label class="field">Attachment <input class="input" type="file"></label><label className="field">Attachment <input className="input" type="file" /></label><label class="field">Attachment <input class="input" type="file"></label><template> <label class="field">Attachment <input class="input" type="file"></label></template>#날짜, 시간, 숫자, 색상
.input은 브라우저 기본 날짜, 시간, 숫자, 색상 필드에도 같은 오목한 영역 스타일을 적용합니다. 선택 도구는 사용자가 기기에서 익숙하게 쓰는 플랫폼 기본 도구를 그대로 사용합니다. 색상 필드는 정사각형이며, 색상 견본은 가장자리에서 4px 안쪽에 놓이고 필드와 견본의 둥근 모서리는 중심이 일치합니다.
브라우저가 이 필드에 표시하는 작은 기호는 아이콘과 같은 선 굵기와 전경색으로 표시됩니다. 달력이나 시계 아이콘은 선택 도구를 열고, 숫자 필드의 위쪽 꺾쇠는 값을 늘리며 아래쪽 꺾쇠는 값을 줄입니다. Chromium과 Safari에서는 이 요소에 스타일을 적용할 수 있으며, Firefox에서는 기본 모양이 유지됩니다. 사용자가 값을 자주 증감해야 한다면 스테퍼를 사용하세요.
날짜, 시간, 숫자, 색상
<label class="field">Starts <input class="input" type="date" value="2026-11-11"></label><label class="field">At <input class="input" type="time" value="09:30"></label><label class="field"> Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"></label><label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label><> <label className="field"> Starts <input className="input" type="date" defaultValue="2026-11-11" /> </label> <label className="field">At <input className="input" type="time" defaultValue="09:30" /></label> <label className="field"> Timeout in seconds <input className="input" type="number" min="0" step="5" defaultValue="30" /> </label> <label className="field"> Accent <input className="input" type="color" defaultValue="#5b4fe0" /> </label></><label class="field">Starts <input class="input" type="date" value="2026-11-11"></label><label class="field">At <input class="input" type="time" value="09:30"></label><label class="field"> Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"></label><label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label><template> <label class="field">Starts <input class="input" type="date" value="2026-11-11"></label> <label class="field">At <input class="input" type="time" value="09:30"></label> <label class="field"> Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"> </label> <label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label></template>#필드 그룹
<fieldset>에 fieldset을 적용하면 관련 컨트롤을 하나의 제목 아래 묶고 브라우저 기본 홈 모양 테두리를 없앱니다. fieldset-legend 클래스는 <legend>에 필드 레이블과 같은 스타일을 적용합니다. 체크박스, 라디오 버튼, 선택 옵션을 이 구조로 감싸 그룹에 이름을 지정하세요.
필드 그룹
<fieldset class="fieldset"> <legend class="fieldset-legend">Notify me about</legend> <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label> <label class="check"> <input type="checkbox" class="checkbox" checked> Expiring certificates </label> <label class="check"><input type="checkbox" class="checkbox"> Product news</label></fieldset><fieldset className="fieldset"> <legend className="fieldset-legend">Notify me about</legend> <label className="check"> <input type="checkbox" className="checkbox" defaultChecked /> Failed deployments </label> <label className="check"> <input type="checkbox" className="checkbox" defaultChecked /> Expiring certificates </label> <label className="check"><input type="checkbox" className="checkbox" /> Product news</label></fieldset><fieldset class="fieldset"> <legend class="fieldset-legend">Notify me about</legend> <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label> <label class="check"> <input type="checkbox" class="checkbox" checked> Expiring certificates </label> <label class="check"><input type="checkbox" class="checkbox"> Product news</label></fieldset><template> <fieldset class="fieldset"> <legend class="fieldset-legend">Notify me about</legend> <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label> <label class="check"> <input type="checkbox" class="checkbox" checked> Expiring certificates </label> <label class="check"><input type="checkbox" class="checkbox"> Product news</label> </fieldset></template>#비활성화
비활성화
<div class="field"> <label for="custom-domain">Custom domain</label> <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason"> <span class="field-hint" id="custom-domain-reason">Custom domains come with the Team plan.</span></div><div className="field"> <label htmlFor="custom-domain">Custom domain</label> <input className="input" id="custom-domain" defaultValue="atlas.dev" disabled aria-describedby="custom-domain-reason" /> <span className="field-hint" id="custom-domain-reason"> Custom domains come with the Team plan. </span></div><div class="field"> <label for="custom-domain">Custom domain</label> <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason"> <span class="field-hint" id="custom-domain-reason">Custom domains come with the Team plan.</span></div><template> <div class="field"> <label for="custom-domain">Custom domain</label> <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason"> <span class="field-hint" id="custom-domain-reason"> Custom domains come with the Team plan. </span> </div></template>#React, Svelte, Vue
field 컴포넌트는 레이블, 컨트롤, 힌트, 오류를 각각의 ID로 연결합니다. 컨트롤은 페이지에서 작성한 마크업을 그대로 사용하며, 이 페이지의 나머지 구성 요소도 모두 마크업으로 구현합니다. npx master-ui add field로 컴포넌트를 프로젝트에 복사하세요. 컴포넌트의 구성과 사용법은 React, Svelte, Vue에서 확인할 수 있습니다.
#클래스
| 클래스 | 설명 |
|---|---|
input | 텍스트 입력, 파일 입력 또는 textarea를 오목한 영역으로 표시합니다. 브라우저의 날짜, 시간, 숫자, 검색, 색상 입력 필드에도 같은 스타일을 적용합니다 |
input-sm | 높이는 32px이며 기본값은 버튼 높이인 38px입니다.적용할 클래스는 input입니다 |
input-lg | 높이는 44px이며 기본값은 버튼 높이인 38px입니다.적용할 클래스는 input입니다 |
input-auto | 내용에 맞춰 --input-rows 줄에서 --input-max-rows 줄까지 늘어나는 textarea입니다. 최대 줄 수를 넘으면 스크롤됩니다.적용할 클래스는 input입니다 |
input-group | 별도 표면이 없는 필드와 그에 딸린 아이콘, 애드온 또는 버튼을 하나의 오목한 영역으로 감쌉니다. 이 영역에 내부 필드의 호버, 포커스, 유효하지 않음, 비활성화 상태가 표시됩니다 |
input-group-sm | 높이 32px인 그룹입니다. 기본 높이는 38px입니다.적용할 클래스는 input-group입니다 |
input-group-lg | 높이 44px인 그룹입니다. 기본 높이는 38px입니다.적용할 클래스는 input-group입니다 |
input-group-wrap | 여러 값을 칩으로 모으고, 칩이 줄을 넘으면 다음 줄로 늘어나는 그룹입니다. 값 추가와 제거는 페이지 자체 스크립트나 서버 요청과 응답으로 처리합니다.적용할 클래스는 input-group입니다 |
input-group-field | 그룹 안에서 별도의 표면 스타일 없이 쓰는 네이티브 입력 필드입니다. 입력 필드의 시맨틱과 텍스트 커서를 유지합니다. |
input-group-addon | 프로토콜, 단위, 도메인처럼 값 옆에 붙는 고정 텍스트 |
field | 컨트롤 위에 레이블을 쌓고, 필요하면 아래에 안내를 둡니다. 텍스트와 컨트롤만 담을 때는 label 요소를 쓰고, 힌트나 오류가 있을 때는 for가 있는 label을 담은 div를 씁니다. 안내가 컨트롤 이름의 일부가 아니라 설명이 되도록 하기 위해서입니다. |
field-hint | 컨트롤 아래에 옅은 색으로 표시하는 안내 문구입니다. 필드 안에서는 오류 메시지가 표시되는 동안 숨겨집니다. |
field-error | 오류 메시지입니다. 필드 안의 컨트롤이 유효하지 않은 동안에만 표시됩니다. |
field-help | 레이블 뒤에 두는 물음표입니다. 차분한 글자색에 점선 밑줄을 긋고 툴팁을 표시합니다. interestfor와 popovertarget으로 해당 툴팁을 가리키는 버튼입니다. 레이블과 같은 행에 나란히 두며 레이블 안에는 두지 않습니다 |
fieldset | 관련 컨트롤을 하나의 제목 아래 묶는 fieldset으로, 브라우저 기본의 오목한 테두리는 표시하지 않습니다. |
fieldset-legend | 범례는 그룹의 제목이며, 필드 레이블과 같은 스타일로 표시합니다. |
#사용자 지정 속성
| 속성 | 기본값 | 설명 |
|---|---|---|
--input-height | 2.375rem | 포인터 종류와 관계없이 적용되는 입력 필드 또는 입력 그룹의 최소 블록 크기 |
--input-padding-x | .75rem | 입력 필드 또는 입력 그룹의 인라인 방향 패딩 |
--input-font-size | .875rem | 텍스트 크기 |
--input-radius | var(--radius-control) | 모서리 반경은 10px이며, 작은 크기는 8px, 큰 크기는 12px입니다. |
--input-rows | 3 | input-auto가 적용된 textarea에 표시되는 최소 줄 수input-auto에 설정합니다 |
--input-max-rows | 12 | input-auto textarea가 스크롤되기 전까지 늘어날 수 있는 최대 줄 수input-auto에 설정합니다 |