Skip to main content

Overview

Arrow renders an SVG arrow element that can be used to point to referenced content in popovers, tooltips, and other floating elements. It’s typically positioned automatically by popper-based components.

Features

  • Renders as an SVG element
  • Customizable dimensions
  • Works with Radix Popper-based components
  • Can be replaced with custom content using asChild

Installation

Anatomy

API Reference

Root

The arrow component.
number
default:"10"
The width of the arrow in pixels.
number
default:"5"
The height of the arrow in pixels.
boolean
default:"false"
Change the default rendered element for the one passed as a child, merging their props and behavior.

Examples

Basic Usage

Custom Size

With Tooltip

Custom Arrow with asChild

Styling

The default arrow is an SVG with a simple triangle shape. You can style it using CSS:

Use with Popper Components

Arrow is designed to work with Radix’s Popper-based components:
  • Popover
  • Tooltip
  • Dropdown Menu
  • Context Menu
  • Hover Card
These components automatically position the arrow to point at the trigger element.

How It Works

The Arrow component:
  1. Renders an SVG element with a triangle polygon by default
  2. Uses preserveAspectRatio="none" to allow stretching
  3. Can be replaced entirely using the asChild prop
  4. Is positioned by parent Popper components using CSS transforms

Accessibility

The arrow is purely decorative and doesn’t affect accessibility. It’s automatically hidden from screen readers.