import * as React from 'react'import { Table } from '@welcome-ui/table'import { Button } from '@welcome-ui/button'import { SettingsIcon } from '@welcome-ui/icons'const Example = () => {return (<Table><Table.Thead><Table.Tr><Table.Th>Name</Table.Th><Table.Th>Description</Table.Th><Table.Th>Number</Table.Th><Table.Th textAlign="center" w={80}>Actions</Table.Th></Table.Tr></Table.Thead><Table.Tbody><Table.Tr><Table.Td>Consectetur</Table.Td><Table.Td>Lorem ipsum dolor sit amet</Table.Td><Table.Td>23</Table.Td><Table.Td textAlign="center"><Button shape="circle" size="sm" variant="secondary"><SettingsIcon size="sm" /></Button></Table.Td></Table.Tr><Table.Tr><Table.Td>Suspendisse</Table.Td><Table.Td>Pellentesque a maximus magna</Table.Td><Table.Td>41</Table.Td><Table.Td textAlign="center"><Button shape="circle" size="sm" variant="secondary"><SettingsIcon size="sm" /></Button></Table.Td></Table.Tr><Table.Tr><Table.Td>Ullamcorper</Table.Td><Table.Td>Cras viverra ac erat ullamcorper maximus</Table.Td><Table.Td>8</Table.Td><Table.Td textAlign="center"><Button shape="circle" size="sm" variant="secondary"><SettingsIcon size="sm" /></Button></Table.Td></Table.Tr></Table.Tbody></Table>)}export default Example
Installation
1
Run the following command:
yarn add @welcome-ui/table
2
Import component:
import { Table } from '@welcome-ui/table'
Use Table
, Table.Thead
, Table.Th
, Table.Tbody
, Table.Td
, Table.Tr
.
With state
You can use one of success
, error
, warning
or info
and add indent
on Table for more spacing.