Code Monkey home page Code Monkey logo

ink-table's Introduction

ink-table

Build Status npm version

A table component for Ink.

Install

npm install ink-table

Usage

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 />);

Props

data array<object>

List of all the values (rows).

padding number

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).

header ({children}) => h

A component used as header cell. Value is passed as children prop. (Recommend using <Color/> with chalk props.)

cell ({children}) => h

A component used as regular cell. Value is passed as children prop. (Recommend using <Color/> with chalk props.)

skeleton ({children}) => h

A component used as skeleton (lines and crosses ...). Value is passed as children prop. (Recommend using <Color/> with chalk props.)

License

MIT ยฉ Matic Zavadlal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.