Skip to main content

Link

Use links as navigational elements.

LinkImport

import { Link } from '@dynatrace/strato-components-preview/typography';

Use cases

Use the Link component to navigate to a different page within the application.

To link to an internal resource, you can use a Link component. To achieve this, the Link usually needs to be polymorphed into a component from a routing library like the Link component from the react-router-dom package, so its API can be used. While a Link can technically link to an external resource, ExternalLink should be used in this case instead.

CodeSandbox

To polymorph a Link into a React RouterLink, the React RouterLink has to be passed to the as property. Additionally, instead of setting the href property the to property has to be set.

CodeSandbox

Props

LinkProps

Signature:

export declare type LinkProps<E extends > = <E, & & >;
Still have questions?
Find answers in the Dynatrace Community