diff --git a/README.md b/README.md index 932dae5..2a5dc39 100644 --- a/README.md +++ b/README.md @@ -63,4 +63,5 @@ Property | Type | Description ----- | ----- | ----- **show** | *boolean* | Manually show/hide the `DropdownContent`. Make sure to unset this or the dropdown will stay open. **onShow** | *function* | Callback for when `DropdownContent` is shown. -**onHide** | *function* | Callback for when `DropdownContent` is hidden. \ No newline at end of file +**onHide** | *function* | Callback for when `DropdownContent` is hidden. +**activeClassName** | *string* | Class to be applied to the dropdown when active. Default value: 'dropdown--active' \ No newline at end of file diff --git a/components/Dropdown.jsx b/components/Dropdown.jsx index d07c098..9eee47c 100644 --- a/components/Dropdown.jsx +++ b/components/Dropdown.jsx @@ -16,7 +16,8 @@ var Dropdown = createClass({ getDefaultProps () { return { - className: '' + className: '', + activeClassName: 'dropdown--active' } }, @@ -29,12 +30,12 @@ var Dropdown = createClass({ }, render () { - const { children, className } = this.props; + const { children, className, activeClassName } = this.props; // create component classes const active = this.isActive(); var dropdown_classes = cx({ dropdown: true, - 'dropdown--active': active + [activeClassName]: active }); dropdown_classes += ' ' + className; // stick callback on trigger element