easy-class

0.0.2 • Public • Published

Easy Class 🎓

A simple way to map css classes for react components similar to how the Angular [ngClass] directive works.

npm install easy-class

How-to-use ⚙️

import { classlist } from 'easy-class';

const MyComponent = () => {
	const [loading, setLoading] = useState(false);

	return (
		<div className={classlist(
			styles.AuthPage,
			loading && styles.AuthPage__loading
		)}>
			MyComponent Works
			<button onClick={() => setLoading(!loading)}>Login</button>
		</div>
	);
};

Package Sidebar

Install

npm i easy-class

Weekly Downloads

0

Version

0.0.2

License

ISC

Unpacked Size

2.97 kB

Total Files

6

Last publish

Collaborators

  • haydncomley