0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Radix UIのTooltip.Arrowをカスタマイズする

Posted at

Radix UIのTooptipを表示する時に、それの下の三角はデフォルトが黒三角ですが、実際のデザインに合わせて、独自な三角を描画する方法をメモする。

デフォルト三角

スクリーンショット 2025-03-26 16.45.20.png

デザインの三角

  • 白い背景
  • Strokeあり

スクリーンショット 2025-03-26 16.35.50.png

実装方法

svgタグを使って、その中でpolylineタグにより直接に線を引く

<RadixTooltip.Arrow asChild width={10} height={5}>
  <svg className="fill-white stroke-slate300 stroke-[2px]">
    <polyline points="0,0 15,10 30,0" />
  </svg>
</RadixTooltip.Arrow>
  • svgタグのclass名に直接fill-white色などを記載できる
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?