Link vs Button for single-page experience

  • victoruxui-1298094745461067827

    Victor Giron

    5 months ago

    Hey everyone, I'm building a dashboard and I was thinking to use <a> elements for the sidebar menu, to change the path of the page and depending on that, display the content for each section.

    Using <a> renders the whole page and the sidebar menu sometimes flicks for a milisecond.

    When I use <button> this doesn't happen.

    What's the recommended way to do this?
  • lucasg-1298095213700583466

    Lucas G

    5 months ago

    Links (<a> tags with href attributes) are for navigating to a new page, it is reloading the page
  • lucasg-1298095570665345065

    Lucas G

    5 months ago

    If it's an SPA type of setup where the path determines show conditions then it wouldn't be needed or why do you need them to be link tags
    ๐Ÿ”ฅ2
  • victoruxui-1298095837280338020

    Victor Giron

    5 months ago

    Thank you Lucas, I'm starting to think that you're an AI hahaha
  • ๐Ÿ˜‚3

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code โ€” but accessible to your entire team!

Try toddle โ€” it's free!

ยฉ Copyright 2024 toddle. All rights reserved.