Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @patternfly/react-styles with all npm packages installed. Try it out:

var reactStyles = require("@patternfly/react-styles")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@patternfly/react-styles v4.3.1

CSS-in-JS class maps and utilities for PatternFly.

@patternfly/react-styles

Library that provides CSS-in-JS capabilities

Example

import { css } from '@patternfly/react-styles';
import styles from './Button.css';

const Buttton = ({ isActive, isDisabled, children }) => (
  <button
    disabled={isDisabled}
    className={css(styles.button, isActive && styles.modifiers.active, isDisabled && styles.modifiers.disabled)}
  >
    {children}
  </button>
);
DOM output
<button disabled="" class="pf-c-button pf-is-disabled">
  Hello World
</button>
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free