Skip to content

Commit b2eda41

Browse files
committed
Docs updates from Erin
1 parent 9d69c05 commit b2eda41

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

packages/react-core/src/components/Page/Page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> {
2222
className?: string;
2323
/** @beta Indicates the layout variant */
2424
variant?: 'default' | 'docked';
25-
/** @beta Flag indicating the dock nav is expanded on mobile. Only applies when variant is dock. */
25+
/** @beta Flag indicating the docked nav is expanded on mobile. Only applies when variant is docked. */
2626
isDockExpanded?: boolean;
27-
/** @beta Flag indicating the dock nav should display text. Only applies when variant is dock. */
27+
/** @beta Flag indicating the docked nav should display text on desktop. Only applies when variant is docked. */
2828
isDockTextExpanded?: boolean;
2929
/** The horizontal masthead content (e.g. <Masthead />). When using the dock variant, this content will only render at mobile viewports. */
3030
masthead?: React.ReactNode;

packages/react-core/src/demos/Nav.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,25 @@ import { DashboardHeader } from '@patternfly/react-core/dist/js/demos/DashboardH
8080

8181
### Docked nav
8282

83-
The docked navigation pattern provides a responsive vertical navigation layout that adapts between mobile and desktop viewports. On mobile, the navigation appears as an overlay, while on desktop it displays as a persistent vertical sidebar that can toggle between icon-only and text+icon modes.
83+
To save space in the UI, you can use docked navigation to replace text-labeled navigation items with relevant icons. On mobile (or narrow viewports), docked navigation appears as an overlay, while on desktop (or wider viewports) it displays as a persistent vertical sidebar that can toggle between icon-only and text+icon modes.
8484

85-
**Key implementation requirements:**
86-
87-
1. **Page component**: Set `variant="docked"` to enable the docked layout. Pass `isDockExpanded` and `isDockTextExpanded` state props to control mobile overlay and desktop text visibility.
85+
This demo includes the following features:
8886

89-
2. **Masthead structure**: Use two separate mastheads:
90-
- **Mobile masthead**: Set `display={{ default: 'inline' }}` so it only appears on mobile. Include a hamburger toggle button, logo, and any mobile-specific actions.
91-
- **Docked masthead**: Set `variant="docked"` for the vertical navigation sidebar. This contains the navigation toggle, nav items, and action buttons.
87+
**Key implementation requirements:**
9288

93-
3. **Navigation component**: Set `variant="docked"` on Nav and pass `isTextExpanded={isDockTextExpanded}` to control text visibility. NavItems should include both icons and text children—the Nav component will handle showing/hiding text based on state.
89+
1. A [page](/components/page) component with a docked layout, enabled with `variant="docked"`. Control the mobile overlay with `isDockExpanded` and the desktop label visibility with `isDockTextExpanded`.
9490

95-
4. **Buttons and toggles**: Use `isDocked` and `isTextExpanded` props on Button and MenuToggle components within the docked navigation. These props apply dock-specific styling that toggles between icon-only and text+icon display.
91+
2. Two separate [masthead](/components/masthead) components:
92+
- **Horizontal mobile masthead**: Shown on small viewports using `display={{ default: 'inline' }}`, with a hamburger menu toggle button, brand logo, and action buttons that should be immediately visible to users.
93+
- **Vertical docked masthead**: Uses `variant="docked"` to create a thinner navigation sidebar with a hamburger menu toggle button, nav items, and action buttons.
9694

97-
5. **Logo variants**: Use `isCompact` prop on MastheadLogo to show an icon-only logo when the dock is collapsed, and a full logo with text when expanded.
95+
3. A [navigation](/components/navigation) component with `variant="docked"` and multiple `<NavItem>` components that must include both icons and text labels. To control text visibility, `isTextExpanded={isDockTextExpanded}` is passed to the `<Nav>` component.
9896

99-
6. **Focus management**: Implement focus shifting between the mobile toggle button and docked nav toggle button when opening/closing the navigation for better keyboard accessibility.
97+
4. [Button](/components/button) and [menu toggle](/components/menus/menu-toggle) components, which use `isDocked` and `isTextExpanded` to toggle between icon-only and text+icon styles. When the nav is docked, and only icons are shown, tooltips must provide full text labels for the navigation items, buttons, and menu toggles.
10098

101-
7. **Tooltips**: Only render tooltips when text is hidden (icon-only mode) to avoid showing redundant information when text labels are already visible.
99+
5. A `<MastheadLogo>` component that uses `isCompact` to show an icon-only logo when the dock is collapsed, and a full logo with text when expanded.
102100

103-
8. **State management**:
104-
- `isDockExpanded`: Controls whether the mobile overlay is shown
105-
- `isDockTextExpanded`: Controls whether text is displayed alongside icons on desktop
101+
**Note**: For better keyboard accessibility, ensure that focus shifts between the hamburger menu toggle button in the mobile masthead and the docked overlay menu toggle button as the navigation is opened and closed.
106102

107103
```ts file="./examples/Nav/NavDockedNav.tsx" isFullscreen
108104

0 commit comments

Comments
 (0)