diff --git a/src/lib/output/events.ts b/src/lib/output/events.ts index 1797b16f9..c3b6ef4a0 100644 --- a/src/lib/output/events.ts +++ b/src/lib/output/events.ts @@ -6,6 +6,7 @@ import { type ReflectionKind, } from "../models/index.js"; import type { PageDefinition, PageKind, RouterTarget } from "./router.js"; +import { type Icons } from "./themes/default/partials/icon.js"; /** * An event emitted by the {@link Renderer} class at the very beginning and @@ -59,6 +60,7 @@ export interface PageHeading { level?: number; kind?: ReflectionKind; classes?: string; + icon?: keyof Icons & (string | number); } /** diff --git a/src/lib/output/themes/default/partials/member.tsx b/src/lib/output/themes/default/partials/member.tsx index 1edf71ad3..8242fb8d8 100644 --- a/src/lib/output/themes/default/partials/member.tsx +++ b/src/lib/output/themes/default/partials/member.tsx @@ -12,6 +12,7 @@ export function member(context: DefaultThemeRenderContext, props: DeclarationRef text: getDisplayName(props), kind: props.kind, classes: context.getReflectionClasses(props), + icon: context.theme.getReflectionIcon(props), }); // With the default url derivation, we'll never hit this case as documents are always placed into their diff --git a/src/lib/output/themes/default/partials/moduleReflection.tsx b/src/lib/output/themes/default/partials/moduleReflection.tsx index 89a4dd4d9..d0ea3c44c 100644 --- a/src/lib/output/themes/default/partials/moduleReflection.tsx +++ b/src/lib/output/themes/default/partials/moduleReflection.tsx @@ -81,6 +81,7 @@ export function moduleMemberSummary( text: getDisplayName(member), kind: member instanceof ReferenceReflection ? member.getTargetReflectionDeep().kind : member.kind, classes: context.getReflectionClasses(member), + icon: context.theme.getReflectionIcon(member), }); let name: JSX.Element; diff --git a/src/lib/output/themes/default/partials/navigation.tsx b/src/lib/output/themes/default/partials/navigation.tsx index 39e9efa93..9e38d2d62 100644 --- a/src/lib/output/themes/default/partials/navigation.tsx +++ b/src/lib/output/themes/default/partials/navigation.tsx @@ -190,7 +190,7 @@ function buildSectionNavigation(context: DefaultThemeRenderContext, headings: Pa levels[levels.length - 1].push( - {heading.kind && context.icons[heading.kind]()} + {heading.icon && context.icons[heading.icon]()} {wbr(heading.text)} , );