Meta reference

Title

Edit this page

Title adds a <title> element that sets the document title.


Import

import { Title } from "@solidjs/meta";

Type

const Title: Component<JSX.HTMLAttributes<HTMLTitleElement>>;

Props

Accepts attributes for <title>.

children

  • Type: JSX.Element
  • Optional: Yes

Content rendered inside the title element.


Behavior

  • Registers a title tag with close: true and escape: true.
  • Cascading keeps the latest active title instance in the document head and restores the previous instance when the latest one is removed.
  • Requires MetaProvider in the component tree.

Examples

Basic usage

import { MetaProvider, Title } from "@solidjs/meta";
export default function Root() {
return (
<MetaProvider>
<Title>Solid Docs</Title>
</MetaProvider>
);
}

Report an issue with this page