import * as React from 'react';
import {
Alert,
UncontrolledAlert,
Badge,
Breadcrumb,
BreadcrumbItem,
Button,
ButtonDropdown,
ButtonGroup,
ButtonToolbar,
Dropdown,
DropdownItem,
DropdownMenu,
DropdownToggle,
Card,
CardBody,
CardColumns,
CardDeck,
CardFooter,
CardGroup,
CardHeader,
CardImg,
CardImgOverlay,
CardLink,
CardSubtitle,
CardText,
CardTitle,
Carousel,
CarouselCaption,
CarouselControl,
CarouselItem,
CarouselIndicators,
Row,
Col,
Container,
Collapse,
CustomInput,
Fade,
Form,
FormFeedback,
FormGroup,
FormText,
Input,
InputGroup,
InputGroupAddon,
InputGroupButtonDropdown,
InputGroupText,
Pagination,
Label,
ListGroup,
ListGroupItem,
ListGroupItemHeading,
ListGroupItemText,
ModalFooter,
Modal,
ModalBody,
ModalHeader,
Jumbotron,
Media,
Nav,
Navbar,
NavbarBrand,
NavbarToggler,
NavItem,
NavLink,
PaginationItem,
PaginationLink,
Popover,
PopoverBody,
PopoverHeader,
Progress,
TabPane,
UncontrolledButtonDropdown,
UncontrolledDropdown,
UncontrolledTooltip,
UncontrolledCollapse,
UncontrolledCarousel,
TabContent,
Table,
Tag,
Toast,
ToastBody,
ToastHeader,
Tooltip,
Spinner,
UncontrolledPopover,
} from 'reactstrap';
// --------------- Alert
const Examplea = (props: any) => {
return (
Well done! You successfully read this important alert message.
Heads up! This alert needs your attention, but it's not super important.
Warning! Better check yourself, you're not looking too good.
Oh snap! Change a few things up and try submitting again.
);
};
class AlertExample extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.state = {
visible: true
};
}
onDismiss = () => {
this.setState({ visible: false });
}
render() {
return (
I am an alert and I can be dismissed!
);
}
}
function AlertExample1() {
return (
I am an alert and I can be dismissed!
);
}
// --------------- Badge
class Example2 extends React.Component {
render() {
return (
Heading New
Heading New
Heading New
Heading New
Heading New
Heading New
);
}
}
export class Example3 extends React.Component {
render() {
return (
default
primary
success
info
warning
danger
);
}
}
class Example4 extends React.Component {
render() {
return (
default {' '}
primary {' '}
success {' '}
info {' '}
warning {' '}
danger
);
}
}
// ------------- Breadcrumbs
const Example5 = (props: any) => {
return (
);
};
const Example6 = (props: any) => {
return (
Home
Library
Data
Bootstrap
);
};
// ------------- Buttons
class Example7 extends React.Component {
render() {
return (
primary {' '}
secondary {' '}
success {' '}
info {' '}
warning {' '}
danger {' '}
link
);
}
}
class Example8 extends React.Component {
render() {
return (
primary {' '}
secondary {' '}
success {' '}
info {' '}
warning {' '}
danger
);
}
}
const Example9 = (
Large Button {' '}
Large Button
);
const Example10 = (
Small Button {' '}
Small Button
);
const Example11 = (
Block level button
Block level button
);
const Example12 = (
Primary link {' '}
Link
);
const Example13 = (
Primary button {' '}
Button
);
interface CustomButtonProps extends ButtonProps {
customProp: string;
}
// NOTE: not adding the <{}> causes the generic parameter to be a spread type of CustomButtonProps,
// for some reason this causes children to be inferred as being 'ReactNode & {}' which makes the spread
// invalid. TS3.2 bug?
const CustomButton: React.SFC = props => {...props}/>;
class Example14 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.state = { cSelected: [] };
this.onRadioBtnClick = this.onRadioBtnClick.bind(this);
this.onCheckboxBtnClick = this.onCheckboxBtnClick.bind(this);
}
onRadioBtnClick(rSelected: number) {
this.setState({ rSelected });
}
onCheckboxBtnClick(selected: number) {
const index = this.state.cSelected.indexOf(selected);
if (index < 0) {
this.state.cSelected.push(selected);
} else {
this.state.cSelected.splice(index, 1);
}
this.setState({ cSelected: [...this.state.cSelected] });
}
render() {
return (
Radio Buttons
this.onRadioBtnClick(1)} active={this.state.rSelected === 1}>One
this.onRadioBtnClick(2)} active={this.state.rSelected === 2}>Two
this.onRadioBtnClick(3)} active={this.state.rSelected === 3}>Three
Selected: {this.state.rSelected}
Checkbox Buttons
this.onCheckboxBtnClick(1)} active={this.state.cSelected.includes(1)}>One
this.onCheckboxBtnClick(2)} active={this.state.cSelected.includes(2)}>Two
this.onCheckboxBtnClick(3)} active={this.state.cSelected.includes(3)}>Three
Selected: {JSON.stringify(this.state.cSelected)}
);
}
}
// ------------- Button Dropdown
class Example15 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
dropdownOpen: false
};
}
toggle() {
this.setState({
dropdownOpen: !this.state.dropdownOpen
});
}
render() {
return (
Button Dropdown
Header
Action
Another Action
) => {
// something happens here
}}>Another Action
);
}
}
const Example16 = (
true}>
Text
Header
Action
Another Action
Another Action
);
const Example17 = (props: any) => (
true}>
{props.text}
Header
Action
Another Action
Another Action
);
const Example18 = (
true}>
Large Button
Another Action
Another Action
true}>
Small Button
Another Action
Another Action
);
const Example19 = (
true} direction="up">
Dropup
Another Action
Another Action
);
// --------------- ButtonGroup
class Example20 extends React.Component {
render() {
return (
Left {' '}
Middle {' '}
Right
);
}
}
class Example21 extends React.Component {
render() {
return (
1
2
3
4
5
6
7
8
);
}
}
const Example22 = (props: any) => (
Left
Middle
Right
Left
Middle
Right
Left
Middle
Right
);
const Example23 = (props: any) => (
1
2
true}>
Dropdown
Dropdown Link
Dropdown Link
);
const Example24 = (props: any) => (
1
2
true}>
Dropdown
Dropdown Link
Dropdown Link
);
// ------------------ Cards
const Example25 = (props: any) => {
return (
Card title
Card subtitle
Some quick example text to build on the card title and make up the bulk of the card's content.
Button
);
};
const Example26 = (props: any) => {
return (
Card title
Card subtitle
Some quick example text to build on the card title and make up the bulk of the card's content.
Card Link
Another Link
);
};
const Example27 = (props: any) => {
return (
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
);
};
const Example28 = (props: any) => {
return (
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
);
};
const Example29 = (props: any) => {
return (
Header
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
Footer
Featured
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
Footer
);
};
const Example30 = (props: any) => {
return (
Card Title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
Card Title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
);
};
const Example31 = (props: any) => {
return (
Card Title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
);
};
const Example32 = (props: any) => {
return (
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
);
};
const Example33 = (props: any) => {
return (
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
);
};
const Example34 = (props: any) => {
return (
Card title
Card subtitle
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Button
Card title
Card subtitle
This card has supporting text below as a natural lead-in to additional content.
Button
Card title
Card subtitle
This is a wider card with supporting text below as a natural lead-in to additional content. This
card has even longer content than the first to show that equal height action.
Button
);
};
const Example35 = (props: any) => {
return (
Card title
Card subtitle
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Button
Card title
Card subtitle
This card has supporting text below as a natural lead-in to additional content.
Button
Card title
Card subtitle
This is a wider card with supporting text below as a natural lead-in to additional content. This card has
even longer content than the first to show that equal height action.
Button
);
};
const Example36 = (props: any) => {
return (
Card title
Card subtitle
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Button
Card title
Card subtitle
This card has supporting text below as a natural lead-in to additional content.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
Card title
Card subtitle
This is a wider card with supporting text below as a natural lead-in to additional content. This card
has even longer content than the first to show that equal height action.
Button
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Button
);
};
// ------------------ Collapse
class Example37 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = { collapse: false };
}
toggle() {
this.setState({ collapse: !this.state.collapse });
}
render() {
return (
Toggle
Anim pariatur cliche reprehenderit,
enim eiusmod high life accusamus terry richardson ad squid. Nihil
anim keffiyeh helvetica, craft beer labore wes anderson cred
nesciunt sapiente ea proident.
);
}
}
class Example38 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.onOpened = this.onOpened.bind(this);
this.onClosed = this.onClosed.bind(this);
this.toggle = this.toggle.bind(this);
this.state = { collapse: false, status: 'Closed' };
}
onOpened() {
this.setState({ ...this.state, status: 'Opened' });
}
onClosed() {
this.setState({ ...this.state, status: 'Closed' });
}
toggle() {
const status = !this.state.collapse ? 'Opening...' : 'Closing...';
this.setState({ collapse: !this.state.collapse, status });
}
render() {
return (
Toggle
Current state: {this.state.status}
Anim pariatur cliche reprehenderit,
enim eiusmod high life accusamus terry richardson ad squid. Nihil
anim keffiyeh helvetica, craft beer labore wes anderson cred
nesciunt sapiente ea proident.
);
}
}
// ------- Dropdown
class Example39 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
dropdownOpen: false
};
}
toggle() {
this.setState({
dropdownOpen: !this.state.dropdownOpen
});
}
render() {
return (
Dropdown
Header
Action
Another Action
Another Action
);
}
}
const Example40 = (props: any) => (
false}>
Dropdown
Header
Action
Another Action
Another Action
);
const Example41 = (props: any) => (
Header
);
const Example42 = (props: any) => (
Action
Action
true}>
asdfasd
sadfas
true}>
sadfasd
sadf
true}>
asdf
sasdfsdf
);
class Example43 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
dropdownOpen: false
};
}
toggle() {
this.setState({
dropdownOpen: !this.state.dropdownOpen
});
}
render() {
return (
Custom Dropdown Content
Custom dropdown item
Custom dropdown item
Custom dropdown item
Custom dropdown item
);
}
}
function Example44() {
return (
Dropdown
Header
Action
Another Action
Another Action
);
}
// ------------------ Form
class Example45 extends React.Component {
render() {
return (
);
}
}
class Example46 extends React.Component {
render() {
return (
);
}
}
class Example47 extends React.Component {
render() {
return (
);
}
}
class Example48 extends React.Component {
render() {
return (
);
}
}
class Example49 extends React.Component {
render() {
return (
);
}
}
class Example50 extends React.Component {
render() {
return (
);
}
}
class Example51 extends React.Component {
render() {
return (
);
}
}
const Example52 = (props: any) => {
return (
@
@example.com
$
$
$
$
$
.00
);
};
const Example53 = (props: any) => {
return (
To the Left!
To the Right!
To the Left!
To the Right!
);
};
const Example54 = (props: any) => {
return (
@lg
@normal
@sm
);
};
const Example55 = (props: any) => {
return (
I'm a button
I'm a button
);
};
const Example56 = (props: any) => {
return (
@lg
@normal
@sm
);
};
const Example57 = (props: any) => {
return (
I'm a button
I'm a button
);
};
const Example58 = (props: any) => {
return (
To the Left!
To the Right!
To the Left!
To the Right!
);
};
const Example59 = (props: any) => {
return (
Hello, world!
This is a simple hero unit, a simple Jumbotron-style component for calling extra attention to featured content or information.
It uses utility classes for typgraphy and spacing to space content out within the larger container.
Learn More
);
};
const Example60 = (props: any) => {
return (
Fluid jumbotron
This is a modified jumbotron that occupies the entire horizontal space of its parent.
);
};
class Example61 extends React.Component {
render() {
return (
.col
.col
.col
.col
.col
.col-3
.col-auto - variable width content
.col-3
.col-6
.col-6
.col-6 .col-sm-4
.col-6 .col-sm-4
.col .col-sm-4
.col .col-sm-6 .col-sm-push-2 .col-sm-pull-2 .col-sm-offset-2
.col .col-sm-12 .col-md-6 .col-md-offset-3
.col .col-sm .col-sm-offset-1
.col .col-sm .col-sm-offset-1
);
}
}
class Example62 extends React.Component {
render() {
return (
Cras justo odio
Dapibus ac facilisis in
Morbi leo risus
Porta ac consectetur ac
Vestibulum at eros
);
}
}
class Example63 extends React.Component {
render() {
return (
Cras justo odio 14
Dapibus ac facilisis in 2
Morbi leo risus 1
);
}
}
class Example64 extends React.Component {
render() {
return (
Cras justo odio
Dapibus ac facilisis in
Morbi leo risus
Porta ac consectetur ac
Vestibulum at eros
);
}
}
class Example65 extends React.Component {
render() {
return (
Anchors
Be sure to not use the standard .btn classes here .
Cras justo odio
Dapibus ac facilisis in
Morbi leo risus
Porta ac consectetur ac
Vestibulum at eros
Buttons
Cras justo odio
Dapibus ac facilisis in
Morbi leo risus
Porta ac consectetur ac
Vestibulum at eros
);
}
}
class Example66 extends React.Component {
render() {
return (
Cras justo odio
Dapibus ac facilisis in
Morbi leo risus
Porta ac consectetur ac
);
}
}
class Example67 extends React.Component {
render() {
return (
List group item heading
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
List group item heading
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
List group item heading
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
);
}
}
// ------------- Media
const Example68 = () => {
return (
Media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus
odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.
Donec lacinia congue felis in faucibus.
);
};
const Example69 = () => {
return (
Media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus
odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.
Donec lacinia congue felis in faucibus.
Nested media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate
fringilla. Donec lacinia congue felis in faucibus.
);
};
const Example70 = () => {
return (
Top aligned media
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate
fringilla. Donec lacinia congue felis in faucibus.
Middle aligned media
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate
fringilla. Donec lacinia congue felis in faucibus.
Bottom aligned media
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate
fringilla. Donec lacinia congue felis in faucibus.
);
};
const Example71 = () => {
return (
Media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate
fringilla. Donec lacinia congue felis in faucibus.
Nested media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo.
Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi
vulputate fringilla. Donec lacinia congue felis in faucibus.
Nested media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo.
Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi
vulputate fringilla. Donec lacinia congue felis in faucibus.
Nested media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate
fringilla. Donec lacinia congue felis in faucibus.
Media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate
fringilla. Donec lacinia congue felis in faucibus.
);
};
// --------------- Modal
class ModalExample72 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.state = {
modal: false
};
this.toggle = this.toggle.bind(this);
}
toggle() {
this.setState({
modal: !this.state.modal
});
}
render() {
return (
{this.props.buttonLabel}
Modal title
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
Do Something {' '}
Cancel
);
}
}
class ModalExample73 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.state = {
modal: false,
backdrop: true
};
this.toggle = this.toggle.bind(this);
this.changeBackdrop = this.changeBackdrop.bind(this);
}
toggle() {
this.setState({
modal: !this.state.modal
});
}
changeBackdrop(e: React.ChangeEvent) {
let value = e.target.value;
if (value !== 'static') {
value = JSON.parse(value);
}
this.setState({ backdrop: value });
}
render() {
return (
Modal title
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
Do Something {' '}
Cancel
);
}
}
class ModalExample74 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.state = {
modal: false,
nestedModal: false,
};
this.toggle = this.toggle.bind(this);
this.toggleNested = this.toggleNested.bind(this);
}
toggle() {
this.setState({
modal: !this.state.modal
});
}
toggleNested() {
this.setState({
nestedModal: !this.state.nestedModal
});
}
render() {
return (
{this.props.buttonLabel}
Modal title
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
Show Nested Model
Nested Modal title
Stuff and things
Done {' '}
All Done
Do Something {' '}
Cancel
);
}
}
class ModalExampleDestructuring extends React.Component {
constructor(props: any) {
super(props);
this.state = {
modal: false,
unmountOnClose: true
};
this.toggle = this.toggle.bind(this);
this.changeUnmountOnClose = this.changeUnmountOnClose.bind(this);
}
toggle() {
this.setState((prevState: any) => ({
modal: !prevState.modal
}));
}
changeUnmountOnClose(e: React.ChangeEvent) {
const value = e.target.value;
this.setState({ unmountOnClose: JSON.parse(value) });
}
render() {
return (
Modal title
Do Something {' '}
Cancel
);
}
}
class ModalExampleFocusAfterClose extends React.Component {
constructor(props: any) {
super(props);
this.state = {
open: false,
focusAfterClose: true
};
this.toggle = this.toggle.bind(this);
this.handleSelectChange = this.handleSelectChange.bind(this);
}
toggle() {
this.setState({ open: !this.state.open });
}
handleSelectChange(e: React.ChangeEvent) {
const value = e.target.value;
this.setState({ focusAfterClose: JSON.parse(value) });
}
render() {
return (
Observe the "Open" button. It will be focused after close when "returnFocusAfterClose" is true and will not be focused if "returnFocusAfterClose" is false.
Close
);
}
}
class Example75 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
isOpen: false
};
}
toggle() {
this.setState({
isOpen: !this.state.isOpen
});
}
render() {
return (
reactstrap
Components
Github
Options
Option 1
Option 2
Reset
);
}
}
class Example76 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggleNavbar = this.toggleNavbar.bind(this);
this.state = {
collapsed: true
};
}
toggleNavbar() {
this.setState({
collapsed: !this.state.collapsed
});
}
render() {
return (
reactstrap
Components
Github
);
}
}
class Example77 extends React.Component {
render() {
return (
List Based
Link
Link
Another Link
Disabled Link
Link Based
Link Link Another Link Disabled Link
);
}
}
class Example78 extends React.Component {
render() {
return (
List Based
Link
Link
Another Link
Disabled Link
Link based
Link Link Another Link Disabled Link
);
}
}
class Example79 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
dropdownOpen: false
};
}
toggle() {
this.setState({
dropdownOpen: !this.state.dropdownOpen
});
}
render() {
return (
Link
Dropdown
Header
Action
Another Action
Another Action
Link
Another Link
Disabled Link
);
}
}
class Example80 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
dropdownOpen: false
};
}
toggle() {
this.setState({
dropdownOpen: !this.state.dropdownOpen
});
}
render() {
return (
Link
Dropdown
Header
Action
Another Action
Another Action
Link
Another Link
Disabled Link
);
}
}
// ----------- Pagination
class Example81 extends React.Component {
render() {
return (
1
2
3
4
5
);
}
}
class Example82 extends React.Component {
render() {
return (
1
2
3
4
5
);
}
}
class Example83 extends React.Component {
render() {
return (
1
2
3
);
}
}
class Example84 extends React.Component {
render() {
return (
1
2
3
);
}
}
// ------------------------- Popover
class Example85 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
popoverOpen: false
};
}
toggle() {
this.setState({
popoverOpen: !this.state.popoverOpen
});
}
render() {
return (
Launch Popover
{}}>
Popover Title
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
);
}
}
class PopoverItem extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
popoverOpen: false
};
}
toggle() {
this.setState({
popoverOpen: !this.state.popoverOpen
});
}
render() {
return (
{this.props.item.text}
Popover Title
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
);
}
}
class PopoverExampleMulti extends React.Component}> {
state: {popovers: Array<{placement: string; text: string; }>};
constructor(props: any) {
super(props);
this.state = {
popovers: [
{
placement: 'top',
text: 'Top'
},
{
placement: 'bottom',
text: 'Bottom'
},
{
placement: 'left',
text: 'Left'
},
{
placement: 'right',
text: 'Right'
}
]
};
}
render() {
return (
{this.state.popovers.map((popover, i) => {
return
;
})}
);
}
}
class PopoverExampleFlipFade extends React.Component {
render() {
return (
Popover Title
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
);
}
}
// ------------------------- Progress
const Example86 = (props: any) => {
return (
0%
25%
50%
75%
100%
Multiple bars
);
};
const Example87 = (props: any) => {
return (
);
};
const Example88 = (props: any) => {
return (
25%
1/2
You're almost there!
You did it!
Meh
Wow!
Cool
20%
!!
);
};
const Example89 = (props: any) => {
return (
);
};
const Example90 = (props: any) => {
return (
);
};
const Example91 = (props: any) => {
return (
Plain
With Labels
Meh
Wow!
25%
LOOK OUT!!
Stripes and Animations
Stripes
Animated Stripes
Plain
);
};
const Example92 = (props: any) => {
return (
1 of 5
50 of 135
75 of 111
463 of 500
Various (40) of 55
5
15
10
10
);
};
// --------------- Table
class Example93 extends React.Component {
render() {
return (
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
);
}
}
class Example94 extends React.Component {
render() {
return (
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
);
}
}
class Example95 extends React.Component {
render() {
return (
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
);
}
}
class Example96 extends React.Component {
render() {
return (
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
);
}
}
class Example97 extends React.Component {
render() {
return (
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
);
}
}
class Example98 extends React.Component {
render() {
return (
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
);
}
}
class Example99 extends React.Component {
render() {
return (
#
Table heading
Table heading
Table heading
Table heading
Table heading
Table heading
1
Table cell
Table cell
Table cell
Table cell
Table cell
Table cell
2
Table cell
Table cell
Table cell
Table cell
Table cell
Table cell
3
Table cell
Table cell
Table cell
Table cell
Table cell
Table cell
);
}
}
class Example100 extends React.Component {
render() {
return (
#
Table heading
Table heading
Table heading
Table heading
Table heading
Table heading
1
Table cell
Table cell
Table cell
Table cell
Table cell
Table cell
2
Table cell
Table cell
Table cell
Table cell
Table cell
Table cell
3
Table cell
Table cell
Table cell
Table cell
Table cell
Table cell
);
}
}
class Example101 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
activeTab: '1'
};
}
toggle(tab: string) {
if (this.state.activeTab !== tab) {
this.setState({
activeTab: tab
});
}
}
render() {
return (
{ this.toggle('1'); }}
>
Tab1
{ this.toggle('2'); }}
>
Moar Tabs
Tab 1 Contents
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
Special Title Treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere
);
}
}
class Example102 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
tooltipOpen: false
};
}
toggle() {
this.setState({
tooltipOpen: !this.state.tooltipOpen
});
}
render() {
return (
Somewhere in here is a tooltip .
Hello world!
);
}
}
class Example103 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
tooltipOpen: false
};
}
toggle() {
this.setState({
tooltipOpen: !this.state.tooltipOpen
});
}
render() {
return (
Sometimes you need to allow users to select text within a tooltip .
Try to select this text!
);
}
}
class TooltipItem extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
tooltipOpen: false
};
}
toggle() {
this.setState({
tooltipOpen: !this.state.tooltipOpen
});
}
render() {
return (
{this.props.item.text}
Tooltip Content!
);
}
}
class TooltipExampleMulti extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.state = {
tooltips: [
{
placement: 'top',
text: 'Top'
},
{
placement: 'bottom',
text: 'Bottom'
},
{
placement: 'left',
text: 'Left'
},
{
placement: 'right',
text: 'Right'
}
]
};
}
render() {
return (
{this.state.tooltips.map((tooltip: {placement: string; text: string; }, i: number) => {
return ;
})}
);
}
}
class TooltipExampleFlipFade {
render() {
return (
Tooltip Content!
);
}
}
function Example() {
return (
Somewhere in here is a tooltip .
Hello world!
);
}
function Example104() {
const props = {
className: 'my-input',
style: {
borderColor: 'black',
}
};
return (
Label
);
}
function Example105() {
return (
Item
);
}
function Example106() {
return (
Details
);
}
const CSSModuleExample = (props: any) => {
const cssModule = {
btn: 'hash'
};
return (
Button
);
};
class Example107 extends React.Component {
private input: HTMLInputElement | null;
render() {
return { this.input = input; }} />;
}
}
class Example108 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
isOpen: false
};
}
toggle() {
this.setState({
isOpen: !this.state.isOpen
});
}
render() {
return (
reactstrap
Components
Github
);
}
}
class Example109 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
isOpen: false
};
}
toggle() {
this.setState({
isOpen: !this.state.isOpen
});
}
render() {
return (
reactstrap
Components
Github
);
}
}
class Example110 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
isOpen: false
};
}
toggle() {
this.setState({
isOpen: !this.state.isOpen
});
}
render() {
return (
reactstrap
Components
Github
);
}
}
class Example111 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
isOpen: false
};
}
toggle() {
this.setState({
isOpen: !this.state.isOpen
});
}
render() {
return (
reactstrap
Components
Github
);
}
}
class Example112 extends React.Component {
state: any;
constructor(props: any) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
isOpen: false
};
}
toggle() {
this.setState({
isOpen: !this.state.isOpen
});
}
render() {
return (
reactstrap
Components
Github
);
}
}
const Example113 = (props: any) => {
return (
Anim pariatur cliche reprehenderit,
enim eiusmod high life accusamus terry richardson ad squid. Nihil
anim keffiyeh helvetica, craft beer labore wes anderson cred
nesciunt sapiente ea proident.
);
};
class Example114 extends React.Component {
private element: HTMLElement;
refFn(r: HTMLElement | null) {
if (r) {
this.element = r;
}
}
render() {
return (
Somewhere in here is a tooltip .
Hello world!
);
}
}
class Example115 extends React.Component {
// https://reactstrap.github.io/components/carousel/
private readonly items = [
{
src: 'data:image/svg+xml...',
altText: 'Slide 1',
caption: 'Slide 1'
},
{
src: 'data:image/svg+xml...',
altText: 'Slide 2',
caption: 'Slide 2'
},
{
src: 'data:image/svg+xml...',
altText: 'Slide 3',
caption: 'Slide 3'
}
];
private animating: boolean;
state: any;
constructor(props: any) {
super(props);
this.state = { activeIndex: 0 };
this.next = this.next.bind(this);
this.previous = this.previous.bind(this);
this.goToIndex = this.goToIndex.bind(this);
this.onExiting = this.onExiting.bind(this);
this.onExited = this.onExited.bind(this);
}
onExiting() {
this.animating = true;
}
onExited() {
this.animating = false;
}
next() {
if (this.animating) return;
const nextIndex = this.state.activeIndex === this.items.length - 1 ? 0 : this.state.activeIndex + 1;
this.setState({ activeIndex: nextIndex });
}
previous() {
if (this.animating) return;
const nextIndex = this.state.activeIndex === 0 ? this.items.length - 1 : this.state.activeIndex - 1;
this.setState({ activeIndex: nextIndex });
}
goToIndex(newIndex: number) {
if (this.animating) return;
this.setState({ activeIndex: newIndex });
}
render() {
const { activeIndex } = this.state;
const slides = this.items.map((item) => {
return (
);
});
return (
{slides}
);
}
}
const Example116 = (props: any) => {
return(
I'm a button
Button Dropdown
Header
Action
Another Action
Another Action
Split Button
Header
Action
Another Action
Another Action
I'm a button
);
};
function Example117() {
const ref = (e: any) => {};
;
;
;
;
;
;
;