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

use-antd-filter

v0.1.3

Published

一个基于 React 和 Ant Design 的灵活筛选表单 Hook

Readme

useFilter

npm version GitHub license Documentation

一个基于 React 和 Ant Design 的灵活筛选表单 component,用于快速构建具有展开/收起功能的响应式筛选界面。

📚 文档

查看在线文档和示例

✨ 特性

  • �� 支持展开/收起功能
  • 🔄 响应式布局
  • 📦 开箱即用
  • 🎨 基于 Ant Design
  • 💡 TypeScript 支持
  • ⚡️ 轻量级设计

📦 安装

npm install use-antd-filter
# 或
yarn add use-antd-filter

🔨 使用

import { FilterForm } from 'use-antd-filter';
const handleFilterChange = (filters: Record<string, string>) => {
  console.log('Filters changed:', filters);
};
const filters: IFilters = [
    {
        label: '账单时间',
        name: 'time',
        renderType: 'dateRangePicker',
        props: {
            placeholder: ['开始时间', '结束时间'],
        },
    },
    { 
        label: '所属问题',
        name: 'data_type_desc',
        renderType: 'select',
        props: {
            options: [{ label: '问题1', value: '1' }, { label: '问题2', value: '2' }],
            showSearch: true,
        },
    },
    {
        label: '申请单号',
        name: 'ids',
        renderType: 'input',
        props: {
            placeholder: '支持空格或英文逗号分隔批量查询',
        },
    },
    {
        label: '状态',
        name: 'statusList',
        renderType: 'select',
        props: {
            options: [
                { value: '0', label: '暂存' },
                { value: '1', label: '询价中' },
                { value: '2', label: '审批中' },
                { value: '3', label: '下架中' },
                { value: '4', label: '出库中' },
                { value: '5', label: '运输中' },
                { value: '6', label: '已完成' },
                { value: '7', label: '已中止' },
            ],
            placeholder: '支持多选',
            mode: 'multiple',
            showSearch: true,
            optionFilterProp: "label"
        },
    },
    {
        label: '单号',
        name: 'code',
        renderType: 'input',
        props: {
            placeholder: '支持空格或英文逗号分隔批量查询',
        },
    },
];
// 或使用内置组件
const YourPage = () => {
  return (
     <FilterForm
       filters={filters}  onFilterChange={handleFilterChange}
    />
  );
};

📖 API

FilterForm

| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | filters | 筛选项的集合 | [] | [] | | defaultExpanded | 是否默认展开 | boolean | false | | onFilterChange | 筛选条件变化时的回调 | (filters: Record<string, string>) => void | - | | onOkText | 查询按钮文字 | string | 查询 | | onResetText | 重置按钮文字 | string | 清空 |

📄 许可证

MIT