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

    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

View all posts