@@ -130,9 +130,46 @@ Show only the text by setting `display` to `"text-only"`:
130130<ResourceBadge type = " document" display = " text-only" />
131131```
132132
133+ ## Custom Content
134+
135+ By default, Resource Badge displays the label associated with the ` type ` . You can pass ` children ` to override that label.
136+
137+ This _ may_ be used to display the name of a resource on the badge, though displaying names separately is generally preferred.
138+
139+ <div className = " flex items-center gap-3" >
140+ <ResourceBadge type = " model" >claude-opus-4-7</ResourceBadge >
141+ <ResourceBadge type = " dataset" >Dataset Group</ResourceBadge >
142+ <ResourceBadge type = " credential" >aws-prod-key</ResourceBadge >
143+ </div >
144+
145+ ### Usage
146+
147+ ``` tsx
148+ <ResourceBadge type = " model" >claude-opus-4-7</ResourceBadge >
149+ ```
150+
151+ ## Closable
152+
153+ Set ` closeable ` and provide a ` handleClosable ` callback to render a close button on the badge. This is useful for representing active filters or selections that the user can dismiss.
154+
155+ ### Usage
156+
157+ ``` tsx
158+ <ResourceBadge
159+ type = " dataset"
160+ closeable
161+ handleClosable = { () => removeFilter (" dataset" )}
162+ >
163+ customer-events-2026
164+ </ResourceBadge >
165+ ```
166+
133167## Props
134168
135- | Name | Description | Type | Default | Required |
136- | --------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
137- | ` 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" ` | | ✅ |
138- | ` display ` | Controls what elements are displayed: icon, text, or both. | ` "both" ` , ` "text-only" ` , ` "icon-only" ` | ` "both" ` | ❌ |
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 ` | | ❌ |
0 commit comments