Command Palette

Search for a command to run...

GitHub Profile
Components

Copy Button

시각·햅틱·사운드 피드백과 함께 텍스트를 클립보드에 복사해요.

Loading…

특징

  • 대기·성공·실패 상태에 따라 아이콘이 자연스럽게 전환돼요.
  • 복사에 성공하면 지원되는 기기에서 햅틱 피드백으로 알려줘요.
  • 성공과 실패를 서로 다른 사운드로 들려줘요.
  • 문자열은 물론 함수를 넘겨 동적인 내용도 복사할 수 있어요.
  • 성공·실패 이벤트에 콜백을 연결할 수 있어요.

설치

처음이라면 components.json에 @smlee 레지스트리를 한 번만 등록하세요.

{
  "registries": {
    "@smlee": "https://smlee.info/r/{name}.json"
  }
}

그다음 컴포넌트를 추가해요.

pnpm dlx shadcn@latest add @smlee/copy-button

사용법

import { CopyButton } from "@/components/copy-button"
<CopyButton text="Some text to copy" />

API 레퍼런스

CopyButton

Button에 클립보드 기능을 더한 컴포넌트예요.

속성

타입

자세한 내용은 shadcn/ui 문서를 참고하세요.

참고 자료

Command Palette

Search for a command to run...