# named-components

> Very thin utility to name your components properly while assigning classes to them.

Latest version **0.2.4** (published 2025-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install named-components
pnpm add named-components
yarn add named-components
bun add named-components
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2025-02-06 |
| First published | 2024-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20.x |
| Dependencies | 0 |
| Unpacked size | 55 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Henrique Inonhe |
| Maintainers | henriqueinonhe |
| Keywords | react, css, sass, BEM, components |

## Links

- npm: https://www.npmjs.com/package/named-components
- npm.io page: https://npm.io/package/named-components

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.2.4 (latest) — 2025-02-06
- 0.2.3 — 2025-02-04
- 0.2.2 — 2024-10-10
- 0.2.1 — 2024-10-10
- 0.2.0 — 2024-10-10
- 0.0.1-0 — 2024-10-10
- 0.0.0-beta — 2024-10-10

## README

# Named Components

Very thin utility to name your components properly while assigning classes to them.

```tsx
import styles from "./Component.module.scss";
import { makeDiv, makeH2, makeP } from "named-components";

export const Component = () => {
  return (
    <Container>
      {/* You may pass additional classes */}
      <Title className={isDarkMode && styles.dark}>Some Title</Title>

      <Text className={isDarkMode && styles.dark}>Some Text</Text>
    </Container>
  );
};

const Container = makeDiv(styles.container);

const Title = makeH2(styles.title);

const Text = makeP(styles.text);
```

---
_Source: https://npm.io/package/named-components · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
