Meta reference

Base

Edit this page

Base adds a <base> element that sets the document base URL for resolving relative URLs.


Import

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

Type

const Base: Component<JSX.BaseHTMLAttributes<HTMLBaseElement>>;

Props

Accepts attributes for <base>.


Behavior

  • Registers a self-closing base tag.
  • Non-cascading tags can add one document-head element per active instance.
  • Requires MetaProvider in the component tree.

Examples

Basic usage

import { MetaProvider, Base } from "@solidjs/meta";
function App() {
return (
<MetaProvider>
<Base href="https://docs.solidjs.com/" />
</MetaProvider>
);
}

Report an issue with this page