Logo
ProductChangelogPricing
Try it free
Logo
Logo
DocsPrivacyTermsRSS

©Quotion 2025. All rights reserved.

Made with
  1. Post
  2. Radix UI tips

Engineering

1 min read

Radix UI tips

Written by

QI

Qing

Creator, Quotion

Published on

1/10/2024

Table of contents

Group tooltips

The image showcases a design system called 'Radix Primitives,' featuring various UI components. Each component, such as 'Edit Profile,' 'Options,' and 'Dimensions,' is presented within a colorful, gradient-filled box. The overall mood is clean and modern, highlighting the system's focus on accessible and well-designed UI elements.

#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.

Learn MoreTry It Free

Subscribe to Quotion

Get the latest posts delivered to your inbox. No spam, unsubscribe anytime.

We care about your data in our privacy policy.

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

View all posts