Meta
Edit this pageMeta 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
metatag with self-closing server rendering. - Cascading identity uses
name,http-equiv,content,charset,media, andpropertyfrom the tag props. propertyis treated asnamewhen Solid Meta builds the tag key.- Requires
MetaProviderin 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> );}