Skip to main content

React Link

React components and hooks for type-safe navigation. The primary navigation component for React applications.

Props

All LinkOptions from the core API, plus React-specific props:
ReactNode
Link content.
string | (isActive) => string
CSS class name. Can be a function receiving active state.
CSSProperties | (isActive) => CSSProperties
Inline styles. Can be a function receiving active state.
(e: MouseEvent) => void
Click handler.
(e: MouseEvent) => void
Mouse enter handler.
(e: MouseEvent) => void
Mouse leave handler.
(e: FocusEvent) => void
Focus handler.
(e: FocusEvent) => void
Blur handler.
(e: TouchEvent) => void
Touch start handler.

useLinkProps Hook

Generate props for custom link components.
Create reusable custom link components.

Custom Component

With Default Props

useNavigate Hook

Get a type-safe navigate function.
Declarative navigation component.

Props

string
required
Destination path.
Record<string, any>
Path parameters.
Search parameters.
string
URL hash.
boolean
Replace current history entry.Default: false

linkOptions Helper

Create reusable link configuration.

Examples

Dynamic ClassName

Search Param Updates

Form Submission Navigation

Conditional Navigation

View Transitions