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
How It Works
The Arrow component:- Renders an SVG element with a triangle polygon by default
- Uses
preserveAspectRatio="none"to allow stretching - Can be replaced entirely using the
asChildprop - Is positioned by parent Popper components using CSS transforms