Core

Gate Wrapper

The shared outer-positioning primitive every visible block composes on.

corelayout

Best used for Composing a fully custom access-code UI that still needs the standard page/inline positioning.

Not a verification strategy — just layout. Every block that renders visible UI (<KnockCodes>, <ProtectedCard>, <AccessDeniedScreen>, ...) composes on this instead of re-deriving centering/spacing.

Loading preview…
Installation

Add this block to your project

CLI

npx shadcn@latest add http://localhost:3000/r/react/gate-wrapper.json

Running this site somewhere other than localhost? Set NEXT_PUBLIC_SITE_URL and this command switches to that host automatically.

Also installs

  • cx (classname helper)

Files created (2)

  • components/knock-codes/react/cx.ts
  • components/knock-codes/react/GateWrapper.tsx

No CLI? Copy the files by hand

  1. Open the Code tab in the preview above.
  2. Create each path listed below in your project and paste its contents in.
  3. Do the same for anything listed under “Also installs”, if present.

Props

API reference

PropTypeDefaultDescription
children *ReactNodeContent to position.
variant"page" | "inline""page""page" centers full-height (min-h-100dvh); "inline" flows naturally in place.
classNamestringExtra classes on the wrapper.
Notes

Accessibility

Purely structural — a single div with positioning classes. No semantics of its own to get wrong.

Customization

Use it directly when none of the other blocks' visual shells fit — wrap your own fully custom access-code form in it to get the same full-page-centered or inline placement every other block uses, for free.

Compose with

Blocks that pair well with this one

These combine naturally with this block, whether as a shared shell, a shared session, or a common fallback.