Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(web): keep badge descenders inside the chip (#17913)

Lotte Verheydenf3f2d75980f6
diff --git a/web/src/components/design-system/Badge/Badge.stories.tsx b/web/src/components/design-system/Badge/Badge.stories.tsx
index db60f1778c..d02b63c5ea 100644
--- a/web/src/components/design-system/Badge/Badge.stories.tsx
+++ b/web/src/components/design-system/Badge/Badge.stories.tsx
@@ -28,6 +28,27 @@ const allColors = Object.keys({
export const Default = meta.story({});
+export const WithDescenders = meta.story({
+ parameters: {
+ controls: {
+ disable: true,
+ },
+ },
+ render: () => (
+ <div className="flex flex-wrap items-center gap-1.5">
+ <Badge
+ text="gpt-5"
+ trailingIcon={ExternalLinkIcon}
+ trailingIconTone="link"
+ />
+ <Badge
+ text="Prompt: langfuse-docs-assistant-chat - v27"
+ trailingIcon={ExternalLinkIcon}
+ />
+ </div>
+ ),
+});
+
export const WithTrailingIcon = meta.story({
name: "(Test) With Trailing Icon",
args: {
diff --git a/web/src/components/design-system/Badge/Badge.tsx b/web/src/components/design-system/Badge/Badge.tsx
index be56e58d5d..1ed6f09328 100644
--- a/web/src/components/design-system/Badge/Badge.tsx
+++ b/web/src/components/design-system/Badge/Badge.tsx
@@ -85,10 +85,10 @@ export function Badge({
}: BadgeProps) {
return (
<BadgeShell color={color} {...props}>
- {label && <span className="shrink-0">{label}</span>}
+ {label && <span className="shrink-0 py-0.5">{label}</span>}
<span
className={cn(
- "overflow-x-clip overflow-y-visible text-ellipsis whitespace-nowrap",
+ "overflow-x-clip overflow-y-visible py-0.5 text-ellipsis whitespace-nowrap",
interactive &&
"decoration-border-contrast underline decoration-dashed decoration-1 underline-offset-[3px]",
)}