Installation
bash
npx axis-cli add feedback-buttons --agenticUsage
tsx
import { FeedbackButtons } from '@axis-ds/agentic-ui'
export function Example() {
const handleFeedback = (messageId: string, feedback: FeedbackType) => {
console.log(`Message ${messageId}: ${feedback}`)
}
return (
<FeedbackButtons
messageId="msg-1"
onFeedback={handleFeedback}
/>
)
}Interactive Demo
버튼을 클릭하여 피드백을 토글할 수 있습니다.
Sizes
Small (기본)
Medium
Initial States
None
Liked
Disliked
Props
| Prop | Type | Default | Description |
|---|---|---|---|
messageIdRequired | string | - | 메시지 고유 식별자 |
initialFeedback | "like" | "dislike" | "none" | "none" | 초기 피드백 상태 |
onFeedback | (messageId: string, feedback: FeedbackType) => void | - | 피드백 변경 콜백 |
size | "sm" | "md" | "sm" | 버튼 크기 |
className | string | - | 추가 CSS 클래스 |
messageIdRequiredType:
string메시지 고유 식별자
initialFeedbackType:
"like" | "dislike" | "none"Default:
"none"초기 피드백 상태
onFeedbackType:
(messageId: string, feedback: FeedbackType) => voidDefault:
-피드백 변경 콜백
sizeType:
"sm" | "md"Default:
"sm"버튼 크기
classNameType:
stringDefault:
-추가 CSS 클래스
Accessibility
버튼 그룹은 role="group"으로 묶이고, 각 버튼은 aria-label과 aria-pressed(선택 상태)를 가집니다.
| Key | Action |
|---|---|
| Tab | 피드백 버튼 사이를 이동합니다. |
| Enter / Space | 피드백을 선택합니다. |
- 좋아요/싫어요 버튼에 접근 가능한 이름(aria-label)이 제공됩니다.
- 선택 상태가 aria-pressed로 전달됩니다.