App frame

The App Frame component provides page structure and integrates with other navigation components.

  • Install
    npm install @pluralsight/ps-design-system-appframe
  • Import
    import AppFrame from '@pluralsight/ps-design-system-appframe'

Example

<AppFrame topnav={<TopNav />} sidenav={<CustomSideNav />}>
{/* page content here */}
</AppFrame>

If needed, you can control the the sidenav open state.

const [sidenavOpen, setOpen] = useState(false)
const close = () => setOpen(false)
const open = () => setOpen(true)
const toggle = sidenavOpen ? close : open
return (
<AppFrame
onRequestSideNavClose={close}
onRequestSideNavOpen={open}
topnav={<TopNav onMobileMenuClick={toggle} />}
sidenav={<CustomSideNav />}
sidenavOpen={sidenavOpen}
>
{/* page content here */}
</AppFrame>
)

A reference implementation of the Skills nav is available on codesandbox

Props

Name
Type
Description
Default
childrenReact.ReactNode
onRequestSideNavCloseEvent => voidcallback triggered when the sidenav should be closed. Use if controlling the open state
onRequestSideNavOpenEvent => voidcallback triggered when the sidenav should be opened. Use if controlling the open state
sidenavReact.ReactNode | ({ visible }) => React.ReactNodearea to display secondary navigation
sidenavOpenbooleancontrol if the sidenav container is opened
topnavReact.ReactNode | ({ closeSidenav, openSidenav, sidenavOpen }) => React.ReactNodearea to display primary navigation - such as a NavBar