npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-bootstrap-native-table

v0.0.11

Published

It's a react table for bootstrap

Downloads

59

Readme

react-bootstrap-native-table

It is a fork of react-bootstrap-native-table Author AllenFang

That 'native' version is using reac-bootstrap.

https://docs.npmjs.com/getting-started/publishing-npm-packages

git pull upstream --rebase master

Usage

a.Install

npm install react-bootstrap-native-table --save

b.Import Module

To use react-bootstrap-native-table in your react app, you should import it first. You can do this in two ways:

With a module bundler

With a module bundler like webpack that supports either CommonJS or ES2015 modules, use as you would anything else.
You can include source maps on your build system to debug on development. Don't forget to Uglify on production.

// in ECMAScript 6
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-native-table';
// or in ECMAScript 5
var ReactBSTable = require('react-bootstrap-native-table');  
var BootstrapTable = ReactBSTable.BootstrapTable;
var TableHeaderColumn = ReactBSTable.TableHeaderColumn;
Browser global(window object)

In the dist folder you have a UMD bundle with source maps (react-bootstrap-native-table.js) as well as a minified version (react-bootstrap-native-table.min.js).

<script src="path/to/react-bootstrap-native-table/dist/react-bootstrap-native-table.min.js" />
<script>
  var ReactBsTable = window.BootstrapTable;
  //...
<script/>

The UMD build is also available on npmcdn:

// source maps: https://npmcdn.com/react-bootstrap-native-table/dist/react-bootstrap-native-table.js.map
<script src="https://npmcdn.com/react-bootstrap-native-table/dist/react-bootstrap-native-table.js"></script>
// or use the min version
<script src="https://npmcdn.com/react-bootstrap-native-table/dist/react-bootstrap-native-table.min.js"></script>

c.Import CSS

Finally, you need to import the css file to your app, there are two css file you can choose. react-bootstrap-native-table-all.min.css include toastr.react-bootstrap-native-table.min.css doesn't include toastr. Notes: react-bootstrap-native-table use toastr to alarm some message to user.

<link rel="stylesheet" href="./css/react-bootstrap-native-table-all.min.css">

The CSS files you can find in the css folder.

Quick Demo

// products will be presented by react-bootstrap-native-table
var products = [{
      id: 1,
      name: "Item name 1",
      price: 100
  },{
      id: 2,
      name: "Item name 2",
      price: 100
  },........];
// It's a data format example.
function priceFormatter(cell, row){
  return '<i class="glyphicon glyphicon-usd"></i> ' + cell;
}

React.render(
  <BootstrapTable data={products} striped={true} hover={true}>
      <TableHeaderColumn dataField="id" isKey={true} dataAlign="center" dataSort={true}>Product ID</TableHeaderColumn>
      <TableHeaderColumn dataField="name" dataSort={true}>Product Name</TableHeaderColumn>
      <TableHeaderColumn dataField="price" dataFormat={priceFormatter}>Product Price</TableHeaderColumn>
  </BootstrapTable>,
	document.getElementById("app")
);

More react-bootstrap-native-table examples

The example source codes is in the examples folder. Run the following commands for a live demo.

$ git clone https://github.com/AllenFang/react-bootstrap-native-table.git
$ cd react-bootstrap-native-table
$ npm install
$ gulp example-server #after start, open browser and go to http://localhost:3004