• /
  • Log in

Link

Provides declarative, accessible navigation around the application and external links.

Usage

import { Link } from 'nr1'

Examples

Props

ariaLabelstring

Use it to describe better the context of the component's action for users on screen readers.

childrenrequirednode

Content of the link.

classNamestring

Appends class names to the component.

Should be used only for positioning and spacing purposes.

onClickfunction

Callback fired any time the user clicks on the link.

function (
event: Event
) => undefined
spacingTypeenum[]

Spacing property. Spacing is defined as a tuple of zero to four values, which follow the same conventions as CSS properties like margin or padding. To omit a value, use SPACING_TYPE.OMIT.

<Array of
<One of
Link.SPACING_TYPE.EXTRA_LARGE,
Link.SPACING_TYPE.LARGE,
Link.SPACING_TYPE.MEDIUM,
Link.SPACING_TYPE.NONE,
Link.SPACING_TYPE.OMIT,
Link.SPACING_TYPE.SMALL,
>
>
styleobject

Inline style for custom styling.

Should be used only for positioning and spacing purposes.

testIdstring

Adds a data-test-id.

Used to target the component in unit and e2e testing.

toshape|string

Location object or url string to link to.

shape

pathnamerequiredstring
searchstring
hashstring

Methods

Link.render

function () => undefined
Create issueEdit page
Copyright © 2021 New Relic Inc.