Skip to content

Tabs mobile view - #29

Open
kmcgowan0 wants to merge 1 commit into
mainfrom
feat/tabs
Open

Tabs mobile view#29
kmcgowan0 wants to merge 1 commit into
mainfrom
feat/tabs

Conversation

@kmcgowan0

Copy link
Copy Markdown
Contributor

No description provided.

@kmcgowan0
kmcgowan0 requested a review from danbahrami April 24, 2026 12:25
@vercel

vercel Bot commented Apr 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
taylorui Ready Ready Preview, Comment Apr 24, 2026 0:25am

@danbahrami danbahrami left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The select box looks good, I've left some nitpick comments where I can see that there are focusable elements that are defining their own focus style instead of using our shared focus-ring classname. Please fix these before merging.

As a higher-level point, I think now there is enough substance to the tabs components to warrant centralising all the styles and logic into /ui/tabs/tabs.tsx. Rather than directly using the tabs components from react-aria you would import them from here and you'd get all this styling and default behaviour (e.g. force mount) out-the-box

This would make the usage consistent with our other components: modal, accordion etc...

import { Tabs, etc... } from '@/ui/tabs/tabs.tsx';

<Tabs>
  <TabList className="hidden md:block">
    <Tab>
      <RiFoldersLine aria-hidden="true" />
       Tab 1
    <Tab>
    ...
  </TabList>
  <TabSelect className="block md:hidden">
    <option value="panel-1">Panel 1</option>
  </TabSelect>
  <TabPanels>
    <TabPanel id="panel-1">
      Tab panel content
    </TabPanel>
    ...
  </TabPanels>
</Tabs>

Bonus points if the tab select could work both as a controlled and uncontrolled component so the tab components can internally keep track of the currently selected tab. That would make them really easy to use I think.

<select
value={selectedKey}
onChange={(e) => setSelectedKey(e.target.value)}
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-12 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-12 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-12 shadow-sm focus-ring"

key={index}
id={index}
id={String(index)}
className="data-[selected=true]:text-primary-600 data-[selected=true]:after:bg-primary-600 data-[selected=true]:hover:bg-primary-100 focus-ring-inverse relative flex cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 after:absolute after:right-0 after:-bottom-1.5 after:left-0 after:h-[2px] after:rounded after:bg-transparent hover:bg-gray-100 hover:after:bg-gray-600 focus-visible:ring-2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="data-[selected=true]:text-primary-600 data-[selected=true]:after:bg-primary-600 data-[selected=true]:hover:bg-primary-100 focus-ring-inverse relative flex cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 after:absolute after:right-0 after:-bottom-1.5 after:left-0 after:h-[2px] after:rounded after:bg-transparent hover:bg-gray-100 hover:after:bg-gray-600 focus-visible:ring-2"
className="data-[selected=true]:text-primary-600 data-[selected=true]:after:bg-primary-600 data-[selected=true]:hover:bg-primary-100 focus-ring-inverse relative flex cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 after:absolute after:right-0 after:-bottom-1.5 after:left-0 after:h-[2px] after:rounded after:bg-transparent hover:bg-gray-100 hover:after:bg-gray-600 focus-ring"

<select
value={selectedKey}
onChange={(e) => setSelectedKey(e.target.value)}
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-10 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-10 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-10 shadow-sm focus-ring"

key={index}
id={index}
id={String(index)}
className="data-[selected=true]:text-primary-600 data-[selected=true]:before:bg-primary-600 data-[selected=true]:hover:bg-primary-100 relative flex w-max cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 before:absolute before:inset-y-0 before:-left-1.5 before:w-[2px] before:bg-transparent hover:bg-gray-100 hover:before:bg-gray-600 focus-visible:ring-2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="data-[selected=true]:text-primary-600 data-[selected=true]:before:bg-primary-600 data-[selected=true]:hover:bg-primary-100 relative flex w-max cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 before:absolute before:inset-y-0 before:-left-1.5 before:w-[2px] before:bg-transparent hover:bg-gray-100 hover:before:bg-gray-600 focus-visible:ring-2"
className="data-[selected=true]:text-primary-600 data-[selected=true]:before:bg-primary-600 data-[selected=true]:hover:bg-primary-100 relative flex w-max cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 before:absolute before:inset-y-0 before:-left-1.5 before:w-[2px] before:bg-transparent hover:bg-gray-100 hover:before:bg-gray-600 focus-ring"

<select
value={selectedKey}
onChange={(e) => setSelectedKey(e.target.value)}
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-12 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-12 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-12 shadow-sm focus-ring"

<Tab
key={index}
id={String(index)}
className="data-[selected=true]:text-primary-600 data-[selected=true]:after:bg-primary-600 data-[selected=true]:hover:bg-primary-100 focus-ring-inverse relative flex cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 after:absolute after:right-0 after:-bottom-1.5 after:left-0 after:h-[2px] after:rounded after:bg-transparent hover:bg-gray-100 hover:after:bg-gray-600 focus-visible:ring-2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="data-[selected=true]:text-primary-600 data-[selected=true]:after:bg-primary-600 data-[selected=true]:hover:bg-primary-100 focus-ring-inverse relative flex cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 after:absolute after:right-0 after:-bottom-1.5 after:left-0 after:h-[2px] after:rounded after:bg-transparent hover:bg-gray-100 hover:after:bg-gray-600 focus-visible:ring-2"
className="data-[selected=true]:text-primary-600 data-[selected=true]:after:bg-primary-600 data-[selected=true]:hover:bg-primary-100 focus-ring-inverse relative flex cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 after:absolute after:right-0 after:-bottom-1.5 after:left-0 after:h-[2px] after:rounded after:bg-transparent hover:bg-gray-100 hover:after:bg-gray-600 focus-ring"

<select
value={selectedKey}
onChange={(e) => setSelectedKey(e.target.value)}
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-10 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-10 shadow-sm focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="text-primary-500 w-full appearance-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-10 shadow-sm focus-ring"

<Tab
key={index}
id={String(index)}
className="data-[selected=true]:text-primary-600 data-[selected=true]:before:bg-primary-600 data-[selected=true]:hover:bg-primary-100 relative flex w-max cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 before:absolute before:inset-y-0 before:-left-1.5 before:w-[2px] before:bg-transparent hover:bg-gray-100 hover:before:bg-gray-600 focus-visible:ring-2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick:

Suggested change
className="data-[selected=true]:text-primary-600 data-[selected=true]:before:bg-primary-600 data-[selected=true]:hover:bg-primary-100 relative flex w-max cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 before:absolute before:inset-y-0 before:-left-1.5 before:w-[2px] before:bg-transparent hover:bg-gray-100 hover:before:bg-gray-600 focus-visible:ring-2"
className="data-[selected=true]:text-primary-600 data-[selected=true]:before:bg-primary-600 data-[selected=true]:hover:bg-primary-100 relative flex w-max cursor-pointer gap-2.5 rounded-md px-2 py-1 font-semibold text-gray-600 before:absolute before:inset-y-0 before:-left-1.5 before:w-[2px] before:bg-transparent hover:bg-gray-100 hover:before:bg-gray-600 focus-ring"

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.

2 participants