@hmiproject/helio-sdk
    Preparing search index...

    Function cx

    • Merges multiple classNames

      Parameters

      • ...classNames: (string | CSSObject | undefined)[]

      Returns string

      const color = className({ color: 'blue' });
      const background = className({ background: 'yellow' });

      function MyComponent() {
      return (
      <div className={cx(color, background)}>
      Colorized
      </div>
      );
      }
      const color = className({ color: 'blue' });
      const background = className({ background: 'yellow' });

      function MyComponent(props) {
      return (
      <div
      className={cx(color, {
      // Set the background color only if `props.isActive` is `true`
      [background]: props.isActive,
      })}
      >
      Colorized
      </div>
      );
      }