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;// or in ECMAScript 5var ReactBSTable = ; var BootstrapTable = ReactBSTableBootstrapTable;var TableHeaderColumn = ReactBSTableTableHeaderColumn;
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
).
The UMD build is also available on npmcdn:
// source maps: https://npmcdn.com/react-bootstrap-native-table/dist/react-bootstrap-native-table.js.map// or use the min version
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.
The CSS files you can find in the css folder.
Quick Demo
// products will be presented by react-bootstrap-native-tablevar products = id: 1 name: "Item name 1" price: 100 id: 2 name: "Item name 2" price: 100 ......;// It's a data format example.{ return '<i class="glyphicon glyphicon-usd"></i> ' + cell;} React;
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