Tabs
Views of one page; arrows, Home and End move between them.
import { Tabs } from "@forgeron/ui";Overview of the tool.
import { Tabs } from "@forgeron/ui";
import { useState } from "react";
const tabs = [
{ id: "overview", label: "Overview" },
{ id: "activity", label: "Activity" },
{ id: "settings", label: "Settings" },
];
export default function Default() {
const [tab, setTab] = useState("overview");
return (
<div style={{ width: "100%", maxWidth: 520 }}>
<Tabs label="Tool" tabs={tabs} value={tab} onChange={setTab}>
{tabs.find((t) => t.id === tab)?.label} of the tool.
</Tabs>
</div>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Names the tab list. |
tabs | { id, label }[] | — | The tabs. |
value | string | — | The selected id. |
onChange | (id: string) => void | — | On a new tab. |
children | ReactNode | — | The panel of the selected tab. |
className | string | — | Extra classes. |