Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rb-table

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rb-table

High performance table with fixed columns and header support

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rb-table

Declarative React table component with highly customizable scroll and layout feature

Festures

  • Declarative react table component.
  • Advanced table layout with width / minWidth / maxWidth support.
  • Fixed header and columns support.
  • Seamingless scroll behaviour on fixed header/columns mode.
  • Customized scrollbar style.
  • Less and Sass with variables defined.

Getting started

For npm:

npm install --save rb-table

Add the default stylesheet, you can choose css/sass/less version by just change the suffix.

import 'rb-table/dist/rb-table.css';

For cdn version

<script src="https://unpkg.com/rb-table@1/dist/rb-table.bundle.min.js" crossorigin></script>

Put <RBTable/> in your page with props and you are good to go.

<RBTable 
	columns={[
		{ header: () => 'header 1', cell: i => i },
		{ header: 'header 2', cell: i => i },
		{ header: <span>header 3</span>, cell: i => i }
	]}
    data={[1,2,3]}
/>

Api

RBTable Props

PropertyDescriptionTypeDefault
columnsColumns of tableArray<ColumnProps>-
dataData to be displayedArray <any>-
onRowClickEvent callback on row click, if provided an extra class 'rb-table-row--clickable' will append to each body rowfunction-
prefixClsClassname prefix, if specified must use with less/sass style and override variable @prefix-rb-table with the same valuestring'rb-table'

ColumnProps

PropertyDescriptionType
headerRender column headerstring | number | element | function(data, column)
cellRender column cellstring | number | element | function(rowData, data, column)
widthSpecify column width in px, if not specify the width will be auto calculate to fit content in one row, when the total width of table is exceed a horizontal scrollbar will be shownumber
minWidthSpecify column minimum width in px only when width is not setnumber
maxWidthSpecify column maximum width in px only when width is not setnumber
fixedSpecify column to be fixed on left or right, if not specified will scroll when it is neccessary'left' | 'right'
cellClassNameAdditional cell classstring
cellStyleAdditional cell styleobject
headerClassNameAdditional header classstring
headerStyleAdditional header styleobject

Customize Theme

rb-table provide the less/scss style file with predefined theme variables, so you can easily customize the look by modifying these variable as well as override the default style. if you are useing wepack, bellow is an example as well as a complete list of variables:

// my-rb-table.less
@import "~rb-table"
@prefix-rb-table: rb-table;
@rb-table-cell-border-color: #e8e8e8;
@rb-table-scroll-bar-color: #bfbfbf;
@rb-table-scroll-bar-color-hover: darken(@rb-table-scroll-bar-color, 25%);
@rb-table-scroll-bar-background: #f9f9f9;
@rb-table-scroll-bar-width: 12px;
@rb-table-scroll-bar-padding: 2px;
@prefix-rb-table-padding: (@rb-table-scroll-bar-width + 5px);
@rb-table-background: #FFF;
@rb-table-color: #333;
@rb-table-row-hover-background: lighten(@rb-table-scroll-bar-color, 55%);

Browser Support

ChromeFirefoxIESafari
LatestLatest11+Latest

Contributions

Use GitHub issues for requests.

Pull requests are most welcome;

Changelog

Changes are tracked as GitHub releases.

License

rb-table is MIT-licensed.

Keywords

FAQs

Package last updated on 25 Oct 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc