Back to Primitives

Link

1:1Actions
View on GitHub

Navigation link.

Example
Shopify documentation
Usage
import { Link } from '@/components/polaris';

function Example() {
    return (
        <Link href="https://shopify.dev" external>
            Shopify documentation
        </Link>
    );
}
Component Source
import { forwardRef, createElement } from 'react';

type Props = JSX.IntrinsicElements['s-link'];

/**
 * Link component - makes text interactive for navigation.
 *
 *
 * @example
 * <Link href="/products">View products</Link>
 * <Link href="/delete" tone="critical">Delete account</Link>
 */
export const Link = forwardRef<HTMLElement, Props>((props, ref) => createElement('s-link', { ref, ...props }));

Link.displayName = 'Link';