Skip to content

closeNav

closeNav(): void

Defined in: components/main.ts:710

Close the navigation, if it’s showing as an overlay — the full panel it becomes on a narrow shell. A sidebar isn’t an overlay and has nothing to dismiss, so on a wider shell this does nothing.

A navigation closes the nav by itself, links in your own custom rows included, so this is for the items that don’t navigate — one that opens a dialog, or flips a setting, and should still get the nav out of the way.

void

S.main({
nav: { items: [
{ label: "Inbox", href: "/inbox" },
() => S.button({ content: "New message", click: () => { S.closeNav(); compose(); } }),
]},
routes: { ... },
});