1.0.0-16 • Published 6 years ago

@react-spectre/table v1.0.0-16

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

@react-spectre/table

React components for Spectre.css's table.

Installation

yarn add @react-spectre/table
npm install @react-spectre/table --save

Usage

Table

There are 6 components exported for tables: Table, Header (thead), Body (tbody), Row (tr), Heading (th) and Cell (td).

import { Table, Header, Body, Row, Heading, Cell } from '@react-spectre/table'

Note: The main component is Table, other component can be accessed through Table for example: Table.Header, Table.Body, Table.Row, etc...

Example

<Table striped hover scroll>
  <Header>
    <Row>
      <Heading>Name</Heading>
      <Heading>Age</Heading>
      <Heading>Is admin?</Heading>
    </Row>
  </Header>
  <Body>
    <Row active>
      <Cell>Rubens</Cell>
      <Cell>98</Cell>
      <Cell>Yes</Cell>
    </Row>
  </Body>
</Table>

Tables can have 2 different style decorators: striped and hover.

<Table></Table>
<Table striped></Table>
<Table hover></Table>
<Table hover striped></Table>

Rows

Table rows can be marked as active using: active prop:

<Table>
  <Body>
    <Row></Row>
    <Row active></Row>
  </Body>
<Table>

Scroll

A table can have horizontal scroll using the scroll props:

<Table scroll></Table>

Made with :heart: by Rubens Mariuzzo.

MIT License

1.0.0-16

6 years ago

1.0.0-15

6 years ago

1.0.0-14

6 years ago

1.0.0-13

6 years ago

1.0.0-12

6 years ago

1.0.0-11

6 years ago

1.0.0-10

6 years ago

1.0.0-9

6 years ago

1.0.0-8

6 years ago

1.0.0-7

6 years ago

1.0.0-6

6 years ago

1.0.0-5

6 years ago

1.0.0-4

6 years ago

1.0.0-3

6 years ago

1.0.0-2

6 years ago

1.0.0-1

6 years ago