Polymorphic Link

Astryx components that render links can use a custom link component instead of native <a>. Set it globally via LinkProvider or per-component via the as prop.

Provider Demo

All components below are wrapped in LinkProvider with a simulated Next.js Link (blue dashed outline). Open the browser console to see navigation logs.

Per-Component Override

The as prop overrides the provider for a single component. Below, the provider sets the blue link, but "Products" uses a green link via as={GreenLink}.

Default Behavior

Without a provider or as prop, components render native <a> elements as usual.