UNPKG

@payfit/unity-components

Version:

34 lines (33 loc) 1.7 kB
import { LinkComponent } from '@tanstack/react-router'; import { RawLink } from '../../../../components/link/RawLink.js'; /** * Unity's link that integrates with Tanstack Router for seamless client-side navigation. * Enables declarative routing with type-safe route parameters, search params, and automatic preloading capabilities. * @example * ```tsx * import { Link } from '@payfit/unity-components/integrations/tanstack-router' * * function Navigation() { * return ( * <Link to="/dashboard"> * Dashboard * </Link> * ) * } * ``` * @remarks * - Supports type-safe navigation with route parameters and search params * - Provides automatic route preloading on hover or mount via the `preload` prop * - Handles relative and absolute paths with `from` and `to` props for flexible routing * - Integrates seamlessly with Tanstack Router's navigation system and loader functions * - Maintains all accessibility features and styling options from the underlying RawLink component * - Automatically detects external URLs and applies appropriate security attributes (target="_blank", rel="noopener noreferrer") * @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/components/link GitHub} * @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma} * @see Design docs in {@link https://www.payfit.design/ Payfit.design} * @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io} */ declare const Link: LinkComponent<typeof RawLink> & { displayName: string; }; export { Link };