reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
opt-uiopt-chartsopt-datagridopt-editoropt-calendaropt-filemanageropt-chatopt-shellbrandapp-ui
Overview205Core74Shells99Blocks32
Toggle
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.

Toggle

Component

Use a two-state pressed button alone or in a ToggleGroup for single or multiple selection.

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

Live preview

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

100%

단독 Toggle

상태: 꺼짐

단일 선택 그룹 (정렬)

선택: left

다중 선택 그룹 (서식)

선택: bold

Toggle

PropTypeDefaultDescription
pressedboolean—제어 모드: 눌림 상태 (단독 사용)
defaultPressedboolean—비제어 초기 눌림 상태 (단독 사용)
onPressedChange(pressed: boolean) => void—눌림 상태 변경 콜백 (단독 사용)
valuestring—ToggleGroup 내에서 이 토글을 식별하는 값
size"sm" | "md"—크기 (기본 md)
disabledboolean—비활성화
childrenReactNode—토글 콘텐츠

ToggleGroup

PropTypeDefaultDescription
valuestring | string[]—선택 값. 단일은 string, toggleMultiple은 string[]
defaultValuestring | string[]—비제어 초기 선택 값
onValueChange(value: string | string[]) => void—선택 변경 콜백
toggleMultipleboolean—동시에 여러 개 눌림 허용
orientation"horizontal" | "vertical"—배치 방향 (기본 horizontal)
disabledboolean—그룹 전체 비활성화
childrenReactNode—Toggle 항목들
View test results

테스트 커버리지

2026년 7월 9일3/3 통과
3성공
0실패
3전체
  • 단독 토글이 클릭으로 pressed 상태를 전환한다
  • 제어 모드 pressed prop을 반영한다
  • disabled면 클릭이 무시된다

Related components

opt-ui

FieldToken

Core

Display field types with consistent glyphs and optional labels for strings, numbers, dates, IP addresses, and geographic data.

opt-ui

Facet

Core

Filter by field values while reading their counts and distribution bars. Show top values first and collapse the long tail.

opt-ui

Expression

Core

Read and edit conditions as sentences for alert rules and segment filters that need to be easy to verify.

opt-ui

TextTruncate

Core

Measure text in its actual font and available width to truncate the start, middle, or both ends while preserving the full accessible text.

opt-ui

Highlight

Core

Mark matching search terms with semantic mark elements, matching longer terms first to avoid fragmented overlaps.

opt-ui

LiveRegion

Core

Announce live updates to screen readers with throttled summaries and alternating nodes that can repeat identical messages.

PreviousOtpFieldNextAccordion