Skip to content
aq-ui
Back to HooksHook

Use Portal Container

Open-code aq-ui React hook for Use Portal Container.

Installation

pnpm dlx aq-ui@alpha add use-portal-container

API reference

Client module

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

"use client"

import { usePortalContainer } from "@/hooks/use-portal-container"

const result = usePortalContainer()

usePortalContainer

functionSource L15

Open-code aq-ui React hook for Use Portal Container.

function usePortalContainer({ parent, id, className, attributes, enabled = true, }: UsePortalContainerOptions = {}): HTMLElement | null
Returns
HTMLElement | null

Parameters

NameTypeDefault
options?UsePortalContainerOptions{}
const result = usePortalContainer()

UsePortalContainerOptions

interfaceSource L7

Type contract for UsePortalContainerOptions.

interface UsePortalContainerOptions

Members

NameTypeDefault
parent?Target<HTMLElement>—
id?string—
className?string—
attributes?Record<string, string>—
enabled?booleantrue

Registry dependencies

hook-target

Files

  • hooks/use-portal-container.ts

Source