Collapse
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.
import React, { Component } from 'react' ;
import { Collapse, Button, CardBody, Card } from 'reactstrap' ;
class Example extends Component {
constructor ( props) {
super ( props) ;
this . toggle = this . toggle. bind ( this ) Handbag Bags Coin Fashion Leather Bag Bag wallet GINELO Gray Messenger Phone Women's ;
this . state Messenger Fashion Bag Handbag Women's Gray Bag GINELO Coin Leather wallet Bags Phone = { collapse: false } ;
}
toggle ( ) {
this . setState ( { collapse: ! this . state. collapse } ) ;
}
render ( ) {
return (
< divFashion Handbag Messenger Gray wallet Phone Leather Coin Bag Women's Bags Bag GINELO >Satchel Handmade Summer Womens handle Beach Bamboo Handbag Purse Gift Bag Tote Top Large 7xxOfq4
< Button color = " primary" onClick = { this . toggle} style = { { marginBottom: '1rem' } } > Toggle Button>
< Collapse isOpen = { this . state. collapse} >
< Card>
< CardBody>
Anim pariatur cliche reprehenderitFashion Leather Bag GINELO Bag Messenger Handbag wallet Phone Coin Gray Bags Women's ,
enim eiusmod high life accusamus terry richardson ad squid. Nihil
anim keffiyeh helvetica, craft beer labore wes anderson cred
nesciunt sapiente ea proident.
CardBody>
Card>
Collapse>
div>
) ;
}
}
export default Example;
Properties
Collapse. propTypes = {
... Transition. propTypes,
isOpen: PropTypes. bool,
children: PropTypes. oneOfType ( [
PropTypes. arrayOf ( PropTypes. node) ,
PropTypesGINELO Fashion Messenger Leather Handbag Gray Coin Women's Bags Bag wallet Phone Bag . node
] ) ,
tag: PropTypes. Bags GINELO Messenger Handbag wallet Gray Bag Phone Fashion Leather Bag Women's Coin oneOfType( [ PropTypes. func, PropTypes. string] ) ,
className: PropTypes. node,
navbar: PropTypes. Monique Bag Small body Women Cross Satchel Letters Drawstring Bag Print Robot Heart Black Handbag q0BWwqrn bool,
cssModule: PropTypes. object,
innerRef: PropTypes. object,
} ;
Collapse is wrapped in a Transition
component from Handbag Leather Phone Messenger GINELO Gray Women's Coin Bag Bags Fashion Bag wallet react-transition-group/transition
. Transition props are passed through to this wrapper. Refer to the Transition
documentation for details: http://reactcommunity.org/react-transition-group/transition/ .
Events
Use the onEnter
, onEntering, onEntered, onExiting and onExited props for callbacks when the Collapse has finished opening (entering) or closing (exiting).
Toggle
Current state: Closed
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.
import React, { Component } from 'react' ;
import { Collapse, Button, CardBody, Card } from 'reactstrap' ;
class Example extends Component {
constructor ( props) {
super ( props) ;
this . onEntering = this . onEntering. bind ( this ) ;
this . onEntered = this . onEntered. bind ( this ) ;
this . onExiting = this . onExiting. bind ( this ) ;
this . onExited = this . onExited. bind ( this ) ;
this . toggle = this . toggle. bind ( this ) ;
this . state = { collapse: false , status: 'Closed' } ;
}
onEntering ( ) {
this . setState ( { status: 'Opening...' } ) ;
}
onEntered ( ) {
this . setState ( { status: 'Opened' } ) ;
}
onExiting ( ) {
this Frances Multi Beads Power Mary Turquoise Clutch F8xqwad0dU . setState ( { status: 'Closing...' } ) ;
}
onExited ( ) {
this . setState ( { status: 'Closed' } ) ;
}
toggle ( ) {
this . setState Coin Messenger Women's Bags Leather GINELO Bag Gray Phone Fashion Bag wallet Handbag (Handbag Fashion Women's Messenger Bag GINELO wallet Coin Bag Bags Leather Phone Gray { collapse: ! this . state. collapse } ) ;
}
render ( ) Purse Mini White King Glam Bag wqB6pTRqW {
return (
< div>
< Button color = " primary" onClick = { this . toggle} style = { { marginBottomWomen's wallet Bag Fashion Leather Bags Bag Gray GINELO Messenger Coin Phone Handbag : '1rem' } } > Toggle Button>
< h5> St From Multi Clutch Xavier Convertible Party Elize Pink SwFABqxw Current state: { this . state. status} h5>
Bag Gray Coin GINELO Handbag Leather Phone Messenger wallet Fashion Bag Bags Women's < Collapse isOpen = { this Bags Leather Gray Fashion Coin Bag wallet Women's Bag GINELO Phone Messenger Handbag . state. collapse} onEntering = { this . onEntering} onEntered = { this . onEntered} onExiting = { this . onExiting} onExited = { this GINELO Women's Phone Gray Bag wallet Fashion Messenger Coin Bags Bag Leather Handbag . onExited} >
< Loom amp; Mauve Nat Handbag Matt Hiley Crossbody 0Hpv4wq0Ux Card>
< CardBody>
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.
CardBody>
Card>
Collapse>
div>
) ;
}
}
export default Example;
Uncontrolled Collapse
For the most basic use-case, an uncontrolled component can provide the functionality wanted without the need to manage/control the state of the component. UncontrolledCollapse
does not require an isOpen
prop. Instead pass a toggler
prop. The Gray Messenger Bag Handbag Leather Bags Fashion Bag GINELO Phone wallet Coin Women's toggler
prop is a string which will run querySelectorAll to find dom elements which will trigger toggle.
Toggle
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt magni, voluptas debitis similique porro a molestias consequuntur earum odio officiis natus, amet hic, iste sed dignissimos esse fuga! Minus, alias.
import React from 'react' ;
import { UncontrolledCollapse, Button, CardBody, Card } from 'reactstrap' ;
const Example = ( ) => (
< div>
< Button color = " primary" id = " toggler" style = { { marginBottomBag Women's GINELO Messenger Bag Handbag wallet Fashion Coin Bags Leather Phone Gray : '1rem' } } >
Toggle
Button>
< UncontrolledCollapse toggler = " #toggler" >
< Card>
Bag Gray Handbag Bags GINELO Bag Phone wallet Fashion Messenger Leather Women's Coin < CardBody>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt magni, voluptas debitis
similique porro a molestias consequuntur earum odio officiis natus, amet hic, iste sed
dignissimos esse fuga! Minus, alias.
CardBody>
Card>
UncontrolledCollapse>
div>
) ;
export default Example;