A table component for Ink.
npm install ink-table
import Table from 'ink-table'
const data = [
{
name: "Sosa Saunders",
gender: "male",
age: 17,
email: "[email protected]",
phone: "+1 (809) 435-2786"
},
{
name: "Angelina Kirk",
gender: "female",
age: 3,
email: "[email protected]",
phone: "+1 (870) 567-3516"
},
{
name: "Bradford Rosales",
gender: "male",
age: 20,
email: "[email protected]",
phone: "+1 (918) 573-3240"
},
{
name: "Gwen Schroeder",
gender: "female",
age: 17,
email: "[email protected]",
phone: "+1 (987) 417-2062"
},
{
name: "Ellison Mann",
gender: "male",
age: 5,
email: "[email protected]",
phone: "+1 (889) 411-2186"
}
];
const Basic = () => (
<Table data={data} />
);
render(<Basic />);
List of all the values (rows).
Offset inside each cell. This is considered one side value (set to 2 will have 2 spaces on the left and on the right - 4 combined).
A component used as header cell. Value is passed as
children
prop. (Recommend using<Color/>
withchalk
props.)
A component used as regular cell. Value is passed as
children
prop. (Recommend using<Color/>
withchalk
props.)
A component used as skeleton (lines and crosses ...). Value is passed as
children
prop. (Recommend using<Color/>
withchalk
props.)
MIT ยฉ Matic Zavadlal