Loading
A render function is another pattern used in the library: a component takes a function as its children or a content prop, calls it with its own state, and renders what it returns. SplitView works this way, so its main content and sides can react to the current mode and open or close the sides.
import { Button } from '@nebula-kit/core'import { SplitView } from '@nebula-kit-private/pro' export const Layout = ({ navigate }) => ( <SplitView showPinButton ariaLabels={{ startSide: 'Menu' }} startSide={({ mode, pinned, setSideOpen }) => ( <Button onClick={async () => { if (mode === 'overlay' && !pinned.start) await setSideOpen('start', false) navigate('/settings') }} > Settings </Button> )} > Main content </SplitView>)