Tabs
Tabs are not a component but plain markup with the platform classes ecc-tabs, ecc-tab, ecc-tab-active and ecc-tab-content. The page keeps the active tab in its own state.
Example
const [tab, setTab] = useState<"request" | "history">("request");
<div className="ecc-tabs">
<button className={"ecc-tab" + (tab === "request" ? " ecc-tab-active" : "")} onClick={() => setTab("request")}>Request</button>
<button className={"ecc-tab" + (tab === "history" ? " ecc-tab-active" : "")} onClick={() => setTab("history")}>History</button>
</div>
<div className="ecc-tab-content">
<div className="ecc-tab-pane" hidden={tab !== "request"}>...</div>
<div className="ecc-tab-pane" hidden={tab !== "history"}>...</div>
</div>
Hide inactive tabs with the hidden attribute instead of not rendering them. Fields in hidden tabs then stay registered and their values are part of the output.
CSS
Change the look in the CSS file of your workspace, see Styling.
| container of the buttons: tab bar |
| each button: tab, underlined on hover |
| the active button: underlined |
| number behind the tab name, e.g. open tasks |
| container of the tab bodies; |
| body of one tab (column, full height); hidden with |
Related
overview of all layout components | |
the usual content of a tab |
On this page
- Tabs