npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cloud-ru/ds-counter

v1.0.5

Published

Компактный счётчик для отображения числовых меток, бейджей и состояний.

Readme

Counter

@cloud-ru/ds-counter — Компактный счётчик для отображения числовых меток, бейджей и состояний.

Счётчик — компактный компонент для отображения числовых значений внутри другой UI-поверхности: кнопок, тегов, пунктов меню, навигации.

Когда использовать

  • Количество непрочитанных уведомлений у иконки колокольчика.
  • Количество элементов в корзине или списке.
  • Бейдж на табе / пункте меню.

Когда не нужен Counter: для крупных числовых метрик используйте Typography, для статусов — Tag.

Анатомия

Appearance (default primary)

Цветовая схема счётчика. Значение совпадает с именем семантической палитры темы:

  • primary — акцентный (непрочитанные, новые).
  • neutral — нейтральный.
  • red — ошибки, срочные элементы.
  • orange — предупреждения.
  • yellow — внимание.
  • green — успех, положительный статус.
  • blue — информационный.
  • violet — дополнительный акцент.
  • pink — дополнительный акцент.

Variant

Формат отображения числа: count — число как есть, count-plus — сокращение с плюсом после лимита (10+, 99+), count-k — сокращение в тысячах (1K, 12K).

Size

Размер бейджа: xs — на иконках/мелких элементах, s — дефолт в табах и пунктах меню.

Role appearance (default accent)

Роль, в которой применяется выбранный appearance:

  • accent — насыщенная заливка, основной токен appearance.
  • decor — декоративная подложка, визуально более мягкий бейдж.

Установка

pnpm add @cloud-ru/ds-counter
import { Counter, APPEARANCE, VARIANT, SIZE } from '@cloud-ru/ds-counter'

Примеры использования

Обычное число

import { Counter } from '@cloud-ru/ds-counter';

export function Basic() {
  return <Counter value={9} />;
}

С порогом 10+

import { Counter } from '@cloud-ru/ds-counter';

export function PlusThreshold() {
  return <Counter value={42} variant='count-plus' plusLimit={10} />;
}

Тысячи как K

import { Counter } from '@cloud-ru/ds-counter';

export function ThousandsK() {
  return <Counter value={2500} variant='count-k' />;
}

Red — ошибки и срочные элементы

import { Counter } from '@cloud-ru/ds-counter';

export function Red() {
  return <Counter value={3} appearance='red' />;
}

Props

CounterProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | appearance | "blue" | "green" | "neutral" | "orange" | "pink" | "primary" | "red" | "violet" | "yellow" | primary | Внешний вид | | className | string | — | Дополнительный CSS-класс | | data-test-id | string | — | | | innerRef | Ref<HTMLDivElement> | — | Ref на корневой DOM-элемент. Используем явный проп, чтобы не зависеть от forwardRef и не тащить type-assertions на экспорт. | | plusLimit | number | 10 | Порог сокращения значения для варианта count-plus | | roleAppearance | "accent" | "decor" | accent | Роль, в которой применяется appearance: акцентная заливка или декоративная | | size | "s" | "xs" | s | Размер | | value | number | — | Значение | | variant | "count" | "count-k" | "count-plus" | count | Вариант форматирования |

Related types

  • Appearance = "blue" | "green" | "neutral" | "orange" | "pink" | "primary" | "red" | "violet" | "yellow"

  • RoleAppearance = "accent" | "decor"

  • Size = "s" | "xs"

  • Variant = "count" | "count-k" | "count-plus"