diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.d.ts b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.d.ts index 06a75331703..3a652531b4b 100644 --- a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.d.ts +++ b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.d.ts @@ -9,6 +9,7 @@ export interface DropdownToggleProps extends HTMLProps { isFocused?: boolean; isHovered?: boolean; isActive?: boolean; + iconComponent?: ReactType; } declare const DropdownToggle: SFC; diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.js b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.js index 144c7dcb3f1..af2fac76e01 100644 --- a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.js +++ b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownToggle.js @@ -5,10 +5,10 @@ import Toggle from './Toggle'; import styles from '@patternfly/patternfly-next/components/Dropdown/dropdown.css'; import { css } from '@patternfly/react-styles'; -const DropdownToggle = ({ children, ...props }) => ( +const DropdownToggle = ({ children, iconComponent: IconComponent, ...props }) => ( {children} - + {IconComponent && } ); @@ -30,7 +30,9 @@ DropdownToggle.propTypes = { /** Forces hover state */ isHovered: PropTypes.bool, /** Forces active state */ - isActive: PropTypes.bool + isActive: PropTypes.bool, + /** The icon to display for the toggle. Defaults to CaretDownIcon. Set to null to not show an icon. */ + iconComponent: PropTypes.func }; DropdownToggle.defaultProps = { @@ -41,7 +43,8 @@ DropdownToggle.defaultProps = { isFocused: false, isHovered: false, isActive: false, - onToggle: Function.prototype + onToggle: Function.prototype, + iconComponent: CaretDownIcon }; export default DropdownToggle; diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/__snapshots__/Dropdown.test.js.snap b/packages/patternfly-4/react-core/src/components/Dropdown/__snapshots__/Dropdown.test.js.snap index 6afd345df27..99bcadca7c5 100644 --- a/packages/patternfly-4/react-core/src/components/Dropdown/__snapshots__/Dropdown.test.js.snap +++ b/packages/patternfly-4/react-core/src/components/Dropdown/__snapshots__/Dropdown.test.js.snap @@ -1348,6 +1348,7 @@ exports[`dropdown basic 1`] = ` toggle={