mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
Support className prop in docs/notebook page (#2859)
* Add className prop to DocsPageProps * Add className prop to DocsPageProps for customizable styling * add JSDoc for className prop * fix lint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
"fumadocs-ui": patch
|
||||
"@fumadocs/base-ui": patch
|
||||
'fumadocs-ui': patch
|
||||
'@fumadocs/base-ui': patch
|
||||
---
|
||||
|
||||
expose `useAutoScroll()`
|
||||
|
||||
@@ -50,6 +50,11 @@ export interface DocsPageProps {
|
||||
footer?: Partial<FooterOptions>;
|
||||
|
||||
children?: ReactNode;
|
||||
|
||||
/**
|
||||
* Apply class names to the `#nd-page` container.
|
||||
*/
|
||||
className?: string;
|
||||
}
|
||||
|
||||
type TableOfContentOptions = Pick<AnchorProviderProps, 'single'> & {
|
||||
@@ -86,6 +91,7 @@ export function DocsPage({
|
||||
tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {},
|
||||
toc = [],
|
||||
children,
|
||||
className,
|
||||
}: DocsPageProps) {
|
||||
// disable TOC on full mode, you can still enable it with `enabled` option.
|
||||
tocEnabled ??=
|
||||
@@ -131,6 +137,7 @@ export function DocsPage({
|
||||
className={cn(
|
||||
'flex flex-col w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14',
|
||||
full ? 'max-w-[1200px]' : 'xl:layout:[--fd-toc-width:268px]',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{breadcrumbEnabled && (breadcrumb ?? <PageBreadcrumb {...breadcrumbProps} />)}
|
||||
|
||||
@@ -50,6 +50,11 @@ export interface DocsPageProps {
|
||||
footer?: Partial<FooterOptions>;
|
||||
|
||||
children?: ReactNode;
|
||||
|
||||
/**
|
||||
* Apply class names to the `#nd-page` container.
|
||||
*/
|
||||
className?: string;
|
||||
}
|
||||
|
||||
type TableOfContentOptions = Pick<AnchorProviderProps, 'single'> & {
|
||||
@@ -86,6 +91,7 @@ export function DocsPage({
|
||||
tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {},
|
||||
toc = [],
|
||||
children,
|
||||
className,
|
||||
}: DocsPageProps) {
|
||||
// disable TOC on full mode, you can still enable it with `enabled` option.
|
||||
tocEnabled ??=
|
||||
@@ -131,6 +137,7 @@ export function DocsPage({
|
||||
className={cn(
|
||||
'flex flex-col [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14 *:max-w-[900px]',
|
||||
full && '*:max-w-[1285px]',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{breadcrumbEnabled && (breadcrumb ?? <PageBreadcrumb {...breadcrumbProps} />)}
|
||||
|
||||
@@ -50,6 +50,11 @@ export interface DocsPageProps {
|
||||
footer?: Partial<FooterOptions>;
|
||||
|
||||
children?: ReactNode;
|
||||
|
||||
/**
|
||||
* Apply class names to the `#nd-page` container.
|
||||
*/
|
||||
className?: string;
|
||||
}
|
||||
|
||||
type TableOfContentOptions = Pick<AnchorProviderProps, 'single'> & {
|
||||
@@ -86,6 +91,7 @@ export function DocsPage({
|
||||
tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {},
|
||||
toc = [],
|
||||
children,
|
||||
className,
|
||||
}: DocsPageProps) {
|
||||
// disable TOC on full mode, you can still enable it with `enabled` option.
|
||||
tocEnabled ??=
|
||||
@@ -131,6 +137,7 @@ export function DocsPage({
|
||||
className={cn(
|
||||
'flex flex-col w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14',
|
||||
full ? 'max-w-[1200px]' : 'xl:layout:[--fd-toc-width:268px]',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{breadcrumbEnabled && (breadcrumb ?? <PageBreadcrumb {...breadcrumbProps} />)}
|
||||
|
||||
@@ -50,6 +50,11 @@ export interface DocsPageProps {
|
||||
footer?: Partial<FooterOptions>;
|
||||
|
||||
children?: ReactNode;
|
||||
|
||||
/**
|
||||
* Apply class names to the `#nd-page` container.
|
||||
*/
|
||||
className?: string;
|
||||
}
|
||||
|
||||
type TableOfContentOptions = Pick<AnchorProviderProps, 'single'> & {
|
||||
@@ -86,6 +91,7 @@ export function DocsPage({
|
||||
tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {},
|
||||
toc = [],
|
||||
children,
|
||||
className,
|
||||
}: DocsPageProps) {
|
||||
// disable TOC on full mode, you can still enable it with `enabled` option.
|
||||
tocEnabled ??=
|
||||
@@ -131,6 +137,7 @@ export function DocsPage({
|
||||
className={cn(
|
||||
'flex flex-col [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14 *:max-w-[900px]',
|
||||
full && '*:max-w-[1285px]',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{breadcrumbEnabled && (breadcrumb ?? <PageBreadcrumb {...breadcrumbProps} />)}
|
||||
|
||||
Reference in New Issue
Block a user