Skip to main content

Common Examples

To use the Link, import it from @servicetitan/anvil2-ai-kit and pass a required text prop. The kit forbids children; all content flows through typed props.
Without an href, React Aria renders a <span role="link">. For client-side routing, configure a React Aria RouterProvider at the app root so href is router-aware.

New tab

Set target="_blank" to open in a new tab. Link appends an open-in-new icon, defaults rel to "noopener noreferrer" unless you pass rel, and announces “(opens in a new tab)” to assistive technology.

Inline in text

Link renders inline, so it wraps with surrounding copy. Nest it in Text through the text prop.

Wrapping

Long labels wrap like any other inline text.

Internationalization

Link uses the ai-kit.link.opensInNewTab message for the new-tab announcement. English is the default. Mount AiKitIntlProvider inside CartoTheme to switch locale or override that string without colliding with your app’s react-intl context.

React Accessibility

  • Every Link requires text, which is the visible label and accessible name.
  • target="_blank" adds an “(opens in a new tab)” announcement and a presentational trailing icon.
  • Users activate a focused link with Enter.
Last modified on August 28, 2026