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

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

Usage

Display a graph component with a custom configuration and sitemap.

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

<Graph> Props

The <Graph> component accepts the following props:

slug

type: string

Determines the slug of the current page.

config

type: GraphConfig

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

sitemap

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.