Generic tab switcher for trade UIs (Buy / Sell / Stake, or any other named tab set). Single-select, button-based, accessible.
type TradeTab = BuyTab | SellTab | StakeTab
Web3.Ui.TradeTabs.view []
{ current = model.tradeTab
, onSelect = ChangeTradeTab
, tabs =
[ { id = BuyTab, label = "Buy" }
, { id = SellTab, label = "Sell" }
, { id = StakeTab, label = "Stake" }
]
}CSS classes: web3-tradetabs, web3-tradetabs__tab, web3-tradetabs__tab--active.
Which tab is selected, where selections go, and the tab set. id is your
app's tab type.
One tab definition. id is your app's tab type; label is what users see.
Render the switcher.