How to use the classnames.default function in classnames

To help you get started, we’ve selected a few classnames 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 springload / react-accessible-accordion / src / components / AccordionItemHeading.tsx View on Github external
render(): JSX.Element {
        const {
            className,
            expandedClassName,
            expanded,
            toggleExpanded,
            ...rest
        } = this.props;

        const headingClassName = classnames(className, {
            [String(expandedClassName)]: expandedClassName && expanded,
        });

        return (
            <div data-accordion-component="AccordionItemHeading">
        );
    }
}</div>
github jenkinsci / jenkins-design-language / .styleguide / ComponentsList.tsx View on Github external
{items.map(({ heading, name, href, content }: any) =&gt; (
                <li>
                    {heading &amp;&amp; <div>{name}</div>}
                    {!heading &amp;&amp; (
                        <a href="{href}">
                            {name}
                        </a>
                    )}
                    {content}
                </li>
            ))}
github springload / react-accessible-accordion / src / components / AccordionItem.tsx View on Github external
render(): JSX.Element {
        const { className, expanded, expandedClassName, ...rest } = this.props;

        return (
            <div>
        );
    }
}</div>
github tomchentw / react-google-maps / examples / gh-pages / src / containers / AsyncApplication.js View on Github external
<a href="#">Async | React Google Maps</a>
            
          
          <nav>
            by @tomchentw
            Back to sync examples
          </nav>
          
            <nav>
              Back to sync examples
            </nav>
          
        
        <div>
          
            Fork me on GitHub
          
          
          <div>
            <div style="{{">
              {React.cloneElement(Children.only(this.props.children), {
                toast: ::this._handle_toast,
              })}</div></div></div>
github springload / react-accessible-accordion / src / AccordionItemTitle / AccordionItemTitle.tsx View on Github external
render(): JSX.Element {
        const {
            className,
            hideBodyClassName,
            accordion,
            setExpanded,
            expanded,
            uuid,
            disabled,
            ...rest
        } = this.props;

        const id = `accordion__title-${uuid}`;
        const ariaControls = `accordion__body-${uuid}`;
        const role = 'button';
        const titleClassName = classnames(className, {
            [hideBodyClassName]: hideBodyClassName &amp;&amp; !expanded,
        });
        const onClick = disabled ? undefined : this.handleClick;

        return (
            <div tabindex="{0}" role="{role}" aria-controls="{ariaControls}" aria-expanded="{expanded}" id="{id}"></div>
github tomchentw / react-google-maps / examples / gh-pages / scripts / containers / NavHeaderBar.js View on Github external
function renderDropdown() {
      const dropdownClassSet = { dropdown: true };
      dropdownClassSet.open = state.dropdownOpen;

      if (props.dropdownActions.length) {
        return (
          <li>
            <a href="#">Samples <span></span></a>
            <ul role="menu">
              {props.dropdownActions.map(actionToMenuItem, this)}
            </ul>
          </li>
        );
      } else {
        return null;
      }
    }
github patternfly / patternfly-react / packages / patternfly-3 / patternfly-react / src / components / LoginPage / components / LoginCardComponents / LoginFormError.js View on Github external
const LoginFormError = ({ children, show, topErrorOnly, className, ...props }) =&gt; (
  <div style="{topErrorOnly">
    
      {children}
    
  </div>
);
github springload / react-accessible-accordion / src / AccordionItemBody / AccordionItemBody.tsx View on Github external
className,
        hideBodyClassName,
        uuid,
        expanded,
        disabled,
        accordion,
        ...rest
    } = props;

    const role = accordion ? 'region' : null;
    const hideAriaAttribute = accordion ? !expanded : null;

    return (
        <div role="{role}" aria-labelledby="{`accordion__title-${uuid}`}" aria-hidden="{hideAriaAttribute}" id="{`accordion__body-${uuid}`}">
    );
};
</div>
github jenkinsci / jenkins-design-language / .styleguide / ComponentsList.tsx View on Github external
{items.map(({ heading, name, href, content }: any) =&gt; (
                <li>
                    {heading &amp;&amp; <div>{name}</div>}
                    {!heading &amp;&amp; (
                        <a href="{href}">
                            {name}
                        </a>
                    )}
                    {content}
                </li>
            ))}
github fibo / trunx / component / Breadcrumb.js View on Github external
Breadcrumb.prototype.render = function () {
        var _a = this.props, hasArrowSeparator = _a.hasArrowSeparator, hasBulletSeparator = _a.hasBulletSeparator, hasDotSeparator = _a.hasDotSeparator, hasSuccedesSeparator = _a.hasSuccedesSeparator, isCentered = _a.isCentered, isRight = _a.isRight, props = tslib_1.__rest(_a, ["hasArrowSeparator", "hasBulletSeparator", "hasDotSeparator", "hasSuccedesSeparator", "isCentered", "isRight"]);
        var className = classnames_1.default("breadcrumb", {
            "has-arrow-separator": hasArrowSeparator,
            "has-bullet-separator": hasBulletSeparator,
            "has-dot-separator": hasDotSeparator,
            "has-succedes-separator": hasSuccedesSeparator,
            "is-centered": isCentered,
            "is-right": isRight,
        }, modifiers_1.sizePropsToClassenames(this.props), modifiers_1.textColorHelpersPropsToClassenames(this.props));
        return (React.createElement("nav", tslib_1.__assign({}, props, { "aria-label": "breadcrumbs", className: className }),
            React.createElement("ul", null, this.props.children)));
    };
    return Breadcrumb;

classnames

A simple utility for conditionally joining classNames together

MIT
Latest version published 11 months ago

Package Health Score

88 / 100
Full package analysis