Search
목록·로그를 빠르게 필터링하는 검색 입력입니다. 입력 즉시 결과가 바뀌는 '필터형'과 Enter 로 조회하는 '조회형'을 구분합니다.
1. Default
아이콘 + 입력. 플레이스홀더에는 검색 대상을 씁니다.
HTML
<div class="searchbar" role="search"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg><input type="search" placeholder="정책 이름 검색" aria-label="정책 검색"></div>CSS · .searchbar, .chip, .chip-group
/* JS Design System v0.6 · .searchbar, .chip, .chip-group · 토큰(var(--*))은 assets/style.css :root 참고 */
.searchbar{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;min-width:280px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--bg-surface);transition:border-color var(--motion-fast)}
.searchbar svg{width:18px;height:18px;color:var(--text-tertiary);flex:none}
.searchbar input{flex:1;border:0;background:transparent;font:inherit;font-size:14px;color:var(--text-primary);outline:0;min-width:0}
.searchbar input::placeholder{color:var(--text-disabled)}
.searchbar:focus-within{border-color:var(--border-focus)}
.searchbar .clear{border:0;padding:0;background:var(--bg-panel);color:var(--text-secondary);width:20px;height:20px;border-radius:50%;font:inherit;font-size:12px;line-height:0;cursor:pointer;display:grid;place-items:center;flex:none}
.searchbar .clear svg{display:block;width:12px;height:12px}
.searchbar kbd{font-size:12px;color:var(--text-tertiary);border:1px solid var(--border-default);border-radius:4px;padding:1px 5px;background:var(--bg-subtle)}
.searchbar.lg{height:48px}
.searchbar.lg input{font-size:16px}
.searchbar.block{width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--radius-full);border:1px solid var(--border-strong);background:var(--bg-surface);font:inherit;font-size:12px;font-weight:500;color:var(--text-primary);cursor:pointer;white-space:nowrap;transition:background var(--motion-fast),border-color var(--motion-fast)}
.chip:hover{background:var(--bg-subtle)}
.chip.on{background:var(--accent-subtle);border-color:var(--accent);color:var(--accent-text)}
.chip[aria-pressed]::before{content:"";width:14px;height:14px;flex:none;background:var(--text-disabled);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat}
.chip.on::before{background:currentColor}
.chip .x{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--bg-panel);color:var(--text-secondary);font-size:10px;line-height:1;margin-right:-4px}
.chip .x:hover{background:var(--border-strong)}
.chip .x svg{width:10px;height:10px}
.chip.sm{height:26px;padding:0 10px;font-size:12px}
.chip[disabled]{opacity:.4;cursor:not-allowed;pointer-events:none}
.chip-group{display:flex;flex-wrap:wrap;gap:8px}
.topbar .searchbar{min-width:220px;height:36px}React · @jiran/ds-react
import { SearchBar } from "@jiran/ds-react";
export default function Example() {
return <SearchBar placeholder="정책 이름 검색" label="정책 검색" />;
}2. Shortcut / Clear
전역 검색에는 단축키(kbd)를, 값이 있을 때는 지우기 버튼을 보여줍니다.
HTML
<div class="searchbar" role="search"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg><input type="search" placeholder="이벤트, 대상, IP 검색" aria-label="검색"><kbd>/</kbd></div>
<div class="searchbar" role="search"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg><input type="search" value="랜섬웨어" aria-label="검색"><button type="button" class="clear" aria-label="지우기"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6l-12 12"/><path d="M6 6l12 12"/></svg></button></div>CSS · .searchbar, .chip, .chip-group
/* JS Design System v0.6 · .searchbar, .chip, .chip-group · 토큰(var(--*))은 assets/style.css :root 참고 */
.searchbar{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;min-width:280px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--bg-surface);transition:border-color var(--motion-fast)}
.searchbar svg{width:18px;height:18px;color:var(--text-tertiary);flex:none}
.searchbar input{flex:1;border:0;background:transparent;font:inherit;font-size:14px;color:var(--text-primary);outline:0;min-width:0}
.searchbar input::placeholder{color:var(--text-disabled)}
.searchbar:focus-within{border-color:var(--border-focus)}
.searchbar .clear{border:0;padding:0;background:var(--bg-panel);color:var(--text-secondary);width:20px;height:20px;border-radius:50%;font:inherit;font-size:12px;line-height:0;cursor:pointer;display:grid;place-items:center;flex:none}
.searchbar .clear svg{display:block;width:12px;height:12px}
.searchbar kbd{font-size:12px;color:var(--text-tertiary);border:1px solid var(--border-default);border-radius:4px;padding:1px 5px;background:var(--bg-subtle)}
.searchbar.lg{height:48px}
.searchbar.lg input{font-size:16px}
.searchbar.block{width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--radius-full);border:1px solid var(--border-strong);background:var(--bg-surface);font:inherit;font-size:12px;font-weight:500;color:var(--text-primary);cursor:pointer;white-space:nowrap;transition:background var(--motion-fast),border-color var(--motion-fast)}
.chip:hover{background:var(--bg-subtle)}
.chip.on{background:var(--accent-subtle);border-color:var(--accent);color:var(--accent-text)}
.chip[aria-pressed]::before{content:"";width:14px;height:14px;flex:none;background:var(--text-disabled);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat}
.chip.on::before{background:currentColor}
.chip .x{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--bg-panel);color:var(--text-secondary);font-size:10px;line-height:1;margin-right:-4px}
.chip .x:hover{background:var(--border-strong)}
.chip .x svg{width:10px;height:10px}
.chip.sm{height:26px;padding:0 10px;font-size:12px}
.chip[disabled]{opacity:.4;cursor:not-allowed;pointer-events:none}
.chip-group{display:flex;flex-wrap:wrap;gap:8px}
.topbar .searchbar{min-width:220px;height:36px}React · @jiran/ds-react
import { SearchBar } from "@jiran/ds-react";
export default function Example() {
return (
<>
<SearchBar placeholder="이벤트, 대상, IP 검색" shortcut="/" hotkey />
<SearchBar defaultValue="랜섬웨어" clearable />
</>
);
}3. Large / Block
빈 화면·온보딩처럼 검색이 화면의 주된 행동일 때 lg + block.
HTML
<div class="searchbar lg block" role="search" style="max-width:560px"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg><input type="search" placeholder="어떤 정책을 찾으시나요?" aria-label="검색"></div>CSS · .searchbar, .chip, .chip-group
/* JS Design System v0.6 · .searchbar, .chip, .chip-group · 토큰(var(--*))은 assets/style.css :root 참고 */
.searchbar{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;min-width:280px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--bg-surface);transition:border-color var(--motion-fast)}
.searchbar svg{width:18px;height:18px;color:var(--text-tertiary);flex:none}
.searchbar input{flex:1;border:0;background:transparent;font:inherit;font-size:14px;color:var(--text-primary);outline:0;min-width:0}
.searchbar input::placeholder{color:var(--text-disabled)}
.searchbar:focus-within{border-color:var(--border-focus)}
.searchbar .clear{border:0;padding:0;background:var(--bg-panel);color:var(--text-secondary);width:20px;height:20px;border-radius:50%;font:inherit;font-size:12px;line-height:0;cursor:pointer;display:grid;place-items:center;flex:none}
.searchbar .clear svg{display:block;width:12px;height:12px}
.searchbar kbd{font-size:12px;color:var(--text-tertiary);border:1px solid var(--border-default);border-radius:4px;padding:1px 5px;background:var(--bg-subtle)}
.searchbar.lg{height:48px}
.searchbar.lg input{font-size:16px}
.searchbar.block{width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--radius-full);border:1px solid var(--border-strong);background:var(--bg-surface);font:inherit;font-size:12px;font-weight:500;color:var(--text-primary);cursor:pointer;white-space:nowrap;transition:background var(--motion-fast),border-color var(--motion-fast)}
.chip:hover{background:var(--bg-subtle)}
.chip.on{background:var(--accent-subtle);border-color:var(--accent);color:var(--accent-text)}
.chip[aria-pressed]::before{content:"";width:14px;height:14px;flex:none;background:var(--text-disabled);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat}
.chip.on::before{background:currentColor}
.chip .x{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--bg-panel);color:var(--text-secondary);font-size:10px;line-height:1;margin-right:-4px}
.chip .x:hover{background:var(--border-strong)}
.chip .x svg{width:10px;height:10px}
.chip.sm{height:26px;padding:0 10px;font-size:12px}
.chip[disabled]{opacity:.4;cursor:not-allowed;pointer-events:none}
.chip-group{display:flex;flex-wrap:wrap;gap:8px}
.topbar .searchbar{min-width:220px;height:36px}React · @jiran/ds-react
import { SearchBar } from "@jiran/ds-react";
export default function Example() {
return <SearchBar size="lg" block placeholder="어떤 정책을 찾으시나요?" wrapperStyle={{ maxWidth: 560 }} />;
}4. With Filters
검색 + 필터 칩 조합. 선택된 칩(.on)은 결과 수와 함께 보여줍니다.
HTML
<div style="display:flex;flex-direction:column;gap:12px;width:100%;max-width:720px">
<div class="searchbar block" role="search"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg><input type="search" placeholder="로그 검색" aria-label="로그 검색"></div>
<div class="chip-group">
<button type="button" class="chip on" aria-pressed="true">Critical</button>
<button type="button" class="chip on" aria-pressed="true">High</button>
<button type="button" class="chip" aria-pressed="false">Medium</button>
<button type="button" class="chip" aria-pressed="false">Low</button>
<button type="button" class="chip" aria-pressed="false">최근 24시간</button>
</div>
</div>CSS · .searchbar, .chip, .chip-group
/* JS Design System v0.6 · .searchbar, .chip, .chip-group · 토큰(var(--*))은 assets/style.css :root 참고 */
.searchbar{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;min-width:280px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--bg-surface);transition:border-color var(--motion-fast)}
.searchbar svg{width:18px;height:18px;color:var(--text-tertiary);flex:none}
.searchbar input{flex:1;border:0;background:transparent;font:inherit;font-size:14px;color:var(--text-primary);outline:0;min-width:0}
.searchbar input::placeholder{color:var(--text-disabled)}
.searchbar:focus-within{border-color:var(--border-focus)}
.searchbar .clear{border:0;padding:0;background:var(--bg-panel);color:var(--text-secondary);width:20px;height:20px;border-radius:50%;font:inherit;font-size:12px;line-height:0;cursor:pointer;display:grid;place-items:center;flex:none}
.searchbar .clear svg{display:block;width:12px;height:12px}
.searchbar kbd{font-size:12px;color:var(--text-tertiary);border:1px solid var(--border-default);border-radius:4px;padding:1px 5px;background:var(--bg-subtle)}
.searchbar.lg{height:48px}
.searchbar.lg input{font-size:16px}
.searchbar.block{width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--radius-full);border:1px solid var(--border-strong);background:var(--bg-surface);font:inherit;font-size:12px;font-weight:500;color:var(--text-primary);cursor:pointer;white-space:nowrap;transition:background var(--motion-fast),border-color var(--motion-fast)}
.chip:hover{background:var(--bg-subtle)}
.chip.on{background:var(--accent-subtle);border-color:var(--accent);color:var(--accent-text)}
.chip[aria-pressed]::before{content:"";width:14px;height:14px;flex:none;background:var(--text-disabled);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat}
.chip.on::before{background:currentColor}
.chip .x{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--bg-panel);color:var(--text-secondary);font-size:10px;line-height:1;margin-right:-4px}
.chip .x:hover{background:var(--border-strong)}
.chip .x svg{width:10px;height:10px}
.chip.sm{height:26px;padding:0 10px;font-size:12px}
.chip[disabled]{opacity:.4;cursor:not-allowed;pointer-events:none}
.chip-group{display:flex;flex-wrap:wrap;gap:8px}
.topbar .searchbar{min-width:220px;height:36px}React · @jiran/ds-react
import { Chip, ChipGroup, SearchBar } from "@jiran/ds-react";
export default function Example() {
return (
<div style={{ display: "flex", flexDirection: "column", gap: 12, width: "100%", maxWidth: 720 }}>
<SearchBar block placeholder="로그 검색" label="로그 검색" />
<ChipGroup>
<Chip defaultSelected>Critical</Chip>
<Chip defaultSelected>High</Chip>
<Chip>Medium</Chip>
<Chip>Low</Chip>
<Chip>최근 24시간</Chip>
</ChipGroup>
</div>
);
}Props
HTML 에서는 클래스와 속성으로, React(@jiran/ds-react)에서는 같은 이름의 prop(variant · size …)으로 변형·상태를 지정합니다.
| Prop / Class | Type · Values | Default | Description |
|---|---|---|---|
| .searchbar | container | — | svg + input(+ kbd / .clear). role=search |
| size | (md) | lg | md | 높이 40 / 48 |
| kbd | element | — | 단축키 표시(전역 검색) |
| .clear | button | — | 값 지우기. 값이 있을 때만 렌더 |
Usage
React: @jiran/ds-react 패키지를 설치하고 style.css 를 한 번 import 하면 위 React 탭 코드를 그대로 쓸 수 있습니다(React Package). HTML: assets/style.css 를 연결하고(일부만 필요하면 아래 컴포넌트 CSS 복사), 동작이 필요하면 assets/ds.js 를 함께 넣습니다 — 이 페이지의 프리뷰가 그 스크립트로 동작합니다. 색은 전부 토큰(var(--accent) 등)을 참조하므로 --accent-* 만 제품 컬러로 바꾸면 됩니다.
React @jiran/ds-react
npm i @jiran/ds-react
// main.tsx — 앱 진입점에서 한 번
import "@jiran/ds-react/style.css";
// 컴포넌트
import { SearchBar } from "@jiran/ds-react";HTML
<!-- 1) 토큰 + 전체 컴포넌트 스타일 한 번에 연결 -->
<link rel="stylesheet" href="assets/style.css">
<!-- 동작(드롭다운·탭·달력·표 정렬/선택·토스트 등) — 순수 JS 한 파일. React 제품은 불필요 -->
<script src="assets/ds.js" defer></script>
<!-- 2) 또는 아래 "Component CSS" 만 프로젝트 CSS 에 붙이고,
:root 토큰은 Foundations › Design Token 에서 복사 -->Component CSS .searchbar, .chip, .chip-group
/* JS Design System v0.6 · .searchbar, .chip, .chip-group · 토큰(var(--*))은 assets/style.css :root 참고 */
.searchbar{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;min-width:280px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--bg-surface);transition:border-color var(--motion-fast)}
.searchbar svg{width:18px;height:18px;color:var(--text-tertiary);flex:none}
.searchbar input{flex:1;border:0;background:transparent;font:inherit;font-size:14px;color:var(--text-primary);outline:0;min-width:0}
.searchbar input::placeholder{color:var(--text-disabled)}
.searchbar:focus-within{border-color:var(--border-focus)}
.searchbar .clear{border:0;padding:0;background:var(--bg-panel);color:var(--text-secondary);width:20px;height:20px;border-radius:50%;font:inherit;font-size:12px;line-height:0;cursor:pointer;display:grid;place-items:center;flex:none}
.searchbar .clear svg{display:block;width:12px;height:12px}
.searchbar kbd{font-size:12px;color:var(--text-tertiary);border:1px solid var(--border-default);border-radius:4px;padding:1px 5px;background:var(--bg-subtle)}
.searchbar.lg{height:48px}
.searchbar.lg input{font-size:16px}
.searchbar.block{width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--radius-full);border:1px solid var(--border-strong);background:var(--bg-surface);font:inherit;font-size:12px;font-weight:500;color:var(--text-primary);cursor:pointer;white-space:nowrap;transition:background var(--motion-fast),border-color var(--motion-fast)}
.chip:hover{background:var(--bg-subtle)}
.chip.on{background:var(--accent-subtle);border-color:var(--accent);color:var(--accent-text)}
.chip[aria-pressed]::before{content:"";width:14px;height:14px;flex:none;background:var(--text-disabled);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 %3E%3Cpath d=%22M5 12l5 5l10 -10%22 /%3E%3C/svg%3E") center/contain no-repeat}
.chip.on::before{background:currentColor}
.chip .x{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--bg-panel);color:var(--text-secondary);font-size:10px;line-height:1;margin-right:-4px}
.chip .x:hover{background:var(--border-strong)}
.chip .x svg{width:10px;height:10px}
.chip.sm{height:26px;padding:0 10px;font-size:12px}
.chip[disabled]{opacity:.4;cursor:not-allowed;pointer-events:none}
.chip-group{display:flex;flex-wrap:wrap;gap:8px}
.topbar .searchbar{min-width:220px;height:36px}