GithubHelp home page GithubHelp logo

delaguardo / react-bootstrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from react-bootstrap/react-bootstrap

0.0 2.0 0.0 600 KB

Bootstrap 3 components built with React

License: MIT License

react-bootstrap's Introduction

react-bootstrap

Bootstrap 3 components built with React

Build Status NPM version Bower version

Under active development - APIs will change.

Contributors

Contributions

Yes please!

  • Run npm install, npm run test-watch to run tests while you develop (however this hides any build errors, you can see these with grunt build)
  • Add tests for any new or changed functionality
  • See issues for some ideas
  • Follow exisitng style

Getting started

NOTE: Requires the latest React: 0.9.0-rc1.

You can import the lib with as AMD modules, CommonJS modules as a global JS script.

First add the bootstrap CSS to your project then:

AMD

bower install react#v0.9.0-rc1
bower install react-bootstrap

var Alert = require('react-bootstrap/amd/Alert');
// or
var Alert = require('react-bootstrap/amd').Alert;

CommonJS

npm install [email protected]
npm install react-bootstrap

var Alert = require('react-bootstrap/cjs/Alert');
// or
var Alert = require('react-bootstrap').Alert;

Browser globals

<script src="http://fb.me/react-0.9.0-rc1.js"></script>
<script src="react-bootstrap/dist/react-bootstrap.min.js"></script>
<script>
    var Alert = ReactBootstrap.Alert;
</script>

Currently implemented (but under active development)

Nav

var Nav     = require('react-bootstrap/cjs/Nav');
var NavItem = require('react-bootstrap/cjs/NavItem');

var key = 1;

function handleSelect (selectedKey) {
  key = selectedKey;
}

<Nav bsStyle="[tabs|pills]" bsVariation="[stacked|justified]" activeKey={key} onSelect={handleSelect}>
  <NavItem key={1} href="/home">NavItem 1 content</NavItem>
  <NavItem key={2} title="Item">NavItem 2 content</NavItem>
  <NavItem key={3} disabled={true}>NavItem 3 content</NavItem>
</Nav>

Button

var Button = require('react-bootstrap/cjs/Button');

<Button onClick={handleClick}>Title</Button>

DropdownButton

var DropdownButton = require('react-bootstrap/cjs/DropdownButton');
var MenuItem       = require('react-bootstrap/cjs/MenuItem');

function handleSelect (selectedKey) {
}

<DropdownButton title="Title" onSelect={handleSelect}>
  <MenuItem key="1">MenuItem 1 content</MenuItem>
  <MenuItem key="2">MenuItem 2 content</MenuItem>
</DropdownButton>

Tabs

Controlled

var TabbedArea = require('react-bootstrap/cjs/TabbedArea');
var TabPane    = require('react-bootstrap/cjs/TabPane');

var key = 1;

function handleSelect (selectedKey) {
  key = selectedKey;
}

<TabbedArea title="Title" activeKey={key} onSelect={handleSelect}>
  <TabPane tab="Tab 1" key={1}>TabPane 1 content</TabPane>
  <TabPane tab={<strong>Tab 2</strong>} key={2}>TabPane 2 content</TabPane>
</TabbedArea>

Uncontrolled

var TabbedArea = require('react-bootstrap/cjs/TabbedArea');
var TabPane    = require('react-bootstrap/cjs/TabPane');

<TabbedArea title="Title" initialActiveKey={1}>
  <TabPane tab="Tab 1" key={1}>TabPane 1 content</TabPane>
  <TabPane tab={<strong>Tab 2</strong>} key={2}>TabPane 2 content</TabPane>
</TabbedArea>

Alert

var Alert = require('react-bootstrap/cjs/Alert');

function handleDismiss () {
}

<Alert bsStyle="danger" onDismiss={handleDismiss} dismissAfter={5000}>
  <strong>Oh snap!</strong> Change a few things up and try submitting again.
</Alert>

MenuItem

var MenuItem = require('react-bootstrap/cjs/MenuItem');

function handleSelect (key) {
}

<MenuItem key={1} bsVariation="[divider|header]" onSelect={handleSelect}>Content</MenuItem>

Up next

  • Panel, PanelGroup
  • Input
  • Label
  • Accordion
  • Pagination, Pager
  • Modal

react-bootstrap's People

Contributors

pieterv avatar stevoland avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.