|
|
|
|
|
by madeofpalk
2241 days ago
|
|
There's not really much of a delimma. This is a problem that was solved in "single page apps" 10 years ago. - links are for navigation
- buttons are for action
Styling and appearance are not a factor - you can make buttons look like links, links look like buttons.Simple rule is "should this view have a url". Should the user be able to navigate directly to this page? Should it exist in the history? Should the user be able to share a URL to that page to someone else? Most times the answer to all of these is. In your javascript application, it is trivial to do single page app view navigations (without triggering a full browser request) by listening to link clicks and acting on it just as you would if it were a button click. All frameworks and routing libraries will handle this for you out of the box. If you roll your own, its not that difficult to add this functionality. |
|
Are tabs a view? Should they be buttons or links? What if the tabs are in the sidebar in some widget?
What about collapsible items? HN uses JavaScript to store your collapsible preferences to your account. Not shareable but consistent on page refresh. Is that good? I don't know.
The fact is, in PWA world, what's a links and what's a button is blurred, and there's nothing wrong with admitting it.