How to use the carbon-components-react/lib/prop-types/types.ButtonTypes.buttonKind function in carbon-components-react

To help you get started, we’ve selected a few carbon-components-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / carbon-addons-iot-react / src / components / ButtonEnhanced / ButtonEnhanced.jsx View on Github external
}
  }
`;

const propTypes = {
  /** Show loading spinner, only new prop */
  loading: PropTypes.bool,
  /** Disable the button will be auto disabled when loading */
  disabled: PropTypes.bool,
  /** Button label */
  children: PropTypes.node.isRequired,
  /** click handler */
  onClick: PropTypes.func.isRequired,
  className: PropTypes.string,
  /** primary, secondary, etc from carbon */
  kind: ButtonTypes.buttonKind,
};

const defaultProps = {
  loading: false,
  disabled: false,
  className: null,
  kind: 'primary',
};

/**
 * Carbon button with added ability to show loading state
 */
const ButtonEnhanced = props => {
  const { children, loading, disabled, className, ...other } = props;
  return (
github IBM / carbon-addons-iot-react / src / components / TileGallery / StatefulTileGallery.jsx View on Github external
PropTypes.node,
          ]),
          afterContent: PropTypes.node,
          thumbnail: PropTypes.node,
          href: PropTypes.string,
        })
      ),
    })
  ).isRequired,
  classNameGalleryItem: PropTypes.string,
  /** Is button disabled */
  isButtonDisabled: PropTypes.bool,
  /** Custom className for Button component */
  buttonClassName: PropTypes.string,
  /** Button kind */
  buttonKind: ButtonTypes.buttonKind,
  /** Button content */
  buttonText: PropTypes.string,
};

const defaultProps = {
  description: null,
  hasSearch: false,
  hasSwitcher: false,
  hasButton: false,
  i18n: {
    searchIconDescription: 'Search',
    searchPlaceHolderText: 'Search for something',
    searchCloseButtonText: 'Clear search',
    listText: 'List',
    gridText: 'Grid',
    arrowIconDescription: 'Expand/Collapse',

carbon-components-react

The Carbon Design System is IBM’s open-source design system for products and experiences.

Apache-2.0
Latest version published 1 month ago

Package Health Score

61 / 100
Full package analysis