Skip to content

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

TypeScript

feat(docsite): add Install Core Library button to components overview (#2447)

Kenton Quatman53372a655e34
diff --git a/apps/docsite/src/app/(docs)/components/page.tsx b/apps/docsite/src/app/(docs)/components/page.tsx
index dfe76eae10..a065bb2b95 100644
--- a/apps/docsite/src/app/(docs)/components/page.tsx
+++ b/apps/docsite/src/app/(docs)/components/page.tsx
@@ -15,6 +15,10 @@ import {XDSSection} from '@xds/core/Section';
import {XDSGrid} from '@xds/core/Grid';
import {XDSClickableCard} from '@xds/core/ClickableCard';
import {XDSDivider} from '@xds/core/Divider';
+import {XDSButton} from '@xds/core/Button';
+import {XDSPopover} from '@xds/core/Popover';
+import {XDSCard} from '@xds/core/Card';
+import {XDSCodeBlock} from '@xds/core/CodeBlock';
import {components as componentRegistry} from '../../../generated/componentRegistry';
import {blocks} from '../../../generated/blockRegistry';
import {ShowcaseThumbnail} from '../../../components/ShowcaseThumbnail';
@@ -84,7 +88,7 @@ export default function ComponentsGalleryPage() {
if (comp.hidden) {
continue;
}
- // Skip hooks
+ // Skip hooks (they appear in the Utilities section)
if (comp.name.startsWith('use')) {
continue;
}
@@ -92,6 +96,10 @@ export default function ComponentsGalleryPage() {
if (!comp.category) {
continue;
}
+ // Skip utilities group
+ if (comp.group === 'Utilities') {
+ continue;
+ }
items.push({
name: comp.name,
@@ -124,14 +132,52 @@ export default function ComponentsGalleryPage() {
return (
<XDSSection maxWidth={1200} padding={6} xstyle={styles.section}>
<XDSVStack gap={10}>
- <XDSVStack gap={2} style={{alignItems: 'center'}}>
- <XDSText type="display-2" xstyle={styles.heroTitle}>
- Browse the library
- </XDSText>
- <XDSText type="body" color="secondary" xstyle={styles.heroTitle}>
- Every component, with copy-ready examples for every variant, state,
- and pattern.
- </XDSText>
+ <XDSVStack gap={4} hAlign="center">
+ <XDSVStack gap={2} style={{alignItems: 'center'}}>
+ <XDSText type="display-2" xstyle={styles.heroTitle}>
+ Browse the library
+ </XDSText>
+ <XDSText type="body" color="secondary" xstyle={styles.heroTitle}>
+ Every component, with copy-ready examples for every variant,
+ state, and pattern.
+ </XDSText>
+ </XDSVStack>
+ <XDSPopover
+ width={360}
+ content={
+ <XDSVStack gap={3}>
+ <XDSVStack gap={1}>
+ <XDSText type="body" weight="bold">
+ 1. Install the package
+ </XDSText>
+ <XDSCard padding={0}>
+ <XDSCodeBlock
+ code="npm install @xds/core"
+ language="bash"
+ hasCopyButton
+ />
+ </XDSCard>
+ </XDSVStack>
+ <XDSVStack gap={1}>
+ <XDSText type="body" weight="bold">
+ 2. Import a component
+ </XDSText>
+ <XDSCard padding={0}>
+ <XDSCodeBlock
+ code="import {...} from '@xds/core/ComponentName';"
+ language="typescript"
+ hasCopyButton
+ />
+ </XDSCard>
+ </XDSVStack>
+ </XDSVStack>
+ }>
+ <XDSButton
+ variant="primary"
+ size="lg"
+ label="Install Core Library"
+ />
+ </XDSPopover>
</XDSVStack>
{CATEGORIES.map(cat => {