Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

Improve 20 component showcase blocks to Grade A (#1691)

rubyycheung1c2af1b50ea5
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.doc.mjs b/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.doc.mjs
index f1267527d8..62c570bcbc 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Avatar',
+ description:
+ 'Avatars at every size with an image, initials fallback, and a status dot. A quick visual reference for choosing the right size.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Avatar', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx
index b59242bc57..9752f0fd0a 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx
@@ -1,7 +1,19 @@
'use client';
-import {XDSAvatar} from '@xds/core/Avatar';
+import {XDSAvatar, XDSAvatarStatusDot} from '@xds/core/Avatar';
+import {XDSStack} from '@xds/core/Layout';
export default function AvatarShowcase() {
- return <XDSAvatar name="John Doe" size="medium" />;
+ return (
+ <XDSStack direction="horizontal" gap={4} vAlign="center">
+ <XDSAvatar name="Alex Kim" size="xsmall" />
+ <XDSAvatar name="Jordan Lee" size="small" />
+ <XDSAvatar name="Sam Chen" size="medium" />
+ <XDSAvatar
+ name="Taylor Nguyen"
+ size="large"
+ status={<XDSAvatarStatusDot variant="positive" label="Online" />}
+ />
+ </XDSStack>
+ );
}
diff --git a/packages/cli/templates/blocks/components/Badge/BadgeShowcase.doc.mjs b/packages/cli/templates/blocks/components/Badge/BadgeShowcase.doc.mjs
index 03c47a29c2..22869bf531 100644
--- a/packages/cli/templates/blocks/components/Badge/BadgeShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Badge/BadgeShowcase.doc.mjs
@@ -1,8 +1,11 @@
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
export const doc = {
type: 'block',
- name: 'Badge',
+ name: 'Badge — Variants',
+ description:
+ 'All semantic and color badge variants in a single view. Use semantic variants for status and color variants for categories.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Badge', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/Badge/BadgeShowcase.tsx b/packages/cli/templates/blocks/components/Badge/BadgeShowcase.tsx
index bcf0761186..1c73c8c4fe 100644
--- a/packages/cli/templates/blocks/components/Badge/BadgeShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Badge/BadgeShowcase.tsx
@@ -1,7 +1,25 @@
'use client';
import {XDSBadge} from '@xds/core/Badge';
+import {XDSStack} from '@xds/core/Layout';
export default function BadgeShowcase() {
- return <XDSBadge label="Badge" />;
+ return (
+ <XDSStack direction="vertical" gap={4} hAlign="center">
+ <XDSStack direction="horizontal" gap={2}>
+ <XDSBadge label="Neutral" variant="neutral" />
+ <XDSBadge label="Info" variant="info" />
+ <XDSBadge label="Success" variant="success" />
+ <XDSBadge label="Warning" variant="warning" />
+ <XDSBadge label="Error" variant="error" />
+ </XDSStack>
+ <XDSStack direction="horizontal" gap={2}>
+ <XDSBadge label="Blue" variant="blue" />
+ <XDSBadge label="Purple" variant="purple" />
+ <XDSBadge label="Pink" variant="pink" />
+ <XDSBadge label="Teal" variant="teal" />
+ <XDSBadge label="Orange" variant="orange" />
+ </XDSStack>
+ </XDSStack>
+ );
}
diff --git a/packages/cli/templates/blocks/components/Banner/BannerShowcase.doc.mjs b/packages/cli/templates/blocks/components/Banner/BannerShowcase.doc.mjs
index 72a99a68f6..eefe127b48 100644
--- a/packages/cli/templates/blocks/components/Banner/BannerShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Banner/BannerShowcase.doc.mjs
@@ -1,8 +1,11 @@
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
export const doc = {
type: 'block',
- name: 'Banner',
+ name: 'Banner — Statuses',
+ description:
+ 'All four status banners stacked — info, success, warning, and error. A quick visual reference for choosing the right status.',
isReady: true,
- aspectRatio: 4 / 3,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Banner', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/Banner/BannerShowcase.tsx b/packages/cli/templates/blocks/components/Banner/BannerShowcase.tsx
index 985731b7a3..1a9b047d7e 100644
--- a/packages/cli/templates/blocks/components/Banner/BannerShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Banner/BannerShowcase.tsx
@@ -1,12 +1,30 @@
'use client';
import {XDSBanner} from '@xds/core/Banner';
+import {XDSStack} from '@xds/core/Layout';
+import * as stylex from '@stylexjs/stylex';
+
+const styles = stylex.create({
+ root: {
+ maxWidth: 800,
+ },
+});
export default function BannerShowcase() {
return (
- <XDSBanner
- status="info"
- title="A new software update is available."
- />
+ <XDSStack direction="vertical" gap={3} xstyle={styles.root}>
+ <XDSBanner status="info" title="A new software update is available." />
+ <XDSBanner status="success" title="Your changes have been saved." />
+ <XDSBanner
+ status="warning"
+ title="Your trial expires in 3 days."
+ description="Upgrade to keep access to all features."
+ />
+ <XDSBanner
+ status="error"
+ title="Payment failed."
+ description="Update your billing information to continue."
+ />
+ </XDSStack>
);
}
diff --git a/packages/cli/templates/blocks/components/Breadcrumbs/BreadcrumbsShowcase.doc.mjs b/packages/cli/templates/blocks/components/Breadcrumbs/BreadcrumbsShowcase.doc.mjs
index 16ea3128c5..7995c7e059 100644
--- a/packages/cli/templates/blocks/components/Breadcrumbs/BreadcrumbsShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Breadcrumbs/BreadcrumbsShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Breadcrumbs',
+ description:
+ 'A breadcrumb trail showing page hierarchy with linked ancestors and a current page.',
isReady: true,
- aspectRatio: 4 / 3,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Breadcrumbs'],
};
diff --git a/packages/cli/templates/blocks/components/Button/ButtonShowcase.doc.mjs b/packages/cli/templates/blocks/components/Button/ButtonShowcase.doc.mjs
index 7562ce29ab..a91729bb01 100644
--- a/packages/cli/templates/blocks/components/Button/ButtonShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Button/ButtonShowcase.doc.mjs
@@ -1,8 +1,11 @@
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
export const doc = {
type: 'block',
- name: 'Button',
+ name: 'Button — Variants',
+ description:
+ 'All four button variants side by side — primary, secondary, ghost, and destructive. A quick visual reference for choosing the right variant.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Button', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/Button/ButtonShowcase.tsx b/packages/cli/templates/blocks/components/Button/ButtonShowcase.tsx
index b884ddefbc..c583ca0aae 100644
--- a/packages/cli/templates/blocks/components/Button/ButtonShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Button/ButtonShowcase.tsx
@@ -1,7 +1,15 @@
'use client';
import {XDSButton} from '@xds/core/Button';
+import {XDSStack} from '@xds/core/Layout';
export default function ButtonShowcase() {
- return <XDSButton label="Primary Button" variant="primary" />;
+ return (
+ <XDSStack direction="horizontal" gap={3} vAlign="center">
+ <XDSButton label="Primary" variant="primary" />
+ <XDSButton label="Secondary" variant="secondary" />
+ <XDSButton label="Ghost" variant="ghost" />
+ <XDSButton label="Destructive" variant="destructive" />
+ </XDSStack>
+ );
}
diff --git a/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.doc.mjs b/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.doc.mjs
index 98a6474950..58da717585 100644
--- a/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Calendar',
+ description:
+ 'An interactive single-date calendar with a selected date. Click any day to change the selection.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 1,
+ componentsUsed: ['Calendar'],
};
diff --git a/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.tsx b/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.tsx
index ef5ebed7ae..1c4c63a242 100644
--- a/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Calendar/CalendarShowcase.tsx
@@ -1,7 +1,11 @@
'use client';
+import {useState} from 'react';
import {XDSCalendar} from '@xds/core/Calendar';
+import type {ISODateString} from '@xds/core/Calendar';
export default function CalendarShowcase() {
- return <XDSCalendar mode="single" value={undefined} onChange={() => {}} />;
+ const [value, setValue] = useState<ISODateString | undefined>('2026-04-15');
+
+ return <XDSCalendar mode="single" value={value} onChange={setValue} />;
}
diff --git a/packages/cli/templates/blocks/components/Card/CardShowcase.doc.mjs b/packages/cli/templates/blocks/components/Card/CardShowcase.doc.mjs
index 2db1b20528..9c149b8fb1 100644
--- a/packages/cli/templates/blocks/components/Card/CardShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Card/CardShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Card',
+ description:
+ 'A card with a heading and body text showing the default container style.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 1,
+ componentsUsed: ['Card', 'Layout', 'Text'],
};
diff --git a/packages/cli/templates/blocks/components/Card/CardShowcase.tsx b/packages/cli/templates/blocks/components/Card/CardShowcase.tsx
index 09ce002c0f..4363fcbc51 100644
--- a/packages/cli/templates/blocks/components/Card/CardShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Card/CardShowcase.tsx
@@ -1,11 +1,19 @@
'use client';
import {XDSCard} from '@xds/core/Card';
+import {XDSStack} from '@xds/core/Layout';
+import {XDSText, XDSHeading} from '@xds/core/Text';
export default function CardShowcase() {
return (
- <XDSCard width={300}>
- <p style={{margin: 0}}>Simple content inside a card.</p>
+ <XDSCard width={320}>
+ <XDSStack direction="vertical" gap={2}>
+ <XDSHeading level={4}>Card title</XDSHeading>
+ <XDSText type="body" color="secondary">
+ Cards group related content with a border and background. Use them for
+ profiles, settings panels, or data summaries.
+ </XDSText>
+ </XDSStack>
</XDSCard>
);
}
diff --git a/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.doc.mjs b/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.doc.mjs
index a777211a6b..bd1c81d0ab 100644
--- a/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Carousel',
+ description:
+ 'A horizontal carousel of cards with scroll-snap and navigation buttons. Scroll or click the arrows to browse.',
isReady: true,
- aspectRatio: 4 / 3,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Carousel', 'Card', 'Layout', 'Text'],
};
diff --git a/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.tsx b/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.tsx
index 4887576483..68592ce3d7 100644
--- a/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Carousel/CarouselShowcase.tsx
@@ -1,29 +1,45 @@
'use client';
import {XDSCarousel} from '@xds/core/Carousel';
-import {XDSThumbnail} from '@xds/core/Thumbnail';
+import {XDSCard} from '@xds/core/Card';
+import {XDSStack} from '@xds/core/Layout';
+import {XDSText, XDSHeading} from '@xds/core/Text';
+import * as stylex from '@stylexjs/stylex';
-const IMAGES = [
- {id: 1, src: 'https://picsum.photos/id/1042/200/200', label: 'dark.jpg'},
- {id: 2, src: 'https://picsum.photos/id/1043/200/200', label: 'light.jpg'},
- {id: 3, src: 'https://picsum.photos/id/1044/200/200', label: 'warm.jpg'},
- {id: 4, src: 'https://picsum.photos/id/1047/200/200', label: 'mixed.jpg'},
- {id: 5, src: 'https://picsum.photos/id/1050/200/200', label: 'nature.jpg'},
+const styles = stylex.create({
+ root: {
+ maxWidth: 500,
+ },
+ card: {
+ minWidth: 200,
+ },
+});
+
+const ITEMS = [
+ {title: 'Design', body: 'Create wireframes and prototypes.'},
+ {title: 'Develop', body: 'Build components and pages.'},
+ {title: 'Test', body: 'Write tests and fix bugs.'},
+ {title: 'Deploy', body: 'Ship to production.'},
+ {title: 'Monitor', body: 'Track performance and errors.'},
];
export default function CarouselShowcase() {
return (
- <div style={{maxWidth: 400}}>
- <XDSCarousel gap={1} aria-label="Photo thumbnails">
- {IMAGES.map(img => (
- <XDSThumbnail
- key={img.id}
- src={img.src}
- alt={img.label}
- label={img.label}
- />
- ))}
- </XDSCarousel>
- </div>
+ <XDSCarousel
+ gap={2}
+ hasSnap
+ aria-label="Workflow steps"
+ xstyle={styles.root}>
+ {ITEMS.map(item => (
+ <XDSCard key={item.title} padding={3} xstyle={styles.card}>
+ <XDSStack direction="vertical" gap={1}>
+ <XDSHeading level={5}>{item.title}</XDSHeading>
+ <XDSText type="supporting" color="secondary">
+ {item.body}
+ </XDSText>
+ </XDSStack>
+ </XDSCard>
+ ))}
+ </XDSCarousel>
);
}
diff --git a/packages/cli/templates/blocks/components/Center/CenterShowcase.doc.mjs b/packages/cli/templates/blocks/components/Center/CenterShowcase.doc.mjs
index f3b888a66a..40d52b922b 100644
--- a/packages/cli/templates/blocks/components/Center/CenterShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Center/CenterShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Center',
+ description:
+ 'Content centered horizontally and vertically inside a fixed-height container.',
isReady: true,
- aspectRatio: 4 / 3,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Center', 'Layout', 'Text'],
};
diff --git a/packages/cli/templates/blocks/components/Center/CenterShowcase.tsx b/packages/cli/templates/blocks/components/Center/CenterShowcase.tsx
index b14a4b7599..8a8e01254e 100644
--- a/packages/cli/templates/blocks/components/Center/CenterShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Center/CenterShowcase.tsx
@@ -1,19 +1,18 @@
'use client';
import {XDSCenter} from '@xds/core/Center';
+import {XDSStack} from '@xds/core/Layout';
+import {XDSText, XDSHeading} from '@xds/core/Text';
export default function CenterShowcase() {
return (
- <XDSCenter axis="both" width="100%" height={200}>
- <div
- style={{
- padding: '16px 24px',
- backgroundColor: '#e8f0fe',
- borderRadius: 8,
- fontWeight: 500,
- }}>
- Centered Content
- </div>
+ <XDSCenter axis="both" width="100%" height={240}>
+ <XDSStack direction="vertical" gap={2} hAlign="center">
+ <XDSHeading level={4}>Centered content</XDSHeading>
+ <XDSText type="body" color="secondary">
+ Horizontally and vertically aligned.
+ </XDSText>
+ </XDSStack>
</XDSCenter>
);
}
diff --git a/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.doc.mjs b/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.doc.mjs
index f775e8576a..52128ea8fc 100644
--- a/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'CheckboxInput',
+ description:
+ 'Interactive checkboxes showing checked, unchecked, and indeterminate states with descriptions.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['CheckboxInput', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.tsx b/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.tsx
index 10b45f67a0..09293b2917 100644
--- a/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.tsx
+++ b/packages/cli/templates/blocks/components/CheckboxInput/CheckboxInputShowcase.tsx
@@ -1,11 +1,25 @@
+'use client';
+
+import {useState} from 'react';
import {XDSCheckboxInput} from '@xds/core/CheckboxInput';
+import {XDSStack} from '@xds/core/Layout';
export default function CheckboxInputShowcase() {
+ const [notifications, setNotifications] = useState(true);
+ const [marketing, setMarketing] = useState(false);
+
return (
- <XDSCheckboxInput
- label="Accept terms and conditions"
- value={false}
- onChange={() => {}}
- />
+ <XDSStack direction="vertical" gap={2}>
+ <XDSCheckboxInput
+ label="Checked"
+ value={notifications}
+ onChange={setNotifications}
+ />
+ <XDSCheckboxInput
+ label="Unchecked"
+ value={marketing}
+ onChange={setMarketing}
+ />
+ </XDSStack>
);
}
diff --git a/packages/cli/templates/blocks/components/Code/CodeShowcase.doc.mjs b/packages/cli/templates/blocks/components/Code/CodeShowcase.doc.mjs
index f2e2e61b2c..a592415db6 100644
--- a/packages/cli/templates/blocks/components/Code/CodeShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Code/CodeShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Code',
+ description:
+ 'Inline code snippets inside a sentence showing how Code renders alongside body text.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Code', 'Layout', 'Text'],
};
diff --git a/packages/cli/templates/blocks/components/Code/CodeShowcase.tsx b/packages/cli/templates/blocks/components/Code/CodeShowcase.tsx
index 781b66b136..b3dad3411a 100644
--- a/packages/cli/templates/blocks/components/Code/CodeShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Code/CodeShowcase.tsx
@@ -1,7 +1,20 @@
'use client';
import {XDSCode} from '@xds/core/CodeBlock';
+import {XDSText} from '@xds/core/Text';
+import {XDSStack} from '@xds/core/Layout';
export default function CodeShowcase() {
- return <XDSCode>const x = 1</XDSCode>;
+ return (
+ <XDSStack direction="vertical" gap={3}>
+ <XDSText type="body">
+ Run <XDSCode>npm install @xds/core</XDSCode> to add the package.
+ </XDSText>
+ <XDSText type="body">
+ Use the <XDSCode>variant</XDSCode> prop to switch between{' '}
+ <XDSCode>primary</XDSCode>, <XDSCode>secondary</XDSCode>, and{' '}
+ <XDSCode>ghost</XDSCode> styles.
+ </XDSText>
+ </XDSStack>
+ );
}
diff --git a/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.doc.mjs b/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.doc.mjs
index 1a908ace25..221f13b3c4 100644
--- a/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'CodeBlock',
+ description:
+ 'A syntax-highlighted TypeScript code block with line numbers, a title bar, and a copy button.',
isReady: true,
- aspectRatio: 4 / 3,
isShowcase: true,
+ aspectRatio: 4 / 3,
+ componentsUsed: ['CodeBlock'],
};
diff --git a/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.tsx b/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.tsx
index d9ddcee065..5e503a6af8 100644
--- a/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.tsx
+++ b/packages/cli/templates/blocks/components/CodeBlock/CodeBlockShowcase.tsx
@@ -4,25 +4,13 @@ import {XDSCodeBlock} from '@xds/core/CodeBlock';
const code = `import {useState, useEffect} from 'react';
-interface User {
- id: string;
- name: string;
- email: string;
-}
-
-async function fetchUser(id: string): Promise<User> {
- const response = await fetch(\`/api/users/\${id}\`);
- if (!response.ok) {
- throw new Error(\`HTTP \${response.status}\`);
- }
- return response.json();
-}
-
export function useUser(id: string) {
const [user, setUser] = useState<User | null>(null);
useEffect(() => {
- fetchUser(id).then(setUser);
+ fetch(\`/api/users/\${id}\`)
+ .then(res => res.json())
+ .then(setUser);
}, [id]);
return user;
diff --git a/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjs b/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjs
index c856995642..4dc5141ac5 100644
--- a/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Collapsible',
+ description:
+ 'An accordion group with three collapsible sections in single mode — opening one closes the others.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Collapsible', 'Text', 'Card'],
};
diff --git a/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx b/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx
index 4dc2b44e0a..4670430e15 100644
--- a/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx
@@ -1,14 +1,36 @@
'use client';
-import {XDSCollapsible} from '@xds/core/Collapsible';
+import {XDSCollapsible, XDSCollapsibleGroup} from '@xds/core/Collapsible';
import {XDSText} from '@xds/core/Text';
+import {XDSCard} from '@xds/core/Card';
+import {XDSStack} from '@xds/core/Layout';
export default function CollapsibleShowcase() {
return (
- <XDSCollapsible trigger="Show more details">
- <XDSText type="body">
- This collapsible manages its own state. Click the trigger to toggle.
- </XDSText>
- </XDSCollapsible>
+ <XDSCard width={400}>
+ <XDSCollapsibleGroup type="single" defaultValue="notifications">
+ <XDSCollapsible trigger="General settings" value="general">
+ <XDSStack direction="vertical" gap={3}>
+ <XDSText type="body" color="secondary">
+ Configure your display name, language, and time zone preferences.
+ </XDSText>
+ </XDSStack>
+ </XDSCollapsible>
+ <XDSCollapsible trigger="Notifications" value="notifications">
+ <XDSStack direction="vertical" gap={3}>
+ <XDSText type="body" color="secondary">
+ Choose which email and push notifications you want to receive.
+ </XDSText>
+ </XDSStack>
+ </XDSCollapsible>
+ <XDSCollapsible trigger="Privacy" value="privacy">
+ <XDSStack direction="vertical" gap={3}>
+ <XDSText type="body" color="secondary">
+ Manage your data sharing preferences and account visibility.
+ </XDSText>
+ </XDSStack>
+ </XDSCollapsible>
+ </XDSCollapsibleGroup>
+ </XDSCard>
);
}
diff --git a/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.doc.mjs b/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.doc.mjs
index 1fe03a3f38..feb73fa62e 100644
--- a/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'DateInput',
+ description:
+ 'A date input field with a calendar popover. Type a date or click the calendar icon to pick one.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 1,
+ componentsUsed: ['DateInput', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.tsx b/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.tsx
index c7487066d5..b8099dccc3 100644
--- a/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.tsx
+++ b/packages/cli/templates/blocks/components/DateInput/DateInputShowcase.tsx
@@ -1,13 +1,31 @@
'use client';
+import {useState} from 'react';
import {XDSDateInput} from '@xds/core/DateInput';
+import {XDSStack} from '@xds/core/Layout';
+import * as stylex from '@stylexjs/stylex';
+
+type DateString =
+ `${number}${number}${number}${number}-${number}${number}-${number}${number}`;
+
+const styles = stylex.create({
+ root: {
+ width: 320,
+ },
+});
export default function DateInputShowcase() {
+ const [date, setDate] = useState<DateString | undefined>(undefined);
+
return (
- <XDSDateInput
- label="Date"
- placeholder="Select a date"
- onChange={() => {}}
- />
+ <XDSStack direction="vertical" xstyle={styles.root}>
+ <XDSDateInput
+ label="Start date"
+ placeholder="Select a date"
+ value={date}
+ onChange={setDate}
+ hasClear
+ />
+ </XDSStack>
);
}
diff --git a/packages/cli/templates/blocks/components/Dialog/DialogShowcase.doc.mjs b/packages/cli/templates/blocks/components/Dialog/DialogShowcase.doc.mjs
index 41d8d66bbe..bc1043fde7 100644
--- a/packages/cli/templates/blocks/components/Dialog/DialogShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Dialog/DialogShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Dialog',
+ description:
+ 'A button that opens a modal dialog with a header, body content, and action buttons.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Dialog', 'Button', 'Layout', 'Text'],
};
diff --git a/packages/cli/templates/blocks/components/Dialog/DialogShowcase.tsx b/packages/cli/templates/blocks/components/Dialog/DialogShowcase.tsx
index 487ca38202..cf6bc857db 100644
--- a/packages/cli/templates/blocks/components/Dialog/DialogShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Dialog/DialogShowcase.tsx
@@ -1,24 +1,55 @@
'use client';
+import {useState} from 'react';
import {XDSDialog, XDSDialogHeader} from '@xds/core/Dialog';
-import {XDSLayout, XDSLayoutContent} from '@xds/core/Layout';
+import {
+ XDSLayout,
+ XDSLayoutContent,
+ XDSLayoutFooter,
+ XDSHStack,
+} from '@xds/core/Layout';
import {XDSButton} from '@xds/core/Button';
import {XDSText} from '@xds/core/Text';
export default function DialogShowcase() {
+ const [isOpen, setIsOpen] = useState(false);
+
return (
<>
- <XDSButton label="Open Modal" variant="secondary" onClick={() => {}} />
- <XDSDialog isOpen={false} onOpenChange={() => {}}>
+ <XDSButton
+ label="Open dialog"
+ variant="secondary"
+ onClick={() => setIsOpen(true)}
+ />
+ <XDSDialog isOpen={isOpen} onOpenChange={setIsOpen}>
<XDSLayout
header={
- <XDSDialogHeader title="Modal Title" onOpenChange={() => {}} />
+ <XDSDialogHeader title="Confirm changes" onOpenChange={setIsOpen} />
}
content={
<XDSLayoutContent>
- <XDSText type="body">Dialog content goes here.</XDSText>
+ <XDSText type="body">
+ You have unsaved changes. Would you like to save them before
+ leaving?
+ </XDSText>
</XDSLayoutContent>
}
+ footer={
+ <XDSLayoutFooter>
+ <XDSHStack gap={2} hAlign="end">
+ <XDSButton
+ label="Discard"
+ variant="ghost"
+ onClick={() => setIsOpen(false)}
+ />
+ <XDSButton
+ label="Save"
+ variant="primary"
+ onClick={() => setIsOpen(false)}
+ />
+ </XDSHStack>
+ </XDSLayoutFooter>
+ }
/>
</XDSDialog>
</>
diff --git a/packages/cli/templates/blocks/components/Divider/DividerShowcase.doc.mjs b/packages/cli/templates/blocks/components/Divider/DividerShowcase.doc.mjs
index e7f72220bc..4950c0ef20 100644
--- a/packages/cli/templates/blocks/components/Divider/DividerShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Divider/DividerShowcase.doc.mjs
@@ -1,8 +1,11 @@
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
export const doc = {
type: 'block',
- name: 'Divider',
+ name: 'Divider — Variants',
+ description:
+ 'Horizontal dividers in subtle and strong variants, plus a labeled divider. A quick visual reference for separator styles.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Divider', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/Divider/DividerShowcase.tsx b/packages/cli/templates/blocks/components/Divider/DividerShowcase.tsx
index c6d7416d71..55cc1ebacd 100644
--- a/packages/cli/templates/blocks/components/Divider/DividerShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Divider/DividerShowcase.tsx
@@ -1,7 +1,21 @@
'use client';
import {XDSDivider} from '@xds/core/Divider';
+import {XDSStack} from '@xds/core/Layout';
+import * as stylex from '@stylexjs/stylex';
+
+const styles = stylex.create({
+ root: {
+ width: 500,
+ },
+});
export default function DividerShowcase() {
- return <XDSDivider />;
+ return (
+ <XDSStack direction="vertical" gap={4} xstyle={styles.root}>
+ <XDSDivider variant="subtle" />
+ <XDSDivider variant="strong" />
+ <XDSDivider label="or" />
+ </XDSStack>
+ );
}
diff --git a/packages/cli/templates/blocks/components/DropdownMenu/DropdownMenuShowcase.doc.mjs b/packages/cli/templates/blocks/components/DropdownMenu/DropdownMenuShowcase.doc.mjs
index 3fd137efbb..02d085ca77 100644
--- a/packages/cli/templates/blocks/components/DropdownMenu/DropdownMenuShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/DropdownMenu/DropdownMenuShowcase.doc.mjs
@@ -2,8 +2,10 @@
export const doc = {
type: 'block',
name: 'DropdownMenu',
+ description:
+ 'A button that opens a dropdown menu with action items. The menu starts open for preview.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 1,
componentsUsed: ['DropdownMenu'],
};
diff --git a/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs b/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs
index 159d414494..fec9d0c4c7 100644
--- a/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'EmptyState',
+ description:
+ 'A no-results empty state with an icon, descriptive message, and a call-to-action button.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 1,
+ componentsUsed: ['EmptyState', 'Button', 'Icon'],
};
diff --git a/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx b/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx
index 24efe13fa4..39b4d8cd86 100644
--- a/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx
+++ b/packages/cli/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx
@@ -1,12 +1,17 @@
'use client';
import {XDSEmptyState} from '@xds/core/EmptyState';
+import {XDSButton} from '@xds/core/Button';
+import {XDSIcon} from '@xds/core/Icon';
+import {MagnifyingGlassIcon} from '@heroicons/react/24/outline';
export default function EmptyStateShowcase() {
return (
<XDSEmptyState
+ icon={<XDSIcon icon={MagnifyingGlassIcon} size="lg" />}
title="No results found"
description="Try adjusting your search or filters to find what you need."
+ actions={<XDSButton label="Clear filters" variant="secondary" />}
/>
);
}
diff --git a/packages/cli/templates/blocks/components/Field/FieldShowcase.doc.mjs b/packages/cli/templates/blocks/components/Field/FieldShowcase.doc.mjs
index 0b7a8387db..6df89ccf1c 100644
--- a/packages/cli/templates/blocks/components/Field/FieldShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/Field/FieldShowcase.doc.mjs
@@ -2,7 +2,10 @@
export const doc = {
type: 'block',
name: 'Field',
+ description:
+ 'A form field wrapping a text input with a label, description, and validation status.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
+ aspectRatio: 16 / 9,
+ componentsUsed: ['Field', 'TextInput', 'Layout'],
};
diff --git a/packages/cli/templates/blocks/components/Field/FieldShowcase.tsx b/packages/cli/templates/blocks/components/Field/FieldShowcase.tsx
index 80836b9b74..62df6f8b57 100644
--- a/packages/cli/templates/blocks/components/Field/FieldShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Field/FieldShowcase.tsx
@@ -1,9 +1,41 @@
'use client';
+import {useState} from 'react';
+import {XDSField} from '@xds/core/Field';
import {XDSTextInput} from '@xds/core/TextInput';
+import {XDSStack} from '@xds/core/Layout';
+import * as stylex from '@stylexjs/stylex';
+
+const styles = stylex.create({
+ root: {
+ width: 320,
+ },
+});
export default function FieldShowcase() {
+ const [email, setEmail] = useState('');
+
+ const status =
+ email.length > 0 && !email.includes('@')
+ ? {type: 'error' as const, message: 'Enter a valid email address.'}
+ : undefined;
+
return (
- <XDSTextInput label="Email" value="" onChange={() => {}} placeholder="[email protected]" />
+ <XDSStack direction="vertical" gap={3} xstyle={styles.root}>
+ <XDSField
+ label="Email"
+ inputID="field-email"
+ description="We will never share your email."
+ isRequired
+ status={status}>
+ <XDSTextInput
+ label="Email"
+ isLabelHidden
+ value={email}
+ onChange={setEmail}
+ placeholder="[email protected]"
+ />
+ </XDSField>
+ </XDSStack>
);
}
diff --git a/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.doc.mjs b/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.doc.mjs
index f988ac4cbb..adfa89f3bb 100644
--- a/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.doc.mjs
+++ b/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.doc.mjs
@@ -2,8 +2,10 @@
export const doc = {
type: 'block',
name: 'HoverCard',
+ description:
+ 'A hover card that shows a user profile preview when hovering over a trigger button. Starts open for preview.',
isReady: true,
- aspectRatio: 1,
isShowcase: true,
- componentsUsed: ['HoverCard', 'Button', 'Layout', 'Text'],
+ aspectRatio: 1,
+ componentsUsed: ['HoverCard', 'Button', 'Layout', 'Text', 'Avatar'],
};
diff --git a/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx b/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx
index f92eb355d8..93a01f045a 100644
--- a/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx
+++ b/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx
@@ -2,8 +2,16 @@
import {XDSHoverCard} from '@xds/core/HoverCard';
import {XDSButton} from '@xds/core/Button';
-import {XDSVStack} from '@xds/core/Layout';
+import {XDSStack} from '@xds/core/Layout';
import {XDSText, XDSHeading} from '@xds/core/Text';
+import {XDSAvatar} from '@xds/core/Avatar';
+import * as stylex from '@stylexjs/stylex';
+
+const styles = stylex.create({
+ card: {
+ width: 240,
+ },
+});
export default function HoverCardShowcase() {
return (
@@ -11,13 +19,22 @@ export default function HoverCardShowcase() {
placement="above"
isDefaultOpen
content={
- <XDSVStack gap={1} style={{width: 200}}>
- <XDSHeading level={5}>Jane Doe</XDSHeading>
- <XDSText type="supporting" color="secondary">Software Engineer</XDSText>
- <XDSText type="body">Building great products with great people.</XDSText>
- </XDSVStack>
+ <XDSStack direction="vertical" gap={2} xstyle={styles.card}>
+ <XDSStack direction="horizontal" gap={2} vAlign="center">
+ <XDSAvatar name="Jane Doe" size="medium" />
+ <XDSStack direction="vertical" gap={0}>
+ <XDSHeading level={5}>Jane Doe</XDSHeading>
+ <XDSText type="supporting" color="secondary">
+ Software Engineer
+ </XDSText>
+ </XDSStack>
+ </XDSStack>
+ <XDSText type="body" color="secondary">
+ Building great products with great people.
+ </XDSText>
+ </XDSStack>
}>
- <XDSButton label="Hover me" />
+ <XDSButton label="@janedoe" variant="ghost" />
</XDSHoverCard>
);
}