A <1kB library for styling React components as if with CSS-in-JS, without CSS-in-JS
Nanostyled is a lightweight library for building styled UI elements in React and Preact. It encapsulates complex styles into simple, tweakable components without parsing CSS in JS, resulting in a smaller bundle size, faster components, and seamless server-side rendering.
To install Nanostyled, follow these steps:
npm install nanostyled
nanostyled function and start using it in your React or Preact components:import nanostyled from 'nanostyled';
// Example usage
const Button = nanostyled('button', {
color: 'red',
fontSize: '16px',
// ...
});
Nanostyled is a minimalistic CSS-in-JS library that simplifies the process of styling UI components in React and Preact. With its low overhead and props-controlled API, developers can easily create and customize styled elements without sacrificing performance. The library also supports server-side rendering, making it a versatile choice for building UIs in various environments.