Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Bootstrap table built with React.js

License

NotificationsYou must be signed in to change notification settings

AllenFang/react-bootstrap-table

Repository files navigation

react-bootstrap-table2 already released, this project will stop development after 2018Q2

Join the chat at https://gitter.im/AllenFang/react-bootstrap-table

NPM versionBuild Status

Dependency StatusdevDependency StatuspeerDependency Status
It's areact.js table for bootstrap, named react-bootstrap-table. It's a configurable, functional table component and make you build a Bootstrap Table more efficiency and easy in your React application, Howeverreact-bootstrap-table support these features:

  • Striped, borderless, condensed table
  • Column align, hidden, width, sort, title, styling, customization
  • Table scrolling
  • Cell format
  • Pagination
  • Row selection
  • Table Search, Column filter
  • Cell editor
  • Insert & delete Row
  • Export to CSV
  • Rich function hooks
  • Header column span
  • Remote mode
  • Row expand
  • Key board navigation

ExampleSee more aboutreact-bootstrap-table and explore more examples onexamples folder
Check theCHANGELOG for more detail release notes.

Notes

v4.0.0 released, this release mainly replacereact-toastr withreact-s-alert

  1. Replacereact-toastr byreact-s-alert
  2. Useprop-types
  3. Supportbootstrap@4 andbootstrap@3 both. If you use 4, please addversion='4' on<BootstrapTable>
  4. No important features were implemented, most of bug fixes and improvement

Afterv2.4.4, we move the css files todist folder for allowing this repo can be hosted oncdnjs

Development

react-bootstrap-table dependencies on react.js and Bootstrap 3, also written by ES6 and use gulp and browserify for building and bundling.

You can use the following commands to prepare development

$ git clone https://github.com/AllenFang/react-bootstrap-table.git$cd react-bootstrap-table$ npm install

See the examples forreact-bootstrap-table

$ npm start# see all examples, go to localhost:3004

Usage

a.Install

npm install react-bootstrap-table --save

b.Import Module

To use react-bootstrap-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 likewebpack 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 6import{BootstrapTable,TableHeaderColumn}from'react-bootstrap-table';// or in ECMAScript 5varReactBSTable=require('react-bootstrap-table');varBootstrapTable=ReactBSTable.BootstrapTable;varTableHeaderColumn=ReactBSTable.TableHeaderColumn;
Browser global(window object)

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

<scriptsrc="path/to/react-bootstrap-table/dist/react-bootstrap-table.min.js"/><script>varReactBsTable=window.BootstrapTable;//...</script>

The UMD build is also available onnpmcdn:

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

c.Import CSS

Finally, you need to import the css file to your app:

<!-- we still need bootstrap css --><linkrel="stylesheet"href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"><linkrel="stylesheet"href="./dist/react-bootstrap-table.min.css">

The CSS files you can find in the css folder.

Quick Demo

// products will be presented by react-bootstrap-tablevarproducts=[{id:1,name:"Item name 1",price:100},{id:2,name:"Item name 2",price:100},........];// It's a data format example.functionpriceFormatter(cell,row){return'<i></i> '+cell;}React.render(<BootstrapTabledata={products}striped={true}hover={true}><TableHeaderColumndataField="id"isKey={true}dataAlign="center"dataSort={true}>Product ID</TableHeaderColumn><TableHeaderColumndataField="name"dataSort={true}>Product Name</TableHeaderColumn><TableHeaderColumndataField="price"dataFormat={priceFormatter}>Product Price</TableHeaderColumn></BootstrapTable>,document.getElementById("app"));

More react-bootstrap-table examples

The example source codes are in theexamples folder folder. Run the following commands for a live demo.

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

Thanks

luqin
Help this project to integrate a better examples demo, add travis & badge, code formatting, give a lot of suggestions and bugs report.
Whien
Implement a lots of awesome new feature and also fix some bugs and enhancements.
Parth Prajapati
Help to check issues and give great and useful instructions.
khinlatt
Contribute export csv, multi-search and bug fixing.
dana
Contribute a new colum-filter design and great feedback given.
tbaeg
Bugs report and give some bootstrap and css suggestions actively.
bluedarker
Contribute the edit format & validation on cell editing and row insertion. Improve the custom styling.
Sofia Silva
Bug reports and fixing actively.
frontsideair
Fixing bugs and give improvement for functionality.
aaronhayes
Bugs report and enhance the cell formatting.
Reggino
Implement the TableDataSet component.

About

A Bootstrap table built with React.js

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors113


[8]ページ先頭

©2009-2025 Movatter.jp