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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rc-input-modern

v1.5.1

Published

React input component

Downloads

9

Readme

rc-input ⌨️

NPM version npm download dumi build status Codecov Dependencies DevDependencies bundle size

Install

rc-input

Usage

import Input from 'rc-input';
import { render } from 'react-dom';

render(<Input placeholder="input" allowClear />, mountNode);

API

| Property | Type | Default | Description | | --------------------- | ---------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | prefixCls | string | rc-input | | | className | string | '' | additional class name of input | | style | React.CSSProperties | | style properties of input | | affixWrapperClassName | string | - | className with 'rc-input-affix-wrapper' | | groupClassName | string | - | className with 'rc-input-group-wrapper' | | wrapperClassName | string | - | className with 'rc-input-wrapper' | | addonAfter | ReactNode | - | The label text displayed after (on the right side of) the input field | | addonBefore | ReactNode | - | The label text displayed before (on the left side of) the input field | | allowClear | boolean | { clearIcon: ReactNode } | false | If allow to remove input content with clear icon | | bordered | boolean | true | Whether has border style | | defaultValue | string | - | The initial input content | | disabled | boolean | false | Whether the input is disabled | | id | string | - | The ID for input | | maxLength | number | - | The max length | | showCount | boolean | { formatter: ({ value: string, count: number, maxLength?: number }) => ReactNode } | false | Whether show text count | | prefix | ReactNode | - | The prefix icon for the Input | | suffix | ReactNode | - | The suffix icon for the Input | | type | string | text | The type of input, see: MDN( use Input.TextArea instead of type="textarea") | | value | string | - | The input content value | | onChange | function(e) | - | Callback when user input | | onPressEnter | function(e) | - | The callback function that is triggered when Enter key is pressed |

inputRef

const inputRef = useRef(null);

useEffect(() => {
  inputRef.current.focus();// the input will get focus
  inputRef.current.blur();// the input will lose focus
  console.log(inputRef.current.input);// The origin input element
}, []);
// ....
<Input ref={inputRef} />

| Property | Type | Description | | -------- | --------------------------------------- | --------------------------------- | | focus | (options?: InputFocusOptions) => void | The input get focus when called | | blur | () => void | The input loses focus when called | | input | HTMLInputElement \| null | The origin input element |

Development

npm install
npm start

License

rc-input is released under the MIT license.