SPB Git

Repository Public

tooltip.tsx 723 B 19 lines tsx

1'use client';2import * as React from 'react';3import * as T from '@radix-ui/react-tooltip';45export const TooltipProvider = T.Provider;6export function Tooltip({ content, children, side = 'top' }: { content: React.ReactNode; children: React.ReactNode; side?: 'top' | 'right' | 'bottom' | 'left' }) {7  if (content == null || content === '') return <>{children}</>;8  return (9    <T.Root>10      <T.Trigger asChild>{children}</T.Trigger>11      <T.Portal>12        <T.Content side={side} sideOffset={6} collisionPadding={8} className="anim-fade z-[80] max-w-xs rounded-sm border border-line-2 bg-elevated px-2 py-1 text-xs text-text shadow-pop">13          {content}14        </T.Content>15      </T.Portal>16    </T.Root>17  );18}19
Files main
Menu

Theme