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

@zen-void/form-core

v1.0.7

Published

Form component extracted from ant-design-mobile

Readme

@cyber-zen/form-core

A comprehensive form solution for React applications, extracted and optimized from ant-design-mobile. Provides powerful form validation, flexible layouts, and excellent TypeScript support.

✨ Features

  • 🚀 Lightweight & Fast: Optimized bundle size with tree-shaking support
  • 🎯 Rich Components: Form, FormItem, List, Popover, and more
  • 🔧 TypeScript First: Full TypeScript support with comprehensive type definitions
  • 📱 Mobile Optimized: Designed for mobile applications with touch-friendly interactions
  • 🎨 Highly Customizable: Easy to customize styles, themes, and behaviors
  • 🌍 Internationalization: Built-in i18n support with multiple locales
  • Accessibility: ARIA attributes and keyboard navigation support

📦 Installation

# npm
npm install @cyber-zen/form-core

# yarn
yarn add @cyber-zen/form-core

# pnpm
pnpm add @cyber-zen/form-core

🚀 Quick Start

Basic Form Usage

import React from 'react';
import { Form, FormItem } from '@cyber-zen/form-core';
import '@cyber-zen/form-core/style';

const LoginForm = () => {
  const [form] = Form.useForm();

  const onFinish = (values: any) => {
    console.log('Form submitted:', values);
  };

  return (
    <Form form={form} onFinish={onFinish}>
      <FormItem
        name="username"
        label="Username"
        rules={[{ required: true, message: 'Please input username!' }]}
      >
        <input placeholder="Enter your username" />
      </FormItem>
      
      <FormItem
        name="password"
        label="Password"
        rules={[{ required: true, message: 'Please input password!' }]}
      >
        <input type="password" placeholder="Enter your password" />
      </FormItem>
      
      <button type="submit">Login</button>
    </Form>
  );
};

Advanced Form with Validation

import React from 'react';
import { Form, FormItem, List, ListItem } from '@cyber-zen/form-core';

const RegistrationForm = () => {
  const [form] = Form.useForm();

  return (
    <Form form={form} layout="vertical">
      <List>
        <ListItem>
          <FormItem
            name="email"
            label="Email Address"
            rules={[
              { required: true, message: 'Email is required!' },
              { type: 'email', message: 'Please enter a valid email!' }
            ]}
          >
            <input type="email" placeholder="[email protected]" />
          </FormItem>
        </ListItem>
        
        <ListItem>
          <FormItem
            name="phone"
            label="Phone Number"
            rules={[
              { required: true, message: 'Phone number is required!' },
              { pattern: /^1[3-9]\d{9}$/, message: 'Please enter a valid phone number!' }
            ]}
          >
            <input placeholder="13800138000" />
          </FormItem>
        </ListItem>
        
        <ListItem>
          <FormItem
            name="age"
            label="Age"
            rules={[
              { required: true, message: 'Age is required!' },
              { type: 'number', min: 18, message: 'Must be at least 18 years old!' }
            ]}
          >
            <input type="number" placeholder="25" />
          </FormItem>
        </ListItem>
      </List>
    </Form>
  );
};

Using Popover Component

import React from 'react';
import { Popover, PopoverMenu } from '@cyber-zen/form-core';

const PopoverExample = () => {
  const [visible, setVisible] = React.useState(false);

  return (
    <Popover
      visible={visible}
      onVisibleChange={setVisible}
      content={
        <PopoverMenu
          actions={[
            { text: 'Option 1', key: '1' },
            { text: 'Option 2', key: '2' },
            { text: 'Option 3', key: '3' }
          ]}
          onAction={(action) => {
            console.log('Selected:', action);
            setVisible(false);
          }}
        />
      }
    >
      <button>Click to show menu</button>
    </Popover>
  );
};

📚 API Reference

Form Component

| Property | Type | Default | Description | |----------|------|---------|-------------| | form | FormInstance | - | Form instance created by Form.useForm() | | layout | 'horizontal' \| 'vertical' | 'horizontal' | Form layout direction | | onFinish | (values: any) => void | - | Callback when form is successfully submitted | | onFinishFailed | (errorInfo: any) => void | - | Callback when form submission fails | | initialValues | object | - | Initial form values | | validateTrigger | string \| string[] | 'onChange' | When to validate form fields |

FormItem Component

| Property | Type | Default | Description | |----------|------|---------|-------------| | name | string | - | Field name for form data binding | | label | ReactNode | - | Field label text | | rules | Rule[] | - | Validation rules array | | required | boolean | false | Whether field is required | | validateTrigger | string \| string[] | - | When to validate this field | | help | ReactNode | - | Additional help text | | extra | ReactNode | - | Extra content below field |

List & ListItem Components

| Property | Type | Default | Description | |----------|------|---------|-------------| | header | ReactNode | - | List header content | | mode | 'default' \| 'card' | 'default' | List display mode | | children | ReactNode | - | List items |

Popover Component

| Property | Type | Default | Description | |----------|------|---------|-------------| | visible | boolean | false | Whether popover is visible | | content | ReactNode | - | Popover content | | placement | Placement | 'top' | Popover placement | | onVisibleChange | (visible: boolean) => void | - | Visibility change callback |

🛠️ Development

# Install dependencies
npm install

# Start development mode with watch
npm run dev

# Build for production
npm run build

# Run tests
npm test

# Run linting
npm run lint

# Type checking
npm run type-check

# Clean build directory
npm run clean

📦 Build & Publish

# Quick publish (latest tag)
npm run publish

# Publish beta version
npm run publish:beta

# Publish alpha version
npm run publish:alpha

# Full release with version bump (patch)
npm run release

🤝 Contributing

We welcome contributions! Please see our contributing guidelines for details.

📄 License

MIT License - see the LICENSE file for details.