• Log inStart now

TableRow

Usage

import { TableRow } from 'nr1'

Props

actionsshape[]
DEFAULT
[]

Defines a set of actions that will appear when the user hovers the row. Actions have a mandatory text and onClick callbacks (that will be called with the item and index of the row they belong to), and they also accept a disabled property.

shape

disabledboolean
labelrequiredstring

Use it to describe the row's action.

onClickrequiredfunction

Callback fired any time the user clicks on the action.

function (
event: React.MouseEvent
)
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.

typeenum

Type of action for each of the items in the actions dropdown.

It's not mandatory, its default is TableRow.ACTION_TYPE.NORMAL.

  • Normal — generic non-critical action.

  • Destructive — use when you have a destructive action like delete or remove, which you would like the user to pause and consider before completing.

<One of
TableRow.ACTION_TYPE.DESTRUCTIVE,
TableRow.ACTION_TYPE.NORMAL,
>
childrenrequirednode

List of row cells, in the shape of <TableRowCell>s. Cells need to be direct children of the row, i.e. there must not be any node between <TableRow> and <TableRowCell>s.

onClickfunction

Callback fired any time the user clicks on the table row.

function (
event: React.MouseEvent
)
Copyright © 2024 New Relic Inc.

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