Build a mobile popover menu with Svelte & OpenProps

Sdílet
Vložit
  • čas přidán 30. 05. 2024
  • In this video, I'll discuss how to use the new Popover API and use Svelte & OpenProps to build a animated mobile menu.
    Source Code: github.com/joshnuss/open-prop...
    Links:
    - Popover API: developer.mozilla.org/en-US/d...
    - OpenProps: open-props.style
  • Věda a technologie

Komentáře • 9

  • @blokche_dev
    @blokche_dev Před 19 dny +1

    Really like how Svelte leverage the platform with a minimal impact on the bundle size. Thanks for sharing!

  • @TomSmallwood
    @TomSmallwood Před 18 dny +2

    Built these plenty of times but so nice to see how someone else builds it, picked up a few things. Enjoyed the video Josh, thank you!!!!

  • @adamshand
    @adamshand Před 19 dny

    Helpful, thanks!

  • @ScottSpencePlease
    @ScottSpencePlease Před 19 dny

    Super simple explanation Josh! Thanks for the content

    • @josh_nussbaum
      @josh_nussbaum  Před 19 dny

      Thanks Scott! 🙇
      Was just reading your piece about patching, the newsletter is great 🙌

  • @sinankesk_in
    @sinankesk_in Před 18 dny

    Great tricks. Thank you Josh.

  • @HaaniJaber
    @HaaniJaber Před 19 dny +1

    What's the best way to close the popover when clicking on a ?
    Looking for good a11y as well as the menu to close once a link is clicked.

    • @josh_nussbaum
      @josh_nussbaum  Před 19 dny +1

      A few ways to do that in an SPA
      Handle on:click on links (without doing a preventDefault) and call popover.hidePopover()
      Another way, with SvelteKit, is to handle beforeNavigate and call popover.hidePopover()