Base

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>
);
}

Last updated: 5/6/26, 4:10 AMEdit this pageReport an issue with this page