• Stars
    star
    180
  • Rank 213,097 (Top 5 %)
  • Language
    TypeScript
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“A table component for Ink.

ink-table

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

Documentation

type ScalarDict = {
  [key: string]: string | number | boolean | null | undefined
}

export type TableProps<T extends ScalarDict> = {
  /**
   * List of values (rows).
   */
  data: T[]
  /**
   * Columns that we should display in the table.
   */
  columns: (keyof T)[]
  /**
   * Cell padding.
   */
  padding: number
  /**
   * Header component.
   */
  header: (props: React.PropsWithChildren<{}>) => JSX.Element
  /**
   * Component used to render a cell in the table.
   */
  cell: (props: React.PropsWithChildren<{}>) => JSX.Element
  /**
   * Component used to render the skeleton of the table.
   */
  skeleton: (props: React.PropsWithChildren<{}>) => JSX.Element
}

License

MIT Β© Matic Zavadlal

More Repositories

1

graphql-shield

πŸ›‘ A GraphQL tool to ease the creation of permission layer.
TypeScript
3,555
star
2

nookies

πŸͺ A set of cookie helpers for Next.js
TypeScript
2,269
star
3

emma-cli

πŸ“¦ Terminal assistant to find and install node packages.
TypeScript
1,228
star
4

graphql-middleware

Split up your GraphQL resolvers in middleware functions
TypeScript
1,134
star
5

swift-graphql

A GraphQL client that lets you forget about GraphQL.
Swift
598
star
6

graphql-middleware-apollo-upload-server

Upload is hard, that's why we do it for you. πŸŽ‰
TypeScript
130
star
7

ink-autocomplete

🧠 An autocomplete component for Ink.
JavaScript
80
star
8

label-sync

🏷 A delightful companion to manage Github Labels across multiple repositories.
TypeScript
60
star
9

creato

πŸ‘¨πŸ»β€πŸ­ create-app for any occasion
TypeScript
24
star
10

graphql-middleware-forward-binding

GraphQL Binding forwardTo plugin for GraphQL Middleware
TypeScript
23
star
11

graphql-server-file-upload-example

πŸ’Ύ GraphQL Server examples: File API
TypeScript
21
star
12

graphql-server-github-auth-example

GraphQL Server examples: Authentication
TypeScript
20
star
13

kayu

TypeScript GraphQL client that lets you forget about GraphQL
TypeScript
15
star
14

sponsorsme

A lightweight utility to check whether a user sponsors you.
TypeScript
14
star
15

prisma-converter

Convert your Prisma 1.0 datamodel to Prisma 2.0
TypeScript
13
star
16

resk

βœ‚οΈ Automatically create gists from your code.
JavaScript
9
star
17

multilinestring

The missing template literal for NodeJS.
TypeScript
7
star
18

gimb-events

🎟A ticketing system for all Gimnazija Bežigrad events
TypeScript
4
star
19

sessions

Manage NodeJS server sessions easily in-memory or in Redis.
TypeScript
4
star
20

reserve-npm

πŸ“¦ A CLI tool which helps you reserve a NPM package name
TypeScript
3
star
21

github-tree

πŸ™ Github API commits made easy peasy
TypeScript
3
star
22

semantha

πŸ’β€β™€οΈ A delightful mono-repository assistant.
TypeScript
2
star
23

multiwatch

A web application for better multiple stopwatch-times handling.
JavaScript
1
star
24

graphql-vs-rest

Elm
1
star
25

resizable-dots

Simple Elm app.
HTML
1
star
26

nepremicnine

Repozitorij s projektno nalogo pri Programiranju 1
HTML
1
star
27

stars

Draw.
Elm
1
star