Properties

  1. // Pass in a Component to override default element
  2. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  3. inverse: PropTypes.bool,
  4. color: PropTypes.string,
  5. body: PropTypes.bool,
  6. className: PropTypes.string
  7. };
  8. CardBody.propTypes = {
  9. // Pass in a Component to override default element
  10. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  11. className: PropTypes.string
  12. };
  13. CardColumns.propTypes = {
  14. // Pass in a Component to override default element
  15. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  16. className: PropTypes.string
  17. };
  18. CardDeck.propTypes = {
  19. // Pass in a Component to override default element
  20. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  21. className: PropTypes.string
  22. };
  23. CardFooter.propTypes = {
  24. // Pass in a Component to override default element
  25. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  26. className: PropTypes.string
  27. };
  28. CardGroup.propTypes = {
  29. // Pass in a Component to override default element
  30. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  31. className: PropTypes.string
  32. };
  33. CardHeader.propTypes = {
  34. // Pass in a Component to override default element
  35. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  36. className: PropTypes.string
  37. };
  38. CardImg.propTypes = {
  39. // Pass in a Component to override default element
  40. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  41. className: PropTypes.string,
  42. // Use top or bottom to position image via "card-img-top" or "card-img-bottom"
  43. top: PropTypes.bool,
  44. bottom: PropTypes.bool
  45. };
  46. CardImgOverlay.propTypes = {
  47. // Pass in a Component to override default element
  48. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  49. className: PropTypes.string
  50. };
  51. CardLink.propTypes = {
  52. // Pass in a Component to override default element
  53. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  54. className: PropTypes.string,
  55. // ref will only get you a reference to the CardLink component, use innerRef to get a reference to the DOM element (for things like focus management).
  56. innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
  57. };
  58. CardSubtitle.propTypes = {
  59. // Pass in a Component to override default element
  60. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  61. className: PropTypes.string
  62. };
  63. CardText.propTypes = {
  64. // Pass in a Component to override default element
  65. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  66. className: PropTypes.string
  67. };
  68. CardTitle.propTypes = {
  69. // Pass in a Component to override default element
  70. tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
  71. className: PropTypes.string
  72. };

  1. import React from 'react';
  2. import { Card, CardImg, CardText, CardBody, CardLink,
  3. CardTitle, CardSubtitle } from 'reactstrap';
  4. const Example = (props) => {
  5. return (
  6. <div>
  7. <Card>
  8. <CardBody>
  9. <CardTitle>Card title</CardTitle>
  10. <CardSubtitle>Card subtitle</CardSubtitle>
  11. </CardBody>
  12. <img width="100%" src="https://placeholdit.imgix.net/~text?txtsize=33&txt=318%C3%97180&w=318&h=180" alt="Card image cap" />
  13. <CardBody>
  14. <CardText>Some quick example text to build on the card title and make up the bulk of the card's content.</CardText>
  15. <CardLink href="#">Card Link</CardLink>
  16. <CardLink href="#">Another Link</CardLink>
  17. </CardBody>
  18. </div>
  19. );
  20. };
  21. export default Example;

Sizing

Card - 图1

  1. import React from 'react';
  2. import { Card, Button, CardTitle, CardText, Row, Col } from 'reactstrap';
  3. return (
  4. <Row>
  5. <Col sm="6">
  6. <Card body>
  7. <CardTitle>Special Title Treatment</CardTitle>
  8. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  9. <Button>Go somewhere</Button>
  10. </Card>
  11. </Col>
  12. <Col sm="6">
  13. <Card body>
  14. <CardTitle>Special Title Treatment</CardTitle>
  15. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  16. <Button>Go somewhere</Button>
  17. </Card>
  18. </Col>
  19. </Row>
  20. );
  21. };
  22. export default Example;

Text alignment

  1. import React from 'react';
  2. import { Card, Button, CardHeader, CardFooter, CardBody,
  3. CardTitle, CardText } from 'reactstrap';
  4. const Example = (props) => {
  5. return (
  6. <div>
  7. <Card>
  8. <CardHeader>Header</CardHeader>
  9. <CardBody>
  10. <CardTitle>Special Title Treatment</CardTitle>
  11. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  12. <Button>Go somewhere</Button>
  13. </CardBody>
  14. <CardFooter>Footer</CardFooter>
  15. </Card>
  16. <Card>
  17. <CardHeader tag="h3">Featured</CardHeader>
  18. <CardBody>
  19. <CardTitle>Special Title Treatment</CardTitle>
  20. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  21. <Button>Go somewhere</Button>
  22. </CardBody>
  23. <CardFooter className="text-muted">Footer</CardFooter>
  24. </Card>
  25. </div>
  26. );
  27. };
  28. export default Example;

Image caps

Card - 图2

  1. import React from 'react';
  2. import { Card, CardBody, Button, CardTitle, CardText, CardImg } from 'reactstrap';
  3. const Example = (props) => {
  4. return (
  5. <div>
  6. <Card>
  7. <CardImg top width="100%" src="" alt="Card image cap" />
  8. <CardBody>
  9. <CardTitle>Card Title</CardTitle>
  10. <CardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CardText>
  11. <CardText>
  12. <small className="text-muted">Last updated 3 mins ago</small>
  13. </CardText>
  14. </CardBody>
  15. </Card>
  16. <Card>
  17. <CardBody>
  18. <CardTitle>Card Title</CardTitle>
  19. <CardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CardText>
  20. <CardText>
  21. <small className="text-muted">Last updated 3 mins ago</small>
  22. </CardText>
  23. </CardBody>
  24. <CardImg bottom width="100%" src="https://placeholdit.imgix.net/~text?txtsize=33&txt=318%C3%97180&w=318&h=180" alt="Card image cap" />
  25. </Card>
  26. </div>
  27. );
  28. };
  29. export default Example;

Image overlays

  1. import React from 'react';
  2. import { Card, CardTitle, CardText, CardImg, CardImgOverlay } from 'reactstrap';
  3. const Example = (props) => {
  4. return (
  5. <div>
  6. <Card inverse>
  7. <CardImg width="100%" src="" alt="Card image cap" />
  8. <CardImgOverlay>
  9. <CardTitle>Card Title</CardTitle>
  10. <CardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CardText>
  11. <CardText>
  12. <small className="text-muted">Last updated 3 mins ago</small>
  13. </CardText>
  14. </CardImgOverlay>
  15. </Card>
  16. </div>
  17. );
  18. };
  19. export default Example;

Card - 图3

Outline variants

  1. import React from 'react';
  2. import { Card, Button, CardTitle, CardText } from 'reactstrap';
  3. const Example = (props) => {
  4. return (
  5. <div>
  6. <Card body outline color="secondary">
  7. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  8. <Button>Button</Button>
  9. </Card>
  10. <Card body outline color="primary">
  11. <CardTitle>Special Title Treatment</CardTitle>
  12. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  13. <Button color="secondary">Button</Button>
  14. </Card>
  15. <Card body outline color="success">
  16. <CardTitle>Special Title Treatment</CardTitle>
  17. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  18. <Button color="secondary">Button</Button>
  19. </Card>
  20. <Card body outline color="info">
  21. <CardTitle>Special Title Treatment</CardTitle>
  22. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  23. <Button color="secondary">Button</Button>
  24. </Card>
  25. <Card body outline color="warning">
  26. <CardTitle>Special Title Treatment</CardTitle>
  27. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  28. <Button color="secondary">Button</Button>
  29. </Card>
  30. <Card body outline color="danger">
  31. <CardTitle>Special Title Treatment</CardTitle>
  32. <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
  33. <Button color="secondary">Button</Button>
  34. </Card>
  35. </div>
  36. );
  37. };
  38. export default Example;

Groups

  1. import React from 'react';
  2. import { Card, Button, CardImg, CardTitle, CardText, CardGroup,
  3. CardSubtitle, CardBody } from 'reactstrap';
  4. const Example = (props) => {
  5. return (
  6. <CardGroup>
  7. <Card>
  8. <CardImg top width="100%" src="https://placeholdit.imgix.net/~text?txtsize=33&txt=256%C3%97180&w=256&h=180" alt="Card image cap" />
  9. <CardBody>
  10. <CardTitle>Card title</CardTitle>
  11. <CardSubtitle>Card subtitle</CardSubtitle>
  12. <CardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CardText>
  13. <Button>Button</Button>
  14. </CardBody>
  15. </Card>
  16. <Card>
  17. <CardImg top width="100%" src="" alt="Card image cap" />
  18. <CardBody>
  19. <CardTitle>Card title</CardTitle>
  20. <CardSubtitle>Card subtitle</CardSubtitle>
  21. <CardText>This card has supporting text below as a natural lead-in to additional content.</CardText>
  22. <Button>Button</Button>
  23. </CardBody>
  24. </Card>
  25. <Card>
  26. <CardImg top width="100%" src="https://placeholdit.imgix.net/~text?txtsize=33&txt=256%C3%97180&w=256&h=180" alt="Card image cap" />
  27. <CardBody>
  28. <CardTitle>Card title</CardTitle>
  29. <CardSubtitle>Card subtitle</CardSubtitle>
  30. <CardText>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.</CardText>
  31. <Button>Button</Button>
  32. </CardBody>
  33. </Card>
  34. </CardGroup>
  35. );
  36. };
  37. export default Example;

Card - 图4

  1. import React from 'react';
  2. import { Card, Button, CardImg, CardTitle, CardText, CardDeck,
  3. CardSubtitle, CardBody } from 'reactstrap';
  4. const Example = (props) => {
  5. return (
  6. <CardDeck>
  7. <Card>
  8. <CardImg top width="100%" src="" alt="Card image cap" />
  9. <CardBody>
  10. <CardTitle>Card title</CardTitle>
  11. <CardSubtitle>Card subtitle</CardSubtitle>
  12. <CardText>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</CardText>
  13. <Button>Button</Button>
  14. </CardBody>
  15. </Card>
  16. <Card>
  17. <CardImg top width="100%" src="https://placeholdit.imgix.net/~text?txtsize=33&txt=256%C3%97180&w=256&h=180" alt="Card image cap" />
  18. <CardBody>
  19. <CardTitle>Card title</CardTitle>
  20. <CardSubtitle>Card subtitle</CardSubtitle>
  21. <CardText>This card has supporting text below as a natural lead-in to additional content.</CardText>
  22. <Button>Button</Button>
  23. </CardBody>
  24. </Card>
  25. <Card>
  26. <CardImg top width="100%" src="" alt="Card image cap" />
  27. <CardBody>
  28. <CardTitle>Card title</CardTitle>
  29. <CardSubtitle>Card subtitle</CardSubtitle>
  30. <CardText>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.</CardText>
  31. <Button>Button</Button>
  32. </CardBody>
  33. </Card>
  34. </CardDeck>
  35. );
  36. };

Columns