Skip to content

Conversation

@jonathanyeong
Copy link
Contributor

@jonathanyeong jonathanyeong commented Jan 30, 2026

This replaces the tab list so it's extra clear to the user what package manager they've selected. It also lets use use it in the connector modal to be explicit on the package manager choice.

The dropdown is inspired by Stripe's dev docs

Testing

✅ Tests pass locally

Light Mode Desktop
light-mode-package-desktop.mp4
light-mode-connector-modal.mp4
Dark Mode Desktop
dark-mode-connector-modal.mp4
dark-mode-package-desktop.mp4
Mobile view
mobile-dropdown.mp4

Small bugfix on focus ring being cut off

Before After
Focus ring currently in prod Focus ring in current branch
hard-refresh-test.mp4

@vercel
Copy link

vercel bot commented Jan 30, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jan 31, 2026 7:20am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Jan 31, 2026 7:20am
npmx-lunaria Ignored Ignored Jan 31, 2026 7:20am

Request Review


<template>
<div class="relative">
<button
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Chose to build a custom dropdown because I think icons don't show up well in native select. Someone please correct me if I'm wrong!

@jonathanyeong
Copy link
Contributor Author

Not quite ready for review there's a bug when the install container is short

install container is short and cuts off the package manager list

aria-hidden="true"
/>
</button>
<div class="ml-auto flex items-center gap-2">
Copy link
Contributor

Choose a reason for hiding this comment

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

use ms-auto instead ml-auto (RTL support): check the contributing guide: https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md#rtl-support

</template>
</ClientOnly>
<span
class="i-carbon-chevron-down w-3 h-3"
Copy link
Contributor

Choose a reason for hiding this comment

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

use : to split collection and icon (small perf at UnoCSS)

@danielroe
Copy link
Member

much nicer 👌

: undefined
"
:aria-label="$t('settings.package_manager')"
class="absolute right-0 top-full mt-1 min-w-28 bg-bg-elevated border border-border rounded-lg shadow-lg z-50 overflow-hidden py-1"
Copy link
Contributor

@userquin userquin Jan 30, 2026

Choose a reason for hiding this comment

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

don't use left/right use inset-is and inset-ie respectivelly (when using absolute psotioning)

<span>{{ pm.label }}</span>
<span
v-if="selectedPM === pm.id"
class="i-carbon-checkmark w-3 h-3 text-accent ml-auto shrink-0"
Copy link
Contributor

Choose a reason for hiding this comment

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

replace ml-auto with ms-auto

@danielroe
Copy link
Member

FYI: #393 might mean this needs to have conflicts resolved.

we wouldn't render the tabs any more of course, but we'd keep the same approach for rendered install commands

Comment on lines 848 to 803
<PackageManagerTabs />
<PackageManagerSelect />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Remove PackageManagerTabs

This replaces the tab list so it's extra clear to the user what
package manager they've selected. It also lets use use it in the
connector modal to be explicit on the package manager choice.
/>
</button>
<div class="ms-auto flex items-center gap-2">
<PackageManagerSelect />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to remove this if we think it's too crowded in the connector install area.

</button>

<!-- Dropdown menu (teleported to body to avoid clipping) -->
<Teleport to="body">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't think of a better way to avoid clipping. But this means if JS is disabled you won't be able to open the dropdown. I checked in prod and currently you can't interact with the tabs with JS disabled.

It's not great either way, let me know if this is a blocker!

:aria-label="$t('package.get_started.pm_label')"
@keydown="onTabListKeydown"
>
<button
Copy link
Member

Choose a reason for hiding this comment

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

the way this works right now is that we render all the tabs + all the commands, and we use a data attribute on the root of the document to determine which one is displayed.

this means there's no flicker if you hard reload.

see #393

would you be able to follow the same pattern in this one? (or if it's tricky, let me know and I can adapt the same thing I did there, here....)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I just noticed that! Yes let me copy that pattern across.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know what you think of the updates. Thanks again for reminding me about that!

<span
class="pm-select-content"
:data-pm-select="pmOption.id"
:aria-hidden="pmOption.id !== selectedPM"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not ideal that we generate DOM elements that aren't visible. I tried to mitigate it for screen readers with aria hidden, but I'm open to ideas!

@jonathanyeong
Copy link
Contributor Author

jonathanyeong commented Jan 31, 2026

Sorry @danielroe I missed the e2e test!

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

beautiful!

@danielroe danielroe added this pull request to the merge queue Jan 31, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 31, 2026
@danielroe danielroe added this pull request to the merge queue Jan 31, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 31, 2026
@danielroe danielroe added this pull request to the merge queue Jan 31, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 31, 2026
@danielroe danielroe added this pull request to the merge queue Jan 31, 2026
Merged via the queue into npmx-dev:main with commit 6dd5750 Jan 31, 2026
13 checks passed
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.

3 participants