New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@zzwing/react-table

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zzwing/react-table

A react fixed table component

latest
Source
npmnpm
Version
1.5.2
Version published
Maintainers
1
Created
Source

React Fixed Table

CircleCI codecov

Edit n3ml9m0zz4

Document

Document

Install

$ npm install @zzwing/react-table

import { Table, HorizontalScrollBar } from '@zzwing/react-table'

Usage

Table

PropsTypeDefaultDesc
dataSourceArray[]dataSource
columscolumnsProps[][]columns props
rowKeystringnonerow key, unique, eg: id/a.b.c
classNamestring''table classname
styleobject{}table style
multiLinebooleanfalseif row is multiline, need to set true
offsetTopnumber0thead fixed-top offset
scrollBarOffsetnumber5scrollbar fixed-bottom offset
onRow(record: T) => TableRowProp--a function return table row props
type PlainObject = {
  [key: string]: any
}

interface TableProp<T extends PlainObject = PlainObject> {
  columns?: ColumnProps<T>[]
  dataSource?: T[]
  rowKey?: string
  className?: string
  style?: React.CSSProperties
  offsetTop?: number
  multiLine?: boolean
  scrollBarOffset?: number
  onRow?: (record: T) => TableRowProp
}

ColumnsProps

PropsTypeDefaultDesc
titleanynonecolumn title
keystringnonecolumn key, default is dataIndex
dataIndexstring''data field in each record, support chain eg: a.b.c.d
render(text, record, index) => any() => {}column render function
alignleft | right | centercentertext align
classNamestring''--
fixedleft | right | rightfalsefixed flag
interface ColumnProps<T> {
  title?: React.ReactNode
  key?: React.Key
  dataIndex?: keyof T | string
  render?: (text: any, record: T, index: number) => React.ReactNode
  align?: 'left' | 'right' | 'center'
  className?: string
  fixed?: boolean | ('left' | 'right')
}

BaseTable

like Table, but not fixed left and `right

export interface BaseTableProp<T extends PlainObject = PlainObject> {
  columns?: ColumnProps<T>[]
  dataSource?: T[]
  rowKey?: string
  maxTop?: number
  getRef?: React.RefObject<HTMLTableElement>
  className?: string
  multiLine?: boolean
  style?: React.CSSProperties
  offsetTop?: number
  onRow?: (record: T) => TableRowProp
}

ScrollBar

PropsTypeDefaultDesc
classNamestring''scrollbar className
scrollTargetstring | HTMLElementwindownative scroll container
offsetBottomnumber5scrollbar bottom offset
interface HorizontalScrollBarProp {
  className?: string
  scrollTarget?: string | HTMLElement
  offsetBottom?: number
}

Keywords

react

FAQs

Package last updated on 01 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts