#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
AppleNotes
Apple Notes Updates 2024
#AppleNotes iPad18 & iOS18 introduced many powerful new features for Apple Notes. Math Notes There is a new Math Notes folder in the Notes app, which you can type or write out mathematical expression
Read post
Qing
AppleNotes
How to Share Apple Notes and Collaborate with Others
#AppleNotes Did you know you can share your notes with other iCloud users in Apple Notes? Besides, you can also collaborate with others to work on the same notes, everyone can see each other's changes
Read post
Qing
AppleNotes
Use Templates in Apple Notes
#AppleNotes If you use Apple Notes daily like me, you may want to use templates to setup your daily notes quickly. Since Apple Notes doesn't have a built-in template feature. Here are some apps I foun
Read post