Back to Components

Navigation

NavItem

Sidebar navigation row with three slots: dot (left) / label (middle) / aside (right). Renders a <button>.

Examples

Sidebar

<Card padding={false}>
  <div class="navlist">
    <NavItem active={active === 'library'} onclick={() => active = 'library'}>
      {#snippet dot()}<Lamp state="running" />{/snippet}
      Library
      {#snippet aside()}1,204{/snippet}
    </NavItem>
    …
  </div>
</Card>

Props

PropTypeDefaultDescription
activebooleanfalseHighlight the row as the current page.
dotSnippetLeft-side slot — typically a <Lamp /> or icon.
asideSnippetRight-side slot — count, badge, etc.
...restHTMLButtonAttributesSpread onto the underlying <button>.

Install

CLI

npx @a3tai/mittsu add nav-item