Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-tablize

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tablize

Virtual table and grid components for React

  • 0.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

react-tablize

Virtual table and grid components for React.

npm version npm license dependencies dependencies

TableView

Terse syntax


const people: Person[];

<TableView rowCount={people.length}>
    <TableHead>
        {['Name', 'Age']}
    </TableHead>
    <TableBody>
        {index => ([
            people[index].name,
            people[index].age
        ])}
    </TableBody>
</TableView>

Rows and cells syntax


const people: Person[];

<TableView rowCount={people.length}>
    <TableHead>
        <TableCell>
            Name
        </TableCell>
        <TableCell>
            Age
        </TableCell>
    </TableHead>
    <TableBody>
        {index => (
            <TableRow>
                <TableCell>
                    {people[index].name}
                </TableCell>
                <TableCell>
                    {people[index].age}
                </TableCell>
            </TableRow>
        )}
    </TableBody>
</TableView>

Mixed syntax


const people: Person[];

<TableView rowCount={people.length}>
    <TableHead>
        {[
            <TableCell key="name">
                Name
            </TableCell>,
            'Age'
        ]}
    </TableHead>
    <TableBody>
        {index => (
            <TableRow>
                {[
                    <TableCell key="name">
                        {people[index].name}
                    </TableCell>,
                    people[index].age
                ]}
            </TableRow>
        )}
    </TableBody>
</TableView>

Columns syntax


const people: Person[];

<TableView rowCount={people.length}>

    <TableColumn>
        <ColumnHead>Name</ColumnHead>
        <ColumnBody>
            {({ rowIndex }) => people[rowIndex].name}
        </ColumnBody>
    </TableColumn>

    <TableColumn>
        <ColumnHead>Age</ColumnHead>
        <ColumnBody>
            {({ rowIndex }) => people[rowIndex].age}
        </ColumnBody>
    </TableColumn>

</TableView>

GridView

Simple Grid

<GridView
    columnCount={1000}
    columnWidth={100}
>
    <GridView.Body
        rowCount={10}
        rowHeight={40}
    >
        {({ rowIndex, columnIndex }) => (
            <GridView.Cell>
                {rowIndex}, {columnIndex}
            </GridView.Cell>
        )}
    </GridView.Body>
</GridView>

Frozen Head and Columns

<GridView
    columnCount={1000}
    columnWidth={100}
    freezeColumns={1}
>

    <GridView.Head>
        {({ columnIndex }) => (
            <GridView.Cell>
                {columnIndex}
            </GridView.Cell>
        )}
    </GridView.Head>

    <GridView.Body
        rowCount={10}
        rowHeight={40}
    >
        {({ rowIndex, columnIndex }) => (
            <GridView.Cell>
                {rowIndex}, {columnIndex}
            </GridView.Cell>
        )}
    </GridView.Body>
</GridView>

Variable Width and Height

<GridView
    columnCount={1000}
    columnWidth={columnIndex => columnIndex === 0 ? 50 : 100}
>

    <GridView.Head>
        {({ columnIndex }) => (
            <GridView.Cell>
                {columnIndex}
            </GridView.Cell>
        )}
    </GridView.Head>

    <GridView.Body
        rowCount={10}
        rowHeight={rowIndex => rowIndex === 0 ? 80 : 40}
    >
        {({ rowIndex, columnIndex }) => (
            <GridView.Cell>
                {rowIndex}, {columnIndex}
            </GridView.Cell>
        )}
    </GridView.Body>
</GridView>

FAQs

Package last updated on 06 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc