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-search

v1.0.18

Published

Компонент поискового поля — три размера, фон, рамка состояния, состояния loading и disabled, слот для действия внутри поля.

Readme

Search

@cloud-ru/ds-search — Компонент поискового поля — три размера, фон, рамка состояния, состояния loading и disabled, слот для действия внутри поля.

Поисковое поле дизайн-системы: <input type='search'> с иконкой, опциональной кнопкой очистки, состоянием loading и слотом afterContent внутри поля — под дополнительное действие («Найти», «Фильтр»).

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

  • Основной поиск по списку / каталогу / таблице.
  • Header-поиск с моментальной отдачей (live search).
  • Форма поиска с явной кнопкой «Найти» (afterContent).

Когда не подходит: для выбора из фиксированного списка используйте Combobox, для фильтра с префиксом — Input + Chip.

Анатомия

Size (default m)

Высота поля:

  • s — компактный (списки, тулбары).
  • m — дефолт.
  • l — для крупных форм и посадочных страниц.

AfterContent

Слот внутри поля, справа от строки ввода и кнопки очистки. Пустой по умолчанию: слот появляется тогда, когда в него передана нода.

Типовое наполнение — иконочная кнопка того же размера, что поле:

<Search size='m' afterContent={<Button size='m' view='function' appearance='neutral' icon={<SearchSVG />} onClick={submit} />} />

Размер содержимого слот не навязывает — задавайте его тем же значением, что и size поля.

Outline (default true)

Рамка состояния вокруг поля. false — поле без рамки (например, поиск внутри выпадающего списка, где рамку даёт контейнер).

Установка

pnpm add @cloud-ru/ds-search
import { Search } from '@cloud-ru/ds-search'

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

Базовое поле

import { Search } from '@cloud-ru/ds-search';
import { useState } from 'react';

export function Basic() {
  const [value, setValue] = useState('');
  return <Search placeholder='Поиск' value={value} onChange={setValue} />;
}

Размер l для hero

import { Search } from '@cloud-ru/ds-search';

export function SizeL() {
  return <Search size='l' placeholder='Поиск по каталогу' />;
}

Loading

import { Search } from '@cloud-ru/ds-search';

export function Loading() {
  return <Search placeholder='Поиск' loading />;
}

Disabled

import { Search } from '@cloud-ru/ds-search';

export function Disabled() {
  return <Search placeholder='Поиск' disabled />;
}

Без фона

import { Search } from '@cloud-ru/ds-search';

export function TransparentBackground() {
  return <Search placeholder='Прозрачный фон' background={false} />;
}

Действие в слоте afterContent

import { APPEARANCE, Button, VIEW } from '@cloud-ru/ds-button';
import { PlaceholderSVG } from '@cloud-ru/ds-icons/interface/system';
import { Search } from '@cloud-ru/ds-search';
import { useState } from 'react';

export function WithAfterContent() {
  const [value, setValue] = useState('');
  const [submitted, setSubmitted] = useState('');

  return (
    <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', alignItems: 'center' }}>
      <Search
        size='m'
        placeholder='Поиск'
        value={value}
        onChange={setValue}
        onSubmit={setSubmitted}
        afterContent={
          <Button
            size='m'
            view={VIEW.Function}
            appearance={APPEARANCE.Neutral}
            icon={<PlaceholderSVG />}
            minWidth={false}
            onClick={() => setSubmitted(value)}
          />
        }
      />
      <span>Запрос: {submitted || '—'}</span>
    </div>
  );
}

Props

SearchProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | afterContent | ReactNode | — | Слот справа от строки ввода — после кнопки очистки, внутри поля. Типовое наполнение — иконочная кнопка того же размера, что поле: <Button size={size} view='function' appearance='neutral' icon={…} />. | | background | boolean | true | Наличие фона | | className | string | — | CSS-класс | | data-test-id | string | — | | | disabled | boolean | — | Деактивирован ли компонент | | inputMode | "decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | — | Режим работы экранной клавиатуры | | loading | boolean | — | Состояние загрузки | | onBlur | FocusEventHandler<HTMLInputElement> | — | Колбек обработки потери фокуса | | onChange | ((value: string, e?: ChangeEvent<HTMLInputElement>) => void) | — | Колбек смены значения | | onFocus | FocusEventHandler<HTMLInputElement> | — | Колбек обработки получения фокуса | | onSubmit | ((value: string) => void) | — | Колбек на подтверждение поиска по строке | | outline | boolean | true | Наличие рамки состояния вокруг поля | | placeholder | string | — | Значение плейсхолдера | | showClearButton | boolean | true | Отображение кнопки Очистки поля | | size | "l" | "m" | "s" | m | Размер | | tabIndex | number | — | | | value | string | — | Значение input |