Base

Base adds a <base> element that specifies the base URL for all relative URLs in the document.


Import

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

Type

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

Props

Accepts attributes for <base> (href, target).


Behavior

  • Server shell only. <base> has hard placement constraints — it must appear before any relative URL resolves — so it is rendered into the head prelude on the first server flush.
  • Registrations arriving after the shell has flushed are ignored with a dev warning, and Base is ignored (with a dev warning) on the client: a base that changes after relative URLs resolved is incoherent by definition.
  • Base does not accept a key and does not participate in cascade/restore semantics.

Examples

Basic usage

import { Base } from "@solidjs/meta";
export default function App() {
return <Base href="https://example.com/app/" target="_blank" />;
}

Last updated: 8/5/26, 7:19 PMEdit this pageReport an issue with this page