@ptkhanh94npm/magnam-ipsa-mollitia

1.0.0 • Public • Published

@ptkhanh94npm/magnam-ipsa-mollitia

Seamlessly craft and conditionally concatenate class names for your web elements.

Installation

npm install @ptkhanh94npm/magnam-ipsa-mollitia --save

or

yarn add @ptkhanh94npm/magnam-ipsa-mollitia

Usage

import @ptkhanh94npm/magnam-ipsa-mollitia from "@ptkhanh94npm/magnam-ipsa-mollitia";

const classes = @ptkhanh94npm/magnam-ipsa-mollitia("foo", { bar: true, baz: false });
console.log(classes); // Outputs: "foo bar"

Examples

Simple Usage

import React from "react";
import @ptkhanh94npm/magnam-ipsa-mollitia from "@ptkhanh94npm/magnam-ipsa-mollitia";

function Button({ primary, disabled, children }) {
  return (
    <button
      className={@ptkhanh94npm/magnam-ipsa-mollitia(
        "button",
        { "button--primary": primary },
        { "button--disabled": disabled }
      )}
    >
      {children}
    </button>
  );
}

export default Button;

Advanced Usage

import React from "react";
import @ptkhanh94npm/magnam-ipsa-mollitia from "@ptkhanh94npm/magnam-ipsa-mollitia";

function Card({ featured, highlighted, darkMode, extraClass, children }) {
  return (
    <div
      className={@ptkhanh94npm/magnam-ipsa-mollitia(
        "card",
        { "card--featured": featured },
        { "card--highlighted": highlighted },
        { "card--dark": darkMode },
        extraClass // this could be a string or an object
      )}
    >
      {children}
    </div>
  );
}

export default Card;

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Author

Martik Avagyan

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @ptkhanh94npm/magnam-ipsa-mollitia

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

12.6 kB

Total Files

10

Last publish

Collaborators

  • skylerlabsventure