URL tabs
Tabs with their own URL: instant to switch, and a reload or a shared link lands on the right tab.
Patch tabs
Give each tab a
patch
and the tabs are routes of one LiveView. A click switches the active tab and panel on the client at once,
then patches the URL; the app sets
value
from
handle_params
.
Only the active panel is rendered unless you pass
keep
, which leaves visited panels in the DOM, hidden.
Try it: type in the note, switch to Members and back, then reload the page. The note is kept while you stay on the page (hidden panels stay in the DOM), and the reload lands on the same tab.
Navigate tabs
Tabs that lead to separate LiveViews
use
navigate
.
The bar is a navigation landmark of links with
aria-current="page"
and there are no panels. Open one of the
pages below to see the bar in place.
Each link is a different LiveView. Choose one to navigate.
Notes
- Patch tabs use the ARIA tabs pattern with manual activation: arrows move focus, Enter or Space activates.
- Each tab is a real link, so open-in-new-tab and copy-link work.
-
keep=truerenders every panel; a list of visited values (seeSutraUI.Tabs.visit/2) renders only those.