Skip to content

Migrate Tabs component from Bootstrap to Mantine.#26137

Open
linuspahl wants to merge 9 commits into
masterfrom
mantine-tabs
Open

Migrate Tabs component from Bootstrap to Mantine.#26137
linuspahl wants to merge 9 commits into
masterfrom
mantine-tabs

Conversation

@linuspahl
Copy link
Copy Markdown
Contributor

@linuspahl linuspahl commented May 27, 2026

Description

Motivation and Context

We are migrating our bootstrap based components to Mantine. This PR migrates the common Tabs component and removes the preflight Tab component.

Initially I tried using an approach where we make only changes to our Tab and Tabs component and avoid any change to their usage. See 87806fb

This approach was a bit hack (empty Tab component, extracting props from children array) and I migrated the Tabs usage to the Mantine structure.

The react-bootstrap API colocated the tab button and panel content in a single <Tab> component:

<Tabs defaultActiveKey="a" activeKey={active} onSelect={setActive} animation={false}>
  <Tab eventKey="a" title="Label A">panel content</Tab>
  <Tab eventKey="b" title="Label B">panel content</Tab>
</Tabs>

The Mantine API separates the tab buttons (Tabs.List / Tabs.Tab) from the panel content (Tabs.Panel), which mirrors the underlying HTML ARIA tabs pattern:

<Tabs defaultValue="a" value={active} onChange={setActive}>
  <Tabs.List>
    <Tabs.Tab value="a">Label A</Tabs.Tab>
    <Tabs.Tab value="b">Label B</Tabs.Tab>
  </Tabs.List>
  <Tabs.Panel value="a">panel content</Tabs.Panel>
  <Tabs.Panel value="b">panel content</Tabs.Panel>
</Tabs>

/nocl - refactoring

@linuspahl linuspahl changed the title Migrate Tabs component from bootstrap to mantine. Migrate Tabs component from Bootstrap to Mantine. May 27, 2026
import navTabsStyles from './styles/nav-tabs';

const Tabs = styled(BootstrapTabs)`
${navTabsStyles}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo removing the navTabsStyles here improves the styling.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example it removes the border for the tab panel.

@linuspahl linuspahl marked this pull request as ready for review May 27, 2026 09:39
@linuspahl linuspahl marked this pull request as draft May 27, 2026 09:39
@linuspahl linuspahl marked this pull request as ready for review May 27, 2026 14:56
@linuspahl linuspahl requested a review from a team May 27, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant