Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tabs api #698

Merged
merged 4 commits into from
Jul 28, 2021
Merged

Change tabs api #698

merged 4 commits into from
Jul 28, 2021

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Jul 28, 2021

This PR changes the API of the Tabs component. This is not considered a breaking change since we didn't release this API yet (we did publish a dev version of this).

The main reason we did this is because it looked kind of odd for the Vue implementation.

Old (React):

<Tabs>
  <Tabs.List>
    <Tabs.Tab>Tab 1</Tabs.Tab>
    <Tabs.Tab>Tab 2</Tabs.Tab>
    <Tabs.Tab>Tab 3</Tabs.Tab>
  </Tabs.List>

  <Tabs.Panels>
    <Tabs.Panel>Tab 1</Tabs.Panel>
    <Tabs.Panel>Tab 2</Tabs.Panel>
    <Tabs.Panel>Tab 3</Tabs.Panel>
  </Tabs.Panels>
</Tabs>

New (React)

<Tab.Group>
  <Tab.List>
    <Tab>Tab 1</Tab>
    <Tab>Tab 2</Tab>
    <Tab>Tab 3</Tab>
  </Tab.List>

  <Tab.Panels>
    <Tab.Panel>Tab 1</Tab.Panel>
    <Tab.Panel>Tab 2</Tab.Panel>
    <Tab.Panel>Tab 3</Tab.Panel>
  </Tab.Panels>
</Tab.Group>

Old (Vue):

<Tabs>
  <TabsList>
    <TabsTab>Tab 1</TabsTab>
    <TabsTab>Tab 2</TabsTab>
    <TabsTab>Tab 3</TabsTab>
  </TabsList>

  <TabsPanels>
    <TabsPanel>Tab 1</TabsPanel>
    <TabsPanel>Tab 2</TabsPanel>
    <TabsPanel>Tab 3</TabsPanel>
  </TabsPanels>
</Tabs>

New (Vue)

<TabGroup>
  <TabList>
    <Tab>Tab 1</Tab>
    <Tab>Tab 2</Tab>
    <Tab>Tab 3</Tab>
  </TabList>

  <TabPanels>
    <TabPanel>Tab 1</TabPanel>
    <TabPanel>Tab 2</TabPanel>
    <TabPanel>Tab 3</TabPanel>
  </TabPanels>
</TabGroup>

| Before        | After        |
| ------------- | ------------ |
| `Tabs`        | `Tab.Group`  |
| `Tabs.List`   | `Tab.List`   |
| `Tabs.Tab`    | `Tab`        |
| `Tabs.Panels` | `Tab.Panels` |
| `Tabs.Panel`  | `Tab.Panel`  |
| Before       | After       |
| ------------ | ----------- |
| `Tabs`       | `TabGroup`  |
| `TabsList`   | `TabList`   |
| `TabsTab`    | `Tab`       |
| `TabsPanels` | `TabPanels` |
| `TabsPanel`  | `TabPanel`  |
@vercel
Copy link

vercel bot commented Jul 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-vue – ./packages/@headlessui-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/7fZmMN69faShjj3VG7gT5hnbuaWa
✅ Preview: https://headlessui-vue-git-change-tabs-api-tailwindlabs.vercel.app

headlessui-react – ./packages/@headlessui-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/3ytwHEgaAkw69WRoSaZ51BsG5rjF
✅ Preview: https://headlessui-react-git-change-tabs-api-tailwindlabs.vercel.app

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