• Log inStart now

Tile

Usage

import { Tile } from 'nr1'

Examples

Props

ariaLabelstring

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

childrenrequirednode

Content to render inside the component.

classNamestring

Appends class names to the component.

Should be used only for positioning and spacing purposes.

disabledboolean

When true, the tile is not available for interaction.

onClickfunction

Callback fired any time the user clicks on the tile.

function (
event: React.MouseEvent
)
sizeTypeenum
DEFAULT
Tile.SIZE_TYPE.MEDIUM

Specifies the desired size of the tile (smaller sizes have less internal padding).

<One of
Tile.SIZE_TYPE.MEDIUM,
Tile.SIZE_TYPE.SMALL,
>
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
Tile.SPACING_TYPE.EXTRA_LARGE,
Tile.SPACING_TYPE.LARGE,
Tile.SPACING_TYPE.MEDIUM,
Tile.SPACING_TYPE.NONE,
Tile.SPACING_TYPE.OMIT,
Tile.SPACING_TYPE.SMALL,
>
>
styleobject

Inline style for custom styling.

Should be used only for positioning and spacing purposes.

testIdstring

Adds a data-test-id attribute. Use it to target the component in unit and E2E tests.

For a test id to be valid, prefix it with your nerdpack id, followed up by a dot.

For example, my-nerdpack.some-element.

Note: You might not see data-test-id attributes as they are removed from the DOM, to debug them pass a e2e-test query parameter to the URL.

toshape|string

Location object or url string to link to.

shape

pathnamerequiredstring
searchstring
hashstring
typeenum
DEFAULT
Tile.TYPE.OUTLINE

Type can be:

  • Plain — use when tiles don't need to be emphasized.

  • Outline — the default tile type.

  • Solid — use when tiles needs to contrast against a white background.

<One of
Tile.TYPE.OUTLINE,
Tile.TYPE.PLAIN,
Tile.TYPE.SOLID,
>
valuestring|number

Unique identifier of the tile. Used by the <TileGroup> to identify checked tiles.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.