탐색

v2.1.0
폼

칩

필터나 삭제할 수 있는 값을 나타내는 작은 알약 모양의 컴포넌트입니다.

이 페이지의 내용

칩은 선택지나 값을 나타내는 작은 알약 모양의 컴포넌트입니다. 양끝이 정확한 반원이어서 배지와 구분됩니다. 배지는 정보를 표시하고, 칩은 조작할 수 있습니다. 필터 칩은 네이티브 체크박스나 라디오 버튼을 감싸는 <label>입니다. 기본 상태에서는 표면이 살짝 올라와 있고, 선택하면 체크박스처럼 잉크 색으로 채워집니다.

칩

<fieldset class="flex flex-wrap gap-xs m(0) p(0) b(0)">  <legend class="mb-xs text-sm fg-text-strong">Topics</legend>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="design" checked>Design  </label>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="engineering">Engineering  </label>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="research" checked>Research  </label>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="legal" disabled>Legal  </label></fieldset>
<fieldset className="flex flex-wrap gap-xs m(0) p(0) b(0)">  <legend className="mb-xs text-sm fg-text-strong">Topics</legend>  <label className="chip">    <input type="checkbox" className="chip-input" name="topic" value="design" defaultChecked />Design  </label>  <label className="chip">    <input type="checkbox" className="chip-input" name="topic" value="engineering" />Engineering  </label>  <label className="chip">    <input type="checkbox" className="chip-input" name="topic" value="research" defaultChecked />Research  </label>  <label className="chip">    <input type="checkbox" className="chip-input" name="topic" value="legal" disabled />Legal  </label></fieldset>
<fieldset class="flex flex-wrap gap-xs m(0) p(0) b(0)">  <legend class="mb-xs text-sm fg-text-strong">Topics</legend>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="design" checked>Design  </label>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="engineering">Engineering  </label>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="research" checked>Research  </label>  <label class="chip">    <input type="checkbox" class="chip-input" name="topic" value="legal" disabled>Legal  </label></fieldset>
<template>  <fieldset class="flex flex-wrap gap-xs m(0) p(0) b(0)">    <legend class="mb-xs text-sm fg-text-strong">Topics</legend>    <label class="chip">      <input type="checkbox" class="chip-input" name="topic" value="design" checked>Design    </label>    <label class="chip">      <input type="checkbox" class="chip-input" name="topic" value="engineering">Engineering    </label>    <label class="chip">      <input type="checkbox" class="chip-input" name="topic" value="research" checked>Research    </label>    <label class="chip">      <input type="checkbox" class="chip-input" name="topic" value="legal" disabled>Legal    </label>  </fieldset></template>

#단일 선택

라디오 버튼이 같은 name 값을 공유하면 칩을 하나만 선택할 수 있으며, 방향키로 칩 사이를 이동합니다. 선택지가 적고 선택 즉시 화면이 바뀌는 경우에 사용하세요. 폼에서 값을 고를 때는 세그먼트 컨트롤이 하나의 컨트롤로 인식됩니다.

단일 선택

<div class="flex flex-wrap gap-xs" role="radiogroup" aria-label="Period">  <label class="chip"><input type="radio" class="chip-input" name="period" checked>Today</label>  <label class="chip"><input type="radio" class="chip-input" name="period">7 days</label>  <label class="chip"><input type="radio" class="chip-input" name="period">30 days</label>  <label class="chip"><input type="radio" class="chip-input" name="period">All time</label></div>
<div className="flex flex-wrap gap-xs" role="radiogroup" aria-label="Period">  <label className="chip">    <input type="radio" className="chip-input" name="period" defaultChecked />Today  </label>  <label className="chip"><input type="radio" className="chip-input" name="period" />7 days</label>  <label className="chip"><input type="radio" className="chip-input" name="period" />30 days</label>  <label className="chip">    <input type="radio" className="chip-input" name="period" />All time  </label></div>
<div class="flex flex-wrap gap-xs" role="radiogroup" aria-label="Period">  <label class="chip"><input type="radio" class="chip-input" name="period" checked>Today</label>  <label class="chip"><input type="radio" class="chip-input" name="period">7 days</label>  <label class="chip"><input type="radio" class="chip-input" name="period">30 days</label>  <label class="chip"><input type="radio" class="chip-input" name="period">All time</label></div>
<template>  <div class="flex flex-wrap gap-xs" role="radiogroup" aria-label="Period">    <label class="chip"><input type="radio" class="chip-input" name="period" checked>Today</label>    <label class="chip"><input type="radio" class="chip-input" name="period">7 days</label>    <label class="chip"><input type="radio" class="chip-input" name="period">30 days</label>    <label class="chip"><input type="radio" class="chip-input" name="period">All time</label>  </div></template>

#값

입력 요소가 없는 칩은 수신자, 태그, 적용된 필터 같은 값을 나타냅니다. 기본 상태에서는 칩 색조와 윤곽선 하나로 표시됩니다. chip-remove는 칩 끝에 붙는 원형 버튼입니다. 버튼 이름에 칩의 값을 포함하세요. 칩 앞에 아이콘을 배치할 때는 아이콘에 icon 클래스를 지정하세요.

값

<span class="chip">  ada@example.com<button type="button" class="chip-remove" aria-label="Remove ada@example.com">    <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">  alan@example.com<button type="button" class="chip-remove" aria-label="Remove alan@example.com">    <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">  <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.5365 3L11.4635 3A1 1 0 0 1 12.2548 4.6114L9.4587 8.2299A1 1 0 0 0 9.25 8.8413L9.25 11.323A1 1 0 0 1 8.6214 12.2514L7.875 12.55A0.8203 0.8203 0 0 1 6.75 11.7883L6.75 8.8413A1 1 0 0 0 6.5413 8.2299L3.7452 4.6114A1 1 0 0 1 4.5365 3Z" />  </svg> Status: Ready</span>
import XIcon from '@master/icons-react/native/16/soft/x'import FilterIcon from '@master/icons-react/native/16/soft/filter'<>  <span className="chip">    ada@example.com<button type="button" className="chip-remove" aria-label="Remove ada@example.com">      <XIcon className="icon" />    </button>  </span>  <span className="chip">    alan@example.com<button type="button" className="chip-remove" aria-label="Remove alan@example.com">      <XIcon className="icon" />    </button>  </span>  <span className="chip"><FilterIcon className="icon" /> Status: Ready</span></>
<script>  import XIcon from '@master/icons-svelte/native/16/soft/x'  import FilterIcon from '@master/icons-svelte/native/16/soft/filter'</script><span class="chip">  ada@example.com<button type="button" class="chip-remove" aria-label="Remove ada@example.com">    <XIcon class="icon" />  </button></span><span class="chip">  alan@example.com<button type="button" class="chip-remove" aria-label="Remove alan@example.com">    <XIcon class="icon" />  </button></span><span class="chip"><FilterIcon class="icon" /> Status: Ready</span>
<script setup>import XIcon from '@master/icons-vue/native/16/soft/x'import FilterIcon from '@master/icons-vue/native/16/soft/filter'</script><template>  <span class="chip">    ada@example.com<button type="button" class="chip-remove" aria-label="Remove ada@example.com">      <XIcon class="icon" />    </button>  </span>  <span class="chip">    alan@example.com<button type="button" class="chip-remove" aria-label="Remove alan@example.com">      <XIcon class="icon" />    </button>  </span>  <span class="chip"><FilterIcon class="icon" /> Status: Ready</span></template>

#그림, 점, 개수

칩에는 순서대로 그림(chip-media, 칩이 크기와 둥근 모양을 맞추는 아바타나 아이콘), 카테고리 점(chip-dot), 텍스트(chip-label), 개수(chip-count를 지정한 배지), 삭제 버튼(아이콘을 담는 chip-remove)을 넣을 수 있습니다. 공간이 부족하면 텍스트가 먼저 줄어들어 말줄임표로 끝나며, 그림과 개수와 버튼은 크기를 유지합니다. 시작 부분의 그림과 끝 부분의 개수는 칩의 끝에서 위아래 가장자리와 같은 거리만큼 떨어져 있으므로 곡선이 동심원을 이룹니다.

그림, 점, 개수

<span class="chip">  <span class="chip-media">    <span class="avatar"><img class="avatar-image" src="/demo/portrait-1.svg" alt></span>  </span><span class="chip-label">Ada Lovelace</span><button type="button" class="chip-remove" aria-label="Remove Ada Lovelace">    <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">  <span class="chip-media"><span class="avatar" aria-hidden="true">GH</span></span><span class="chip-label">Grace Hopper</span><button type="button" class="chip-remove" aria-label="Remove Grace Hopper">    <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 max-w(176)" title="Accessibility review for the checkout">  <span class="chip-dot"></span><span class="chip-label">Accessibility review for the checkout</span><span class="badge chip-count">12</span></span>
import XIcon from '@master/icons-react/native/16/soft/x'<>  <span className="chip">    <span className="chip-media">      <span className="avatar">        <img className="avatar-image" src="/demo/portrait-1.svg" alt="" />      </span>    </span><span className="chip-label">Ada Lovelace</span><button type="button" className="chip-remove" aria-label="Remove Ada Lovelace">      <XIcon className="icon" />    </button>  </span>  <span className="chip">    <span className="chip-media"><span className="avatar" aria-hidden="true">GH</span></span><span className="chip-label">Grace Hopper</span><button type="button" className="chip-remove" aria-label="Remove Grace Hopper">      <XIcon className="icon" />    </button>  </span>  <span className="chip max-w(176)" title="Accessibility review for the checkout">    <span className="chip-dot"></span><span className="chip-label">Accessibility review for the checkout</span><span className="badge chip-count">12</span>  </span></>
<script>  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><span class="chip">  <span class="chip-media">    <span class="avatar"><img class="avatar-image" src="/demo/portrait-1.svg" alt></span>  </span><span class="chip-label">Ada Lovelace</span><button type="button" class="chip-remove" aria-label="Remove Ada Lovelace">    <XIcon class="icon" />  </button></span><span class="chip">  <span class="chip-media"><span class="avatar" aria-hidden="true">GH</span></span><span class="chip-label">Grace Hopper</span><button type="button" class="chip-remove" aria-label="Remove Grace Hopper">    <XIcon class="icon" />  </button></span><span class="chip max-w(176)" title="Accessibility review for the checkout">  <span class="chip-dot"></span><span class="chip-label">Accessibility review for the checkout</span><span class="badge chip-count">12</span></span>
<script setup>import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <span class="chip">    <span class="chip-media">      <span class="avatar"><img class="avatar-image" src="/demo/portrait-1.svg" alt></span>    </span><span class="chip-label">Ada Lovelace</span><button type="button" class="chip-remove" aria-label="Remove Ada Lovelace">      <XIcon class="icon" />    </button>  </span>  <span class="chip">    <span class="chip-media"><span class="avatar" aria-hidden="true">GH</span></span><span class="chip-label">Grace Hopper</span><button type="button" class="chip-remove" aria-label="Remove Grace Hopper">      <XIcon class="icon" />    </button>  </span>  <span class="chip max-w(176)" title="Accessibility review for the checkout">    <span class="chip-dot"></span><span class="chip-label">Accessibility review for the checkout</span><span class="badge chip-count">12</span>  </span></template>

개수는 배지이므로 배지의 재질을 유지합니다. 단, 선택한 필터에서는 잉크 색의 톤을 사용합니다.

필터의 개수

<div class="flex flex-wrap gap-xs" role="group" aria-label="Status">  <label class="chip">    <input type="checkbox" class="chip-input" checked>Open <span class="badge chip-count">24</span>  </label>  <label class="chip">    <input type="checkbox" class="chip-input">In review <span class="badge chip-count">7</span>  </label>  <label class="chip">    <input type="checkbox" class="chip-input">Closed <span class="badge chip-count">132</span>  </label></div>
<div className="flex flex-wrap gap-xs" role="group" aria-label="Status">  <label className="chip">    <input type="checkbox" className="chip-input" defaultChecked />Open <span className="badge chip-count">24</span>  </label>  <label className="chip">    <input type="checkbox" className="chip-input" />In review <span className="badge chip-count">7</span>  </label>  <label className="chip">    <input type="checkbox" className="chip-input" />Closed <span className="badge chip-count">132</span>  </label></div>
<div class="flex flex-wrap gap-xs" role="group" aria-label="Status">  <label class="chip">    <input type="checkbox" class="chip-input" checked>Open <span class="badge chip-count">24</span>  </label>  <label class="chip">    <input type="checkbox" class="chip-input">In review <span class="badge chip-count">7</span>  </label>  <label class="chip">    <input type="checkbox" class="chip-input">Closed <span class="badge chip-count">132</span>  </label></div>
<template>  <div class="flex flex-wrap gap-xs" role="group" aria-label="Status">    <label class="chip">      <input type="checkbox" class="chip-input" checked>Open <span class="badge chip-count">24</span>    </label>    <label class="chip">      <input type="checkbox" class="chip-input">In review <span class="badge chip-count">7</span>    </label>    <label class="chip">      <input type="checkbox" class="chip-input">Closed <span class="badge chip-count">132</span>    </label>  </div></template>

필터 칩은 입력 요소를 감싼 레이블이므로 칩 전체가 조작 대상입니다. 필터 칩에는 삭제 버튼을 넣지 마세요. 삭제할 수 있는 값은 chip-remove가 있는 일반 칩으로 작성합니다.

#카테고리 색상

chip-category는 칩 자체나 그 상위 요소에 지정된 카테고리 색상을 읽습니다. 값 칩에는 카테고리의 표면색, 텍스트 색, 선 색이 적용됩니다. 필터 칩은 살짝 올라온 표면과 선택 시의 잉크 색을 유지하므로 어느 카테고리에서든 선택 상태가 같은 방식으로 표시되며, 카테고리는 chip-dot으로 나타냅니다.

카테고리 색상

<div class="flex flex-col items-center gap-sm">  <div class="flex flex-wrap justify-center gap-xs">    <span class="chip chip-category category-violet">      <span class="chip-dot"></span>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 chip-category category-teal">      <span class="chip-dot"></span>Design system<button type="button" class="chip-remove" aria-label="Remove Design system">        <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>  </div>  <div class="flex flex-wrap justify-center gap-xs" role="group" aria-label="Projects">    <label class="chip chip-category category-violet">      <input type="checkbox" class="chip-input" checked><span class="chip-dot"></span>Research    </label>    <label class="chip chip-category category-teal">      <input type="checkbox" class="chip-input"><span class="chip-dot"></span>Design system    </label>    <label class="chip chip-category category-orange">      <input type="checkbox" class="chip-input"><span class="chip-dot"></span>Launch    </label>  </div></div>
import XIcon from '@master/icons-react/native/16/soft/x'<div className="flex flex-col items-center gap-sm">  <div className="flex flex-wrap justify-center gap-xs">    <span className="chip chip-category category-violet">      <span className="chip-dot"></span>Research<button type="button" className="chip-remove" aria-label="Remove Research">        <XIcon className="icon" />      </button>    </span>    <span className="chip chip-category category-teal">      <span className="chip-dot"></span>Design system<button type="button" className="chip-remove" aria-label="Remove Design system">        <XIcon className="icon" />      </button>    </span>  </div>  <div className="flex flex-wrap justify-center gap-xs" role="group" aria-label="Projects">    <label className="chip chip-category category-violet">      <input type="checkbox" className="chip-input" defaultChecked /><span className="chip-dot"></span>Research    </label>    <label className="chip chip-category category-teal">      <input type="checkbox" className="chip-input" /><span className="chip-dot"></span>Design system    </label>    <label className="chip chip-category category-orange">      <input type="checkbox" className="chip-input" /><span className="chip-dot"></span>Launch    </label>  </div></div>
<script>  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="flex flex-col items-center gap-sm">  <div class="flex flex-wrap justify-center gap-xs">    <span class="chip chip-category category-violet">      <span class="chip-dot"></span>Research<button type="button" class="chip-remove" aria-label="Remove Research">        <XIcon class="icon" />      </button>    </span>    <span class="chip chip-category category-teal">      <span class="chip-dot"></span>Design system<button type="button" class="chip-remove" aria-label="Remove Design system">        <XIcon class="icon" />      </button>    </span>  </div>  <div class="flex flex-wrap justify-center gap-xs" role="group" aria-label="Projects">    <label class="chip chip-category category-violet">      <input type="checkbox" class="chip-input" checked><span class="chip-dot"></span>Research    </label>    <label class="chip chip-category category-teal">      <input type="checkbox" class="chip-input"><span class="chip-dot"></span>Design system    </label>    <label class="chip chip-category category-orange">      <input type="checkbox" class="chip-input"><span class="chip-dot"></span>Launch    </label>  </div></div>
<script setup>import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <div class="flex flex-col items-center gap-sm">    <div class="flex flex-wrap justify-center gap-xs">      <span class="chip chip-category category-violet">        <span class="chip-dot"></span>Research<button type="button" class="chip-remove" aria-label="Remove Research">          <XIcon class="icon" />        </button>      </span>      <span class="chip chip-category category-teal">        <span class="chip-dot"></span>Design system<button type="button" class="chip-remove" aria-label="Remove Design system">          <XIcon class="icon" />        </button>      </span>    </div>    <div class="flex flex-wrap justify-center gap-xs" role="group" aria-label="Projects">      <label class="chip chip-category category-violet">        <input type="checkbox" class="chip-input" checked><span class="chip-dot"></span>Research      </label>      <label class="chip chip-category category-teal">        <input type="checkbox" class="chip-input"><span class="chip-dot"></span>Design system      </label>      <label class="chip chip-category category-orange">        <input type="checkbox" class="chip-input"><span class="chip-dot"></span>Launch      </label>    </div>  </div></template>

#크기

chip-sm은 24px, chip-lg는 32px이며 기본값은 28px입니다. 삭제 버튼, 그림, 개수도 함께 크기가 바뀝니다. 터치 화면에서도 칩은 높이를 유지합니다. 필터 칩의 조작 영역은 칩 바깥까지 확장되어 44px에 이르고, 삭제 버튼의 조작 영역은 해당 값 칩 안에서 높이 44px에 이릅니다. 태그 입력처럼 값을 담는 필드는 칩 높이를 직접 설정합니다.

크기

<span class="chip chip-sm">  <span class="chip-dot"></span>Small<button type="button" class="chip-remove" aria-label="Remove Small">    <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">  <span class="chip-dot"></span>Medium<button type="button" class="chip-remove" aria-label="Remove 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">      <path d="M4 4L12 12" /><path d="M4 12L12 4" />    </svg>  </button></span><span class="chip chip-lg">  <span class="chip-dot"></span>Large<button type="button" class="chip-remove" aria-label="Remove Large">    <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>
import XIcon from '@master/icons-react/native/16/soft/x'<>  <span className="chip chip-sm">    <span className="chip-dot"></span>Small<button type="button" className="chip-remove" aria-label="Remove Small">      <XIcon className="icon" />    </button>  </span>  <span className="chip">    <span className="chip-dot"></span>Medium<button type="button" className="chip-remove" aria-label="Remove Medium">      <XIcon className="icon" />    </button>  </span>  <span className="chip chip-lg">    <span className="chip-dot"></span>Large<button type="button" className="chip-remove" aria-label="Remove Large">      <XIcon className="icon" />    </button>  </span></>
<script>  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><span class="chip chip-sm">  <span class="chip-dot"></span>Small<button type="button" class="chip-remove" aria-label="Remove Small">    <XIcon class="icon" />  </button></span><span class="chip">  <span class="chip-dot"></span>Medium<button type="button" class="chip-remove" aria-label="Remove Medium">    <XIcon class="icon" />  </button></span><span class="chip chip-lg">  <span class="chip-dot"></span>Large<button type="button" class="chip-remove" aria-label="Remove Large">    <XIcon class="icon" />  </button></span>
<script setup>import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <span class="chip chip-sm">    <span class="chip-dot"></span>Small<button type="button" class="chip-remove" aria-label="Remove Small">      <XIcon class="icon" />    </button>  </span>  <span class="chip">    <span class="chip-dot"></span>Medium<button type="button" class="chip-remove" aria-label="Remove Medium">      <XIcon class="icon" />    </button>  </span>  <span class="chip chip-lg">    <span class="chip-dot"></span>Large<button type="button" class="chip-remove" aria-label="Remove Large">      <XIcon class="icon" />    </button>  </span></template>

#접근성

  • 필터 칩 안의 입력 요소가 보이지 않는 상태로 칩 전체를 덮습니다. 레이블 전체가 조작 영역이 되고, 입력 요소는 상태와 키보드 동작, 폼 값을 관리합니다. 필터 칩은 <legend> 요소가 있는 <fieldset>으로 묶거나, role="radiogroup"과 레이블을 지정한 요소로 묶으세요.
  • 삭제 버튼은 아이콘의 위치를 그대로 유지하면서 조작 영역을 28px로 넓힙니다. 터치 화면에서는 이 조작 영역의 높이가 44px가 되며, 해당 값 칩의 끝을 넘어가지 않습니다.
  • 카테고리 점은 장식 요소입니다. 카테고리는 칩의 텍스트로 전달합니다.
  • 선택한 칩은 moonstone에서 잉크 색으로, obsidian에서 진주색으로 표시됩니다. 두 색 모두 무채색이므로 색상을 구별하지 않아도 선택 상태를 알아볼 수 있습니다.

#클래스

클래스설명
chip높이 28px의 알약 모양입니다. chip-input을 감싼 레이블이거나 값을 담은 일반 요소입니다. 터치 화면에서는 알약 모양은 높이를 유지하고, 필터 칩과 삭제 버튼의 조작 영역만 높이 44px까지 넓어집니다.
chip-sm높이 24px입니다. 기본값은 28px입니다.적용할 클래스는 chip입니다
chip-lg높이 32px입니다. 기본값은 28px입니다.적용할 클래스는 chip입니다
chip-category값 칩은 칩 자체나 그 상위 요소에 지정한 category-<name> 클래스의 카테고리에서 표면색, 텍스트 색, 선 색을 가져옵니다. 필터 칩은 표면을 유지하고 chip-dot으로 카테고리를 표시합니다.적용할 클래스는 chip입니다
chip-input필터 칩 안의 체크박스 또는 라디오 버튼입니다. 입력 요소가 칩 전체를 보이지 않게 덮으며, 레이블이 조작 대상이 되고 입력 요소가 상태를 유지합니다.
chip-remove값 끝에 있는 원형 제거 버튼으로, 아이콘을 담습니다. 접근 가능한 이름에 해당 값을 포함합니다
chip-label텍스트입니다. 공간이 부족하면 가장 먼저 줄어들어 말줄임표로 끝나므로, 그림, 개수, 삭제 버튼은 크기를 유지합니다.
chip-media시작 부분의 원형 그림으로, 크기는 칩 높이에서 안쪽 여백 두 개를 뺀 값입니다. 아바타나 아이콘을 담고 그 크기를 맞춥니다.
chip-dot카테고리의 표시색으로 칠한 8px 점이며, 카테고리가 없으면 흐린 잉크 색입니다. 장식 요소이므로 카테고리 이름은 레이블로 전달합니다.
chip-count칩 안의 배지에 지정합니다. 배지를 칩과 동심원을 이루는 알약 모양으로 맞추고, 선택한 필터에서는 잉크 색 톤을 적용합니다.

#사용자 지정 속성

속성기본값설명
--chip-height1.75rem높이. 값을 담는 필드는 오목한 영역 안의 칩 높이를 직접 설정합니다
--chip-inset.25remchip-media나 chip-count가 칩 끝에서 안쪽으로 떨어진 거리

#소스

@master/ui/components/chip.css
/* * Chip: a small pill that is a choice or a value. * As a label around a checkbox or a radio it is a filter: raised at rest, filled with ink when chosen, * the way a checkbox fills. As a plain element it is a value that can carry a remove button. * A chip is 28px tall (24px small, 32px large); its ends are true half circles, which tells it apart from a badge. * * Inside, a chip may hold a picture at its start (chip-media), a category dot (chip-dot), its words (chip-label, * which shrinks and ends in an ellipsis), a count (a badge with chip-count) and a remove button. The words give * way first; the picture, the count and the button keep their size. With chip-category a value takes its * category's surface, text and line, and a filter keeps its raised face and shows the category in its dot. */@layer components.ui {  .chip {    --chip-height: 1.75rem;    --chip-padding-x: .625rem;    --chip-font-size: .78125rem;    --chip-inset: .25rem;    --chip-remove-size: 1.25rem;    --icon-size: .875rem;    --icon-offset: -.0625rem;    position: relative;    display: inline-flex;    flex-shrink: 0;    align-items: center;    gap: .375rem;    min-height: var(--chip-height);    margin: 0;    padding: 0 var(--chip-padding-x);    border: 0;    border-radius: 999px;    corner-shape: round;    background: var(--color-surface-chip);    color: var(--color-text-strong);    box-shadow: inset 0 0 0 .5px var(--color-line-contour);    font: var(--font-weight-control) var(--chip-font-size)/1 var(--font-family-sans);    font-feature-settings: inherit;    white-space: nowrap;    vertical-align: middle;    -webkit-tap-highlight-color: transparent;    &.chip-sm {      --chip-height: 1.5rem;      --chip-padding-x: .5rem;      --chip-font-size: .71875rem;      --chip-inset: .1875rem;      --chip-remove-size: 1rem;      --icon-size: .75rem;      gap: .3125rem;    }    &.chip-lg {      --chip-height: 2rem;      --chip-padding-x: .75rem;      --chip-font-size: .84375rem;      --chip-remove-size: 1.5rem;      --icon-size: 1rem;      gap: .4375rem;    }    /* A value of a category: its tinted surface, its text and its line. */    &.chip-category {      --chip-dot: var(--category-mark, var(--color-text-muted));      &:not(:has(.chip-input)) {        background: var(--category-surface, var(--color-surface-chip));        color: var(--category-text, var(--color-text-strong));        box-shadow: inset 0 0 0 .5px var(--category-line, var(--color-line-contour));      }    }    /* Long words stop at the container's edge and end in an ellipsis. */    &:has(.chip-label) {      max-width: 100%;    }    /* A picture at the start stands as far from the end as from the top and bottom, so the curves are concentric. */    &:has(.chip-media:first-child) {      padding-inline-start: var(--chip-inset);    }    /* A count at the end, likewise: it is 2px shorter than two insets leave, so it stands 1px further in. */    &:has(.chip-count:last-child) {      padding-inline-end: calc(var(--chip-inset) + .0625rem);    }    /* A chip that holds a .chip-input is a control: a small raised sheet that lifts under the pointer. */    &:has(.chip-input) {      --chip-lift: var(--lift);      @apply --surface-sheet;      box-shadow: var(--shadow-raised);      user-select: none;      -webkit-user-select: none;      cursor: pointer;      touch-action: manipulation;      transition-property: box-shadow, translate, color;      transition-duration: var(--duration-quick);      transition-timing-function: var(--easing-glide);      /*       * A chosen filter is kept out of forced colors; the depth of hover and press, more specific than the       * system colors below, would show through there, so it is drawn only where colors are the theme's.       */      @media (hover: hover) and (forced-colors: none) {        &:hover:not(:has(.chip-input:disabled)) {          translate: 0 calc(-1 * var(--chip-lift));          box-shadow: var(--shadow-raised-hover);        }      }      /* Pressed: a filter sinks into the well, as a button does; a chosen one into the ink's own pressed face. */      &:active:not(:has(.chip-input:disabled)) {        translate: 0 var(--chip-lift);        transition-duration: var(--duration-press);        @media (forced-colors: none) {          background: var(--color-surface-inset);          box-shadow: var(--shadow-pressed);          &:has(.chip-input:checked) {            @apply --control-ink-pressed;          }        }      }    }    /* Chosen: ink, with the same line of light a checked checkbox has. */    &:has(.chip-input:checked) {      background: var(--color-surface-inverse);      color: var(--color-text-inverse);      box-shadow:        inset 0 .5px 0 var(--color-ink-highlight),        0 0 0 .5px var(--color-ink-edge),        0 1px 2px -1px var(--color-shade-1), 0 2px 4px -2px var(--color-shade-2);      @media (hover: hover) and (forced-colors: none) {        &:hover:not(:has(.chip-input:disabled)) {          box-shadow:            inset 0 .5px 0 var(--color-ink-highlight),            0 0 0 .5px var(--color-ink-edge),            0 1px 2px -1px var(--color-shade-1), 0 3px 6px -3px var(--color-shade-2), 0 6px 12px -6px var(--color-shade-3);        }      }    }    &:has(.chip-input:focus-visible) {      @apply --focus-ring;    }    /*     * The keys are on a value's remove button: the whole value wears the ring, since Backspace or Delete there     * removes all of it, and the cross takes the pressed tone that says what the key will do.     */    &:has(.chip-remove:focus-visible) {      @apply --focus-ring;    }    &:has(.chip-input:disabled) {      background: var(--color-surface-inset);      color: var(--color-text-disabled);      box-shadow: var(--shadow-flat);      cursor: not-allowed;    }    /*     * Chosen and disabled: the fill stays, in the disabled ink, so a choice that cannot be changed still reads as     * made, as a scale's chosen cell and a checked checkbox do.     */    &:has(.chip-input:checked:disabled) {      background: var(--color-text-disabled);      color: var(--color-surface-raised);      box-shadow: none;    }    /* A remove button stands as far from the pill's end as from its top and bottom, so the two circles are concentric. */    &:has(.chip-remove) {      padding-inline-end: calc((var(--chip-height) - var(--chip-remove-size)) / 2);    }    /* On touch a filter's target reaches 44px around it; the pill keeps its height and its half circles. */    @media (pointer: coarse) {      &:has(.chip-input)::after {        @apply --touch-target;      }    }    @media (prefers-reduced-motion: reduce) {      &:has(.chip-input) {        --chip-lift: 0px;      }    }    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;      &:has(.chip-input:checked) {        background: Highlight;        color: HighlightText;        box-shadow: none;        forced-color-adjust: none;      }      &:has(.chip-input:disabled) {        outline-color: GrayText;        color: GrayText;      }      /* Chosen and disabled: the fill takes the disabled system color, as a checkbox's does. */      &:has(.chip-input:checked:disabled) {        background: GrayText;        color: Canvas;      }      /* A chosen filter is kept out of forced colors, so its ring is given the system's color here. */      &:has(.chip-input:focus-visible, .chip-remove:focus-visible) {        outline: 2px solid Highlight;        outline-offset: 2px;      }    }  }  /* The checkbox or radio inside a chip covers it invisibly: the label is the target, the input keeps the state. */  .chip-input {    position: absolute;    inset: 0;    width: 100%;    height: 100%;    margin: 0;    padding: 0;    border: 0;    border-radius: inherit;    corner-shape: inherit;    opacity: 0;    appearance: none;    cursor: inherit;  }  /* The words of a chip: they shrink first and end in an ellipsis. */  .chip-label {    min-width: 0;    overflow: hidden;    /* A line as tall as the letters would clip their descenders; the chip centers the taller line, so nothing moves. */    line-height: 1.25;    text-overflow: ellipsis;  }  /*   * A picture at the start of a chip: an avatar, a flag or a logo, the chip's height less two insets, round.   * Put an avatar or an icon inside; this part sizes them.   */  .chip-media {    --chip-media-size: calc(var(--chip-height) - 2 * var(--chip-inset));    --icon-size: calc(var(--chip-media-size) - .25rem);    display: inline-grid;    flex: none;    place-items: center;    width: var(--chip-media-size);    height: var(--chip-media-size);    border-radius: 999px;    corner-shape: round;    overflow: hidden;    .avatar {      --avatar-size: var(--chip-media-size);    }  }  /*   * A dot that marks the chip's category, in its mark color, or muted ink without one. A hairline of the chip's own   * text keeps it found on any face, an ink one included.   */  .chip-dot {    flex: none;    width: .5rem;    height: .5rem;    border-radius: 999px;    corner-shape: round;    background: var(--chip-dot, var(--color-text-muted));    box-shadow: inset 0 0 0 .5px color-mix(in oklab, currentColor 30%, transparent);    @media (forced-colors: active) {      background: CanvasText;      forced-color-adjust: none;    }  }  /*   * A count inside a chip: put it on a badge, which keeps its material, and this part fits it to the chip, as a   * pill concentric with the chip's end. On a chosen filter it takes a tone of the ink.   */  .chip .chip-count {    --badge-height: calc(var(--chip-height) - 2 * var(--chip-inset) - .125rem);    --badge-padding-x: .375rem;    --badge-font-size: .6875rem;    --badge-radius: 999px;    corner-shape: round;  }  .chip:has(.chip-input:checked) .chip-count {    background: color-mix(in oklab, currentColor 16%, transparent);    color: inherit;    box-shadow: none;  }  /* Removes the value; give it an accessible name that includes the value. */  .chip-remove {    position: relative;    display: inline-grid;    flex: none;    place-items: center;    width: var(--chip-remove-size);    height: var(--chip-remove-size);    margin: 0;    padding: 0;    border: 0;    border-radius: 999px;    corner-shape: round;    background: transparent;    color: var(--color-text-muted);    appearance: none;    -webkit-tap-highlight-color: transparent;    cursor: pointer;    touch-action: manipulation;    /* The glyph is the button's icon. It takes no pointer of its own, so a press is the button's. */    .icon {      pointer-events: none;      width: calc(var(--chip-remove-size) * .6);      margin: 0;      height: calc(var(--chip-remove-size) * .6);    }    /*     * The target reaches past the glyph without moving it: 28px, and on touch 44px tall, reaching back over the     * words but no further than the pill's own end, so it never lands on the next chip.     */    &::after {      content: '';      position: absolute;      inset: -.25rem;      @media (pointer: coarse) {        inset-block: calc((2.75rem - var(--chip-remove-size)) / -2);        inset-inline: calc((2.75rem - var(--chip-remove-size)) / -2) calc((var(--chip-height) - var(--chip-remove-size)) / -2);      }    }    @media (hover: hover) {      &:hover:not(:disabled) {        background: var(--color-line-contour);        color: var(--color-text-strong);      }    }    /* Pressed: a firmer tone than the pointer's, so a tap is answered where there is no pointer. */    &:active:not(:disabled) {      background: var(--color-line-strong);      color: var(--color-text-strong);    }    &:focus-visible {      outline: none;      background: var(--color-line-strong);      color: var(--color-text-strong);    }    /* A value that cannot be removed: the cross in disabled ink, answering neither pointer nor press. */    &:disabled {      color: var(--color-text-disabled);      cursor: not-allowed;    }    @media (forced-colors: active) {      .icon {        color: ButtonText;      }      &:disabled .icon {        color: GrayText;      }      &:focus-visible {        outline: 2px solid Highlight;        outline-offset: 0;      }    }  }}