PublicPage
PublicPage — a page anyone can open without signing in: a public form, a QR poster, a landing page. A brand header, one content column, and a "Powered by …" footer, themed from a brand object. ```tsx <PublicPage brand={{ name: "Riverside Physio", logoUrl, accent: "#10b981" }} poweredBy={<a href="https://example.com">Example</a>} embedded={searchParams.get("embed") === "1"} > <Form … /> </PublicPage> ``` The brand's accent becomes `--primary` (darkened when it fails 4.5:1 on white) on the page root, so a `Button` or link inside follows the brand with no props. The check is against white, Genesis's light background; under a `.dark` theme the fill stays readable (white on the shade) but accent-coloured text may not, so public pages are best served light. `embedded` is the frame-ancestors case. It drops the header and footer, the background and `min-height: 100dvh` (inside an iframe the viewport is the frame, so a full-height page would never let the frame shrink to its content). This is a **layout**: it positions content and binds to nothing. The content column is a `Container` for the one-home reason.
packages/ui/src/components/layout/public-page.tsx
@marktiderman/genesis-ui/layoutimport { PublicPage } from "@marktiderman/genesis-ui/layout";react-docgen-typescript.PublicPage
PublicPage — a page anyone can open without signing in: a public form, a QR poster, a landing page. A brand header, one content column, and a "Powered by …" footer, themed from a brand object. ```tsx <PublicPage brand={{ name: "Riverside Physio", logoUrl, accent: "#10b981" }} poweredBy={<a href="https://example.com">Example</a>} embedded={searchParams.get("embed") === "1"} > <Form … /> </PublicPage> ``` The brand's accent becomes `--primary` (darkened when it fails 4.5:1 on white) on the page root, so a `Button` or link inside follows the brand with no props. The check is against white, Genesis's light background; under a `.dark` theme the fill stays readable (white on the shade) but accent-coloured text may not, so public pages are best served light. `embedded` is the frame-ancestors case. It drops the header and footer, the background and `min-height: 100dvh` (inside an iframe the viewport is the frame, so a full-height page would never let the frame shrink to its content). This is a **layout**: it positions content and binds to nothing. The content column is a `Container` for the one-home reason.
| Prop | Type | Default | Description |
|---|---|---|---|
| brand | PublicBrand | — | The brand the page belongs to. Its header (logo, name, cover image) shows at the top, and its `accent` themes the page: see `brandThemeStyle`. |
| description | ReactNode | — | Supporting copy under `title`. |
| embedded | boolean | false | For an iframe: no header or footer chrome, a transparent background and no full-viewport height, so the frame is as tall as its content. The brand accent still applies. A host usually sets it from `?embed=1`. |
| footer | ReactNode | — | More footer content: privacy and terms links, an address. |
| maxWidth | enum | sm | Width of the content column: a `Container` size. Default `"sm"`. |
| poweredBy | ReactNode | — | Who runs the page, as "Powered by …" in the footer (a name or a link). Leave it out, or pass `false`, to hide it. |
| slotProps | SlotPropsFor<PublicPageSlotMap> | {} | More props for a default part, merged over what the page passes. |
| slots | Slots<PublicPageSlotMap> | {} | Replace (a component) or drop (`null`) the header or footer. |
| testID | string | public-page | testID on the root. Default `"public-page"`; parts use `${testID}-header`, `-main`, `-footer`. |
| title | ReactNode | — | Optional page heading, rendered as the page's `<h1>` above the content. Leave it out when the content brings its own (a form's title). |