reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
opt-uiopt-chartsopt-datagridopt-editoropt-calendaropt-filemanageropt-chatopt-shellbrandapp-ui
Overview205Core74Shells99Blocks32
TagInput
reopt designreopt design

A design system for the AI era

  • Docs
  • Pricing
  • Releases
  • About
  • Contact
  • Terms of Service
  • Privacy Policy

reopt Inc.Business registration no. 217-88-02453contact@reopt.ai

© 2026 reopt Inc. All rights reserved.

TagInput

Component

Add tags with Enter and remove them with Backspace.

input
Related docs
bun add @reopt-ai/opt-ui
Install and import
bash
bun add @reopt-ai/opt-ui
tsx
import { TagInput } from "@reopt-ai/opt-ui";

Live preview

Change the width and theme, then interact with the components.

100%

Controlled

ReactTypeScript

Tags: React, TypeScript

Max 5 tags

0/5

Disabled

fixedreadonly

Paste Support

Comma, semicolon, or newline separated text is auto-split into tags.

Keyboard Navigation

Use arrow keys to navigate between tags. Press Delete or Backspace to remove a focused tag. Ctrl+Z to undo, Ctrl+Shift+Z to redo.

AlphaBetaGamma

TagInput

PropTypeDefaultDescription
valuestring[]—제어 모드: 현재 태그 배열
onChange(tags: string[]) => void—태그 변경 핸들러
placeholderstring"Add tag..."입력 플레이스홀더
labelstring—입력 필드 레이블
maxTagsnumber—최대 태그 수
disabledbooleanfalse비활성화 상태
suggestionsstring[]—자동완성 드롭다운에 표시할 추천 태그 목록
delimiters(string | RegExp)[][",", ";", "\n"]붙여넣기 시 태그를 분할할 구분자 목록
allowDuplicatesbooleanfalse중복 태그 허용 여부

컴포넌트 의존 관계

깊이
▲ USED BY (1)event-meta-editorTagInput
View test results

테스트 커버리지

2026년 7월 9일18/18 통과
18성공
0실패
18전체
  • 초기 태그를 렌더링한다
  • Enter 키로 태그를 추가한다
  • 태그 삭제 버튼이 동작한다
  • maxTags 제한을 지원한다
  • label을 렌더링한다
  • suggestions 드롭다운을 표시한다
  • suggestions 클릭으로 태그를 추가한다
  • 이미 추가된 태그는 suggestions에서 제외한다
  • allowDuplicates=true면 기존 태그도 suggestions에 유지한다
  • suggestions 없이 기존 동작이 유지된다
  • 화살표 키로 태그 간 이동한다
  • 붙여넣기로 여러 태그를 추가한다
  • Backspace로 포커스된 태그를 삭제한다
  • Ctrl+Z로 실행취소한다
  • error 메시지를 표시한다
  • hint 텍스트를 표시한다
  • label 없이 aria-label만 있어도 hint를 입력에 aria-describedby로 연결한다
  • required prop이 RequiredMark를 표시한다

키보드 동작

키동작
Enter태그 추가
Backspace마지막 태그 삭제 (입력 비어있을 때)
←/→태그 간 이동 (Composite roving tabindex)
Delete포커스된 태그 삭제
Ctrl+Z실행취소
Ctrl+Shift+Z다시실행

Related components

opt-ui

Select

Core

Build a dropdown selection with Root, Label, Trigger, Popover, and Item components.

opt-ui

Combobox

Core

Build autocomplete search with an input, popover, items, groups, group labels, and an empty state.

opt-ui

Button

Core

Use accessible buttons with primary, secondary, ghost, and danger variants, three sizes, icons, loading, and aria-busy states.

opt-ui

Input

Core

Use a standalone text input with labels, errors, hints, and icons.

opt-ui

Switch

Core

Toggle a setting with three sizes and explicit accessible associations for labels and descriptions.

opt-ui

Textarea

Core

Enter multiline text with the same label, error, and hint API as Input.

PreviousDateRangePickerNextColorPicker