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

@wines/search-bar

v2.0.0

Published

The search-bar @wines

Readme

@wines/search-bar

SearchBar 搜索栏

用于展现搜索栏,提醒用户输入相关内容进行搜索。

使用指南

在 page.json 中引入组件

{
  "navigationBarTitleText": "SearchBar",
  "usingComponents": {
    "wux-search-bar": "@wines/search-bar"
  }
}

示例

<view class="page">
	<view class="page__hd">
		<view class="page__title">SearchBar</view>
		<view class="page__desc">搜索栏</view>
	</view>
	<view class="page__bd">
		<view class="sub-title">Normal</view>
		<wux-search-bar clear maxlength="8" />
		<view class="sub-title">Focus</view>
		<wux-search-bar clear focus />
		<view class="sub-title">Show cancel button</view>
		<wux-search-bar
		 clear
		 show-cancel
		 value="{{ value }}"
		 controlled
		 placeholder="Search"
		 bind:change="onChange"
		 bind:focus="onFocus"
		 bind:blur="onBlur"
		 bind:confirm="onConfirm"
		 bind:clear="onClear"
		 bind:cancel="onCancel"
		/>
	</view>
</view>

import './index.less';

Page({
  data: {
    value: '',
  },
  onChange(e) {
    console.log('onChange', e);
    this.setData({
      value: e.detail.value,
    });
  },
  onFocus(e) {
    console.log('onFocus', e);
  },
  onBlur(e) {
    console.log('onBlur', e);
  },
  onConfirm(e) {
    console.log('onConfirm', e);
  },
  onClear(e) {
    console.log('onClear', e);
    this.setData({
      value: '',
    });
  },
  onCancel(e) {
    console.log('onCancel', e);
  },
});

API

SearchBar props

| 参数 | 类型 | 描述 | 默认值 | | ----------------- | --------------- | --------------------------------------------------------- | ----------------- | | prefixCls | string | 自定义类名前缀 | wux-search-bar | | defaultValue | string | 输入框的默认值,当 controlledfalse 时才生效 | - | | value | string | 输入框的当前值,当 controlledtrue 时才生效 | - | | controlled | boolean | 是否受控 说明文档 | false | | placeholder | string | 输入框为空时占位符 | - | | placeholder-style | string,object | 指定 placeholder 的样式 | - | | placeholder-class | string | 指定 placeholder 的样式类 | input-placeholder | | disabled | boolean | 是否禁用 | false | | maxlength | number | 最大输入长度,设置为 -1 的时候不限制最大长度 | 140 | | cursor-spacing | number | 指定光标与键盘的距离,单位 px | 11 | | focus | boolean | 获取焦点 | false | | confirm-type | string | 设置键盘右下角按钮的文字,仅在type='text'时生效 | search | | confirm-hold | boolean | 点击键盘右下角按钮时是否保持键盘不收起 | false | | cursor | number | 指定focus时的光标位置 | -1 | | selection-start | number | 光标起始位置,自动聚集时有效,需与selection-end搭配使用 | -1 | | selection-end | number | 光标结束位置,自动聚集时有效,需与selection-start搭配使用 | -1 | | adjust-position | boolean | 键盘弹起时,是否自动上推页面 | true | | clear | boolean | 是否显示清除图标,当 disabledfalse 时才生效 | false | | cancelText | string | 自定义取消按钮的文字 | 取消 | | showCancel | boolean | 是否一直显示取消按钮 | false | | bind:change | function | 键盘输入时触发 | - | | bind:focus | function | 输入框聚焦时触发 | - | | bind:blur | function | 输入框失去焦点时触发 | - | | bind:confirm | function | 点击完成按钮时触发 | - | | bind:clear | function | 点击清除图标时触发 | - | | bind:cancel | function | 点击取消按钮时触发 | - |

SearchBar externalClasses

| 名称 | 描述 | | --------- | ------------ | | wux-class | 根节点样式类 |