Wraps the content of a table cell located in the body of the table. This component is only expected to be used as a children of <TableRow>
. Cells take care automatically of ellipsifying the content that does not fit and vertically centering it.
This component is the base cell. For common cases, the SDK also provides a set of additional cells so that they always painted consistently across the UI (e.g. entity name with a status, or a user).
Usage
import { TableRowCell } from 'nr1'
Examples
Row cell with external links and additional info
function render() { const items = [ { dashboardName: 'Staging service - Errors', createdBy: 'john@doe.com', url: '//fake-url.com/dashboard1', }, { dashboardName: 'Package Registry - Performance', createdBy: 'jane@doe.com', url: '//fake-url.com/dashboard2', }, ]; return ( <Table items={items} multivalue> <TableHeader> <TableHeaderCell>Name</TableHeaderCell> <TableHeaderCell>Url</TableHeaderCell> </TableHeader> {({ item }) => ( <TableRow> <TableRowCell additionalValue={`Created by ${item.createdBy}`}> {item.dashboardName} </TableRowCell> <TableRowCell> <Link to={item.url}>Go to the dashboard</Link> </TableRowCell> </TableRow> )} </Table> );}
Props
string | Additional information along the main data in the cell. Note: At the moment this content becomes visible only when the |
enum | Defines the text alignment inside the cell. <One of |
string | Use it to describe better the context of the cell's action for users on screen readers.
|
node | Contents of the table cell. |
string | Appends class names to the component.Should be used only for positioning and spacing purposes. |
enum | Defines how values are ellipsified within the cells; i.e. where the ellipsis is placed:
|
function | Callback fired any time the user clicks on the table cell. function ( |
object | Inline style for custom styling.Should be used only for positioning and spacing purposes. |
string | Adds a Note: You might not see |
shape|string | Location object or url string to link to.Linked shape
REQUIREDstring
string
string |