The text or list of marked.Token to convert to a unique id
a unique id that can be applied to a component
Simple Example
const text = "This is some heading text";
const id = useSluggedId(text);
// "this-is-some-heading-text"
Using Tokens
const tokens: readonly Token[] = [
{ type: "text", text: "Some content", raw: "Some content" },
{
type: "link",
text: "Link Text",
raw: "[Link Text](https://example.com)",
href: "https://example.com",
title: "",
tokens: [
{
type: "text",
raw: "Link Text",
text: "Link Text",
},
],
},
];
const id = useSluggedId(tokens);
// "some-content-link-text"
Generated using TypeDoc
This is a reasonable default for generating unique ids for elements in the Markdown component.