feat: add backstage/ui hooks documentation

Signed-off-by: Antony Bouyon <antony.bouyon@believe.com>
This commit is contained in:
Antony Bouyon
2026-01-14 18:30:10 +01:00
parent 8fc6bf9bfb
commit 1cf2972f45
10 changed files with 422 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
import { hooks } from '@/utils/data';
export default async function Page({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
const { default: Component } = await import(`@/content/hooks/${slug}.mdx`);
return <Component />;
}
export function generateStaticParams() {
const list = [...hooks];
return list.map(hook => ({
slug: hook.slug,
}));
}
export const dynamicParams = false;
+34
View File
@@ -0,0 +1,34 @@
import { CodeBlock } from '@/components/CodeBlock';
import { ComponentCard, ComponentCards } from '@/components/ComponentCards';
# Hooks
Backstage UI custom hooks provide easy access to design system features, style management, and responsive interface creation.
<ComponentCards>
<ComponentCard
title="useBreakpoint"
description="Hook to detect current responsive breakpoints and manage adaptive behaviors."
href="/hooks/use-breakpoint"
/>
<ComponentCard
title="useMediaQuery"
description="Hook to evaluate and react to CSS media queries programmatically."
href="/hooks/use-media-query"
/>
<ComponentCard
title="useStyles"
description="Main hook to access and manipulate Backstage design system styles."
href="/hooks/use-styles"
/>
<ComponentCard
title="useSurface"
description="Hook to manage surfaces and elevation levels in the interface."
href="/hooks/use-surface"
/>
<ComponentCard
title="useIsomorphicLayoutEffect"
description="Isomorphic version of useLayoutEffect that works on both client and server."
href="/hooks/use-isomorphic-layout-effect"
/>
</ComponentCards>