Meta reference

Meta

Edit this page

Meta adds a <meta> element for metadata that is not represented by another HTML metadata element.


Import

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

Type

const Meta: Component<JSX.MetaHTMLAttributes<HTMLMetaElement>>;

Props

Accepts attributes for <meta>.


Behavior

  • Registers a meta tag with self-closing server rendering.
  • Cascading identity uses name, http-equiv, content, charset, media, and property from the tag props.
  • property is treated as name when Solid Meta builds the tag key.
  • Requires MetaProvider in the component tree.

Examples

Basic usage

import { MetaProvider, Meta } from "@solidjs/meta";
export default function Root() {
return (
<MetaProvider>
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta name="description" content="Hacker News Clone built with Solid" />
</MetaProvider>
);
}

Report an issue with this page