PricingDocsAcademy
Bluesky ...
Wed, Dec 11, 10:14 PM

Link vs Button for single-page experience

  • Victor Giron

    1 month 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?
  • Lucas G

    1 month ago

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

    1 month 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
  • Victor Giron

    1 month ago

    Thank you Lucas, I'm starting to think that you're an AI hahaha
  • Lucas G

    1 month ago

    ๐Ÿ˜‚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.