
#Engineering
Radix UI is a popular React library to build accessible products. Here is a neat tip I found very useful.
Group tooltips
Use TooltipProvider to group all tooltips together, to get a better transition experience. See my demo (The brand color example isn’t grouped, the background color example is grouped)👇
Code example:
export function BackgroundColor() {
return (
<div>
// ✅ Lift it here
<TooltipProvider>
<ul className="flex flex-wrap gap-x-6 gap-y-4">
{COLORS.map(({ name, className, hex }) => (
<li key={name}>
// ❌ Don't use TooltipProvider here
<Tooltip>
<TooltipTrigger
className={clsx(
'h-7 w-7 rounded-sm border',
FOCUS_RING_ERROR_SHADOW_XS,
className,
)}
type="button"
/>
<TooltipContent>
<p className="pb-1.5 text-xs font-medium text-gray-500">
{name}
</p>
<p className="text-sm font-semibold text-gray-600">{hex}</p>
</TooltipContent>
</Tooltip>
</li>
))}
</ul>
</TooltipProvider>
</div>
);
}Thanks to RadixUI’s consistency, this tip can be applied to many other Radix components as well, for example: hover-card.
Create your blogs directly from Apple Notes.
Say goodbye to complex CMS updates and management issues!
You focus on creating quality content while Quotion takes care of the rest.
Subscribe to Quotion
Get the latest posts delivered to your inbox. No spam, unsubscribe anytime.
Latest
More from the site
Qing
ProductUpdate
Post visibility and search engine indexing controls
#ProductUpdate We're excited to introduce new features that give you more control over your posts! Post visibility Control whether posts appear in your site's content listing while remaining accessibl
Read post
Qing
ProductUpdate
Post scheduling and published date editing
#ProductUpdate We’re excited to announce 2 new features: you can now schedule posts to go live at a specific time and edit the published date of your posts! How to schedule a Post Need to announce som
Read post
Qing
ProductUpdate
Layout editor
#ProductUpdate 🔥 I'm so excited to announce that the layout editor is live now. You can easily edit your site layout inside the design page, home note is no longer needed! All home note functionalit
Read post
