Replace @radix-ui/react-tabs with the Tabs component from Headless UI

Open
#511 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start with src/tabs/tabs.tsx at the linked Radix import, then read issue #232 about the React and Headless UI v2 upgrade. Define the component's prop interface independently of the underlying library and migrate Tabs to Headless UI after that upgrade. Done means the extra tabs dependency is no longer needed and the breaking interface change is addressed.

Written by the indexing model from the issue text.

Description

release: major status: blocked

Description

We are using @radix-ui/react-tabs as the base of the Tabs component:

https://github.com/freeCodeCamp/ui/blob/5b612c4b17e9d0aba5b8ddb611ad284ac67d53b5/src/tabs/tabs.tsx#L2

Since we build other components with Headless UI and this library also provides Tabs, I think we should update our Tabs to use Headless UI, too, to remove an extra dependency.

The Tabs component is using radix-ui/react-tabs props interface, so switching to Headless UI and use its props interface would be a breaking change. We might want to take this opportunity to define a prop interface for the component, so that the interface doesn't depend on the external library.

[!NOTE]
This change should be made after we have upgraded Headless UI to v2, which requires a React upgrade (#232).

Dominant language
TypeScript
Stars
77
Forks
38
Avg merge
5h 51m
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from freeCodeCamp/ui

All issues in freeCodeCamp/ui

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.