Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jornatf/clnames
Concat conditional classnames in your JavaScript project.
https://github.com/jornatf/clnames
classnames helpers javascript nodejs npm npm-package package react
Last synced: about 2 months ago
JSON representation
Concat conditional classnames in your JavaScript project.
- Host: GitHub
- URL: https://github.com/jornatf/clnames
- Owner: jornatf
- License: mit
- Created: 2024-01-18T14:33:50.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-01-24T16:38:09.000Z (11 months ago)
- Last Synced: 2024-04-25T00:03:07.116Z (8 months ago)
- Topics: classnames, helpers, javascript, nodejs, npm, npm-package, package, react
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/clnames
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# clnames
![Latest Version](https://img.shields.io/github/v/tag/jornatf/clnames?label=version&style=flat-square)
[![Licence](https://img.shields.io/github/license/jornatf/clnames?label=license&style=flat-square)](LICENCE.md)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/jornatf/clnames/run-tests.yml?branch=master&label=test&style=flat-square)](https://github.com/jornatf/clnames/actions?query=workflow%3Arun-tests+branch%3Amaster)
[![Downloads](https://img.shields.io/npm/dt/clnames?label=downloads&style=flat-square)](https://www.npmjs.com/package/clnames)**clnames** is a [NPM Package](https://www.npmjs.com/package/clnames) to concat simple and conditional classnames in your JavaScript project.
## Installation
```bash
# In your terminal, enter command:
npm install clnames
```### Usage
```javascript
import clnames from "clnames";clnames(...classes);
```Arguments `classes` must be a `string` or an `object`.
See example with [React](https://react.dev/), below:
```javascript
import { useState } from "react";
import clnames from "clnames";const App = () => {
const [color, setColor] = useState("blue");//...
return (
Hello, I'm {color}
);
};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
- [Jordan Nataf](https://github.com/jornatf)
- [All Contributors](../../contributors)## Licence
The MIT License (MIT).
> [!Note]
> Please see [License File](LICENSE.md) for more information.