mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## Context Update database triggers to use the new page components + add deprecation notices to legacy components There's no visual change here --------- Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
56 lines
1.8 KiB
Plaintext
56 lines
1.8 KiB
Plaintext
---
|
|
title: Page Nav
|
|
description: Sub-navigation row for page chrome, placed below breadcrumbs and outside PageHeader.
|
|
fragment: true
|
|
---
|
|
|
|
<ComponentPreview
|
|
name="page-nav-demo"
|
|
description="Sub-navigation with NavMenu tabs"
|
|
align="start"
|
|
className="p-0"
|
|
padded={false}
|
|
peekCode
|
|
wide
|
|
/>
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { NavMenu, NavMenuItem } from 'ui'
|
|
import { PageNav } from 'ui-patterns/PageNav'
|
|
```
|
|
|
|
```tsx
|
|
<PageNav>
|
|
<NavMenu>
|
|
<NavMenuItem active>Overview</NavMenuItem>
|
|
<NavMenuItem>Logs</NavMenuItem>
|
|
</NavMenu>
|
|
</PageNav>
|
|
```
|
|
|
|
## Sub-components
|
|
|
|
- `PageNav` — container for `NavMenu` tab navigation. The bottom border always spans the full width.
|
|
|
|
## Props
|
|
|
|
| Prop | Type | Default | Description |
|
|
| ------ | ------------------------------------------- | -------- | -------------------------------------------------------------------- |
|
|
| `size` | `'small' \| 'default' \| 'large' \| 'full'` | `'full'` | Width and padding of the nav content, same values as `PageContainer` |
|
|
|
|
`PageNav` uses `PageContainer` for width and padding. It does not depend on `PageHeader`.
|
|
|
|
Set `size` to match the sibling `PageHeader` and page content so the tabs line up with the title and body. With `full` (the default), the tabs span edge to edge with the page chrome's `px-4` padding. Any other size uses `PageContainer`'s max-width and padding, so on wide viewports the tabs stay centered with the rest of the page.
|
|
|
|
```tsx
|
|
<PageHeader size="large">…</PageHeader>
|
|
<PageNav size="large">
|
|
<NavMenu>…</NavMenu>
|
|
</PageNav>
|
|
<PageContainer size="large">…</PageContainer>
|
|
```
|
|
|
|
Place it directly below `PageBreadcrumbs` and outside `PageHeader`. For legacy pages, `PageHeaderNavigationTabs` remains available on `PageHeader`.
|