1.0.2 • Published 8 months ago

@midas-ds/table v1.0.2

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

table

npm i @midas-ds/table
import { Table, TableHeader, Column, TableBody, Row, Cell } from '@midas-ds/table';

const columns = [
    { name: 'Name', id: 'name', isRowHeader: true },
    { name: 'Type', id: 'type' },
    { name: 'Date Modified', id: 'date' },
] satisfies Column[]

const rows = [
    { id: 1, name: 'Games', date: '6/7/2020', type: 'File folder' },
    { id: 2, name: 'Program Files', date: '4/7/2021', type: 'File folder' },
    { id: 3, name: 'bootmgr', date: '11/20/2010', type: 'System file' },
    { id: 4, name: 'log.txt', date: '1/18/2016', type: 'Text Document' },
] satisfies Row[]

<Table
    aria-label="Files"
    selectionMode="multiple"
>
    <TableHeader columns={columns}>
        {(column) => (
        <Column isRowHeader={column.isRowHeader}>{column.name}</Column>
        )}
    </TableHeader>
    <TableBody items={rows}>
        {(item) => (
        <Row columns={columns}>
            {(column) => <Cell>{item[column.id]}</Cell>}
        </Row>
        )}
    </TableBody>
</Table>
1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

0.1.1

9 months ago

0.0.1

9 months ago

0.1.0

9 months ago