0.0.2 • Published 2 years ago

easy-class v0.0.2

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

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>
	);
};
0.0.2

2 years ago

0.0.1

2 years ago