Skip to content
All components

use-inert-background

Hook

Pairs Radix modal background hiding with native inert, restoring consumer state on close.

import { useInertBackground } from "@/hooks/use-inert-background"

export function Nav() {
  const isMobile = useInertBackground()

  return isMobile ? <MobileNav /> : <DesktopNav />
}
Install
The CLI writes the file into your project, with every item it depends on.
npx @tdpxl/cli add use-inert-background
Dependencies
Derived from this file's real imports when the registry was built.

npm

None.

registry

None.