1.0.2 • Published 2 years ago

clnames v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

clnames

Latest Version Licence GitHub Tests Action Status Downloads

clnames is a NPM Package to concat simple and conditional classnames in your JavaScript project.

Installation

# In your terminal, enter command:
npm install clnames

Usage

import clnames from "clnames";

clnames(...classes);

Arguments classes must be a string or an object.

See example with React, below:

import { useState } from "react";
import clnames from "clnames";

const App = () => {
  const [color, setColor] = useState("blue");

  //...

  return (
    <div className="App">
      <div
        className={clnames(
          "font-bold",
          {
            "text-blue-500": color === "blue",
            "text-red-300": color === "red",
          } /*...*/
        )}
      >
        Hello, I'm {color}
      </div>
    </div>
  );
};

export default App;

Contributing

If you are interested in this project and want to improve it, fix errors or bugs, you're welcome to contribute.

Credits

Licence

The MIT License (MIT).

!Note Please see License File for more information.

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago