• /
  • EnglishEspañol日本語한국어Português
  • Log inStart now

Tile

Usage

import { Tile } from 'nr1'

Examples

Basic tile

<Tile onClick={console.log}>
<HeadingText type={HeadingText.TYPE.HEADING_6}>
Single location failure
</HeadingText>
<BlockText>
Check your company’s style guides. Great copy that doesn’t fit with the rest
of the interface or marketing materials can be jarring to users.
</BlockText>
</Tile>

Disabled tile

<Tile onClick={console.log} disabled>
<HeadingText type={HeadingText.TYPE.HEADING_6}>
Single location failure
</HeadingText>
<BlockText>
Check your company’s style guides. Great copy that doesn’t fit with the rest
of the interface or marketing materials can be jarring to users.
</BlockText>
</Tile>
<Tile to="https://login.newrelic.com/login">Login</Tile>

Sizes

<Stack>
<StackItem>
<Tile sizeType={Tile.SIZE_TYPE.SMALL} onClick={console.log}>
<HeadingText type={HeadingText.TYPE.HEADING_6}>
Single location failure
</HeadingText>
<BlockText>
Check your company’s style guides. Great copy that doesn’t fit with the
rest of the interface or marketing materials can be jarring to users.
</BlockText>
</Tile>
</StackItem>
<StackItem>
<Tile sizeType={Tile.SIZE_TYPE.MEDIUM} onClick={console.log}>
<HeadingText type={HeadingText.TYPE.HEADING_6}>
Single location failure
</HeadingText>
<BlockText>
Check your company’s style guides. Great copy that doesn’t fit with the
rest of the interface or marketing materials can be jarring to users.
</BlockText>
</Tile>
</StackItem>
</Stack>

Types

<Stack>
<StackItem>
<Tile onClick={console.log} type={Tile.TYPE.PLAIN}>
<HeadingText type={HeadingText.TYPE.HEADING_6}>
Single location failure
</HeadingText>
<BlockText>
Check your company’s style guides. Great copy that doesn’t fit with the
rest of the interface or marketing materials can be jarring to users.
</BlockText>
</Tile>
</StackItem>
<StackItem>
<Tile onClick={console.log} type={Tile.TYPE.OUTLINE}>
<HeadingText type={HeadingText.TYPE.HEADING_6}>
Single location failure
</HeadingText>
<BlockText>
Check your company’s style guides. Great copy that doesn’t fit with the
rest of the interface or marketing materials can be jarring to users.
</BlockText>
</Tile>
</StackItem>
<StackItem>
<Tile onClick={console.log} type={Tile.TYPE.SOLID}>
<HeadingText type={HeadingText.TYPE.HEADING_6}>
Single location failure
</HeadingText>
<BlockText>
Check your company’s style guides. Great copy that doesn’t fit with the
rest of the interface or marketing materials can be jarring to users.
</BlockText>
</Tile>
</StackItem>
</Stack>

Props

ariaLabel

string

Use it to describe better the context of the component's action for users on screen readers.<Tile to="/dashboards" ariaLabel="Go to your dashboard"> Dashboards </Tile>

children

REQUIRED
node

Content to render inside the component.

className

string

Appends class names to the component.Should be used only for positioning and spacing purposes.

disabled

boolean

When true, the tile is not available for interaction.

onClick

function

Callback fired any time the user clicks on the tile.function (

event: React.MouseEvent
)

sizeType

enum

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

Tile.SIZE_TYPE.MEDIUMTile.SIZE_TYPE.SMALL
>

spacingType

enum[]

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_LARGETile.SPACING_TYPE.LARGETile.SPACING_TYPE.MEDIUMTile.SPACING_TYPE.NONETile.SPACING_TYPE.OMITTile.SPACING_TYPE.SMALL
>
>

style

object

Inline style for custom styling.Should be used only for positioning and spacing purposes.

testId

string

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.

to

shape|string

Location object or url string to link to.

shape

pathname

REQUIRED
string

search

string

hash

string

type

enum

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,

    >

value

string|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.