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
Baseis ignored (with a dev warning) on the client: a base that changes after relative URLs resolved is incoherent by definition. Basedoes not accept akeyand 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" />;}