Skip to content

Commit a14aeba

Browse files
committed
feat: add closeLabel prop and harden Badge close button
1 parent 2f9d609 commit a14aeba

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

packages/demo/src/content/components/resource-badge.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ Set `closeable` and provide a `handleClosable` callback to render a close button
166166

167167
## Props
168168

169-
| Name | Description | Type | Default | Required |
170-
| ---------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------- |
171-
| `type` | The resource type that determines the badge variant, icon, and label. | `"agent"`, `"benchmark"`, `"benchmark-result"`, `"binary"`, `"certificate"`, `"code"`, `"compute"`, `"config"`, `"credential"`, `"database"`, `"dataset"`, `"document"`, `"guardrail"`, `"media"`, `"model"`, `"prompt"`, `"reasoning"`, `"skill"`, `"system-prompt"`, `"token"`, `"tool"`, `"unknown"` | ||
172-
| `display` | Controls what elements are displayed: icon, text, or both. | `"both"`, `"text-only"`, `"icon-only"` | `"both"` ||
173-
| `children` | Custom content to display in place of the default type label. | `ReactNode` | ||
174-
| `closeable` | When true, displays a close button on the badge. | `boolean` | `false` ||
175-
| `handleClosable` | Callback called when the close button is clicked. | `() => void` | ||
176-
| `closeLabel` | Accessible label (`aria-label`) for the close button. | `string` | `"Remove"` ||
169+
| Name | Description | Type | Default | Required |
170+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------- |
171+
| `type` | The resource type that determines the badge variant, icon, and label. | `"agent"`, `"benchmark"`, `"benchmark-result"`, `"binary"`, `"certificate"`, `"code"`, `"compute"`, `"config"`, `"credential"`, `"database"`, `"dataset"`, `"document"`, `"guardrail"`, `"media"`, `"model"`, `"prompt"`, `"reasoning"`, `"skill"`, `"system-prompt"`, `"token"`, `"tool"`, `"unknown"` | ||
172+
| `display` | Controls what elements are displayed: icon, text, or both. | `"both"`, `"text-only"`, `"icon-only"` | `"both"` ||
173+
| `children` | Custom content to display in place of the default type label. | `ReactNode` | ||
174+
| `closeable` | When true, displays a close button on the badge. | `boolean` | `false` ||
175+
| `handleClosable` | Callback called when the close button is clicked. Provide this whenever `closeable` is true, otherwise the button is a no-op. | `() => void` | ||
176+
| `closeLabel` | Accessible label (`aria-label`) for the close button. | `string` | `"Remove"` ||

0 commit comments

Comments
 (0)