This component no longer exists. It was in diceui/base’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-13 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
portal
diceui-base/portalRemovedComponent
diceui/base publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/base-vega/portal.jsonSource
1"use client";23import { useRender } from "@base-ui/react/use-render";4import * as React from "react";5import * as ReactDOM from "react-dom";67interface PortalProps extends useRender.ComponentProps<"div"> {8 container?: Element | DocumentFragment | null;9}1011function subscribe() {12 return () => {};13}1415function getSnapshot() {16 return true;17}1819function getServerSnapshot() {20 return false;21}2223function Portal(props: PortalProps) {24 const { container: containerProp, render, ...portalProps } = props;2526 const mounted = React.useSyncExternalStore(27 subscribe,28 getSnapshot,29 getServerSnapshot,30 );3132 const container =33 containerProp ?? (mounted ? globalThis.document?.body : null);3435 const element = useRender({36 props: portalProps,37 render,38 state: {39 slot: "portal",40 },41 });4243 if (!container) return null;4445 return ReactDOM.createPortal(element, container);46}4748export type { PortalProps };49export { Portal };
