79086097

Date: 2024-10-14 12:11:52
Score: 0.5
Natty:
Report link

Bind a variable to the input's checked

And toggle through the button or a tag with onclick

let drawerState = $state(false)

<input id="navbar-drawer" type="checkbox" class="drawer-toggle" bind:checked={drawerState} />

<NavbarItem {name} {href} onclick={() => (drawerState = false)} />
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: G3N