How to use the @patternfly/react-styles/css/components/Dropdown/dropdown.dropdownToggle function in @patternfly/react-styles

To help you get started, we’ve selected a few @patternfly/react-styles 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 patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Dropdown / Dropdown.tsx View on Github external
export const Dropdown: React.FunctionComponent = ({
  onSelect,
  ref, // Types of Ref are different for React.FC vs React.Component
  ...props
}: DropdownProps) => (
   onSelect && onSelect(event),
      toggleTextClass: styles.dropdownToggleText,
      toggleIconClass: styles.dropdownToggleIcon,
      menuClass: styles.dropdownMenu,
      itemClass: styles.dropdownMenuItem,
      toggleClass: styles.dropdownToggle,
      baseClass: styles.dropdown,
      baseComponent: 'div',
      sectionClass: styles.dropdownGroup,
      sectionTitleClass: styles.dropdownGroupTitle,
      sectionComponent: 'section',
      disabledClass: styles.modifiers.disabled,
      hoverClass: styles.modifiers.hover,
      separatorClass: styles.dropdownSeparator
    }}
  >
    
  
);
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Dropdown / Toggle.tsx View on Github external
{({ toggleClass }) => (
          <button type="{type" id="{id}"> onToggle(!isOpen, event)}
            aria-expanded={isOpen}
            aria-haspopup={ariaHasPopup}
            onKeyDown={event =&gt; this.onKeyDown(event)}
            disabled={isDisabled}
          &gt;
            {children}
          </button>
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Dropdown / DropdownToggle.tsx View on Github external
onToggle={onToggle}
          ariaHasPopup={ariaHasPopup}
          {...(splitButtonItems &amp;&amp; { isSplitButton: true, 'aria-label': props['aria-label'] || 'Select' })}
        &gt;
          {children &amp;&amp; <span>{children}</span>}
          {IconComponent &amp;&amp; }
        
      )}
    
  );

  if (splitButtonItems) {
    return (
      <div>
        {splitButtonItems}
        {toggle}
      </div>
    );
  }

  return toggle;
};
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Dropdown / DropdownToggle.js View on Github external
const DropdownToggle = ({ children, iconComponent: IconComponent, splitButtonItems, ...props }) =&gt; {
  const toggle = (
    
      {children &amp;&amp; <span>{children}</span>}
      {IconComponent &amp;&amp; }
    
  );

  if (splitButtonItems) {
    return (
      <div>
        {splitButtonItems}
        {toggle}
      </div>
    );
  }

  return toggle;
};