Spinners

Spinners - 图1

  1. import React from 'react';
  2. import { Spinner } from 'reactstrap';
  3. export default class Example extends React.Component {
  4. render() {
  5. return (
  6. <div>
  7. <Spinner color="primary" />
  8. <Spinner color="secondary" />
  9. <Spinner color="success" />
  10. <Spinner color="danger" />
  11. <Spinner color="warning" />
  12. <Spinner color="info" />
  13. <Spinner color="light" />
  14. <Spinner color="dark" />
  15. </div>
  16. );
  17. }
  18. }

Properties

  1. Spinner.propTypes = {
  2. type: PropTypes.string, // default: 'border'
  3. size: PropTypes.string,
  4. color: PropTypes.string,
  5. className: PropTypes.string,
  6. cssModule: PropTypes.object,
  7. children: PropTypes.string, // default: 'Loading...'
  8. };

Growing Spinner

Spinners - 图2

  1. import React from 'react';
  2. import { Spinner } from 'reactstrap';
  3. export default class Example extends React.Component {
  4. render() {
  5. return (
  6. <div>
  7. <Spinner type="grow" color="primary" />
  8. <Spinner type="grow" color="secondary" />
  9. <Spinner type="grow" color="success" />
  10. <Spinner type="grow" color="danger" />
  11. <Spinner type="grow" color="warning" />
  12. <Spinner type="grow" color="info" />
  13. <Spinner type="grow" color="light" />
  14. <Spinner type="grow" color="dark" />
  15. </div>
  16. );
  17. }
  18. }

Sizes

Spinners - 图3

Spinners - 图4

  1. <Spinner size="sm" color="primary" />{' '}
  2. <Spinner size="sm" color="secondary" />

Spinners - 图5

Spinners - 图6

  1. <Spinner style={{ width: '3rem', height: '3rem' }} />{' '}
  2. <Spinner style={{ width: '3rem', height: '3rem' }} type="grow" />