Skip to content

<Graph>

The <Graph> component handles the rendering of the graph given slug, config and sitemap properties. This can be useful when you want to display a completely custom graph.

import { Graph } from 'starlight-site-graph/components';

Display a graph component with a custom configuration and sitemap.

<Graph
config={{...}}
sitemap={{"node/": { title: "Node", exists: true }}}
slug={"node/"}
/>
Preview

The <Graph> component accepts the following props:

type: string

Determines the slug of the current page.

type: GraphConfig

The configuration object for the graph, for information on what can be passed, check out the configuration documentation.\

type: sitemapSchema

The sitemap object, which contains all the information about pages, links and other information. For more information on how this object should be structured, check out the sitemap configuration documentation.