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

uxcore-checkbox-group

v1.4.6

Published

uxcore-checkbox-group component for uxcore.

Downloads

63

Readme


uxcore-checkbox-group Dependency Status devDependency Status

TL;DR

uxcore-checkbox-group ui component for react ES5 support needed(like es5-shim)

setup develop environment

$ git clone https://github.com/uxcore/uxcore-checkbox-group
$ cd uxcore-checkbox-group
$ npm install
$ gulp server

Usage

let classnames = require('classnames');

let CheckboxGroup = require('../src');
let Item = CheckboxGroup.Item

class Demo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            value: ["air"]
        }
    }

    handleChange(value) {
        this.setState({
            value: value
        })
    }

    render() {
        return (
            <div>
                <CheckboxGroup onChange={this.handleChange.bind(this)} value={this.state.value}>
                    <Item text="天空天空天空" value="air"
                        addon={
                        <Popover overlay={<div>提示</div>}>
                            <i className='kuma-icon kuma-icon-caution' style={{color: 'blue', fontSize: '12px', 'marginLeft': '3px'}} />
                        </Popover>
                        }
                    />
                    <Item text="<b>大海大海大海</b>" value="sea"/>
                    <Item text="陆地陆地陆地" value="land"/>
                    <Item text="飞机飞机飞机" value="plane"/>
                    <Item text="火车飞机飞机" value="train"/>

                </CheckboxGroup>
            </div>
        );
    }
};

module.exports = Demo;

demo

http://uxcore.github.io/

API

Props

CheckboxGroup

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 | |---|---|---|---|---| |value|array|required|[]|由 value 组成地数组,与 React 受限组件表现一致,选中项与 value 保持一致,数组中的值与 item 的 value 相对应| |onChange|function|required|-|与 React 受限组件表现一致,在 checkbox 群发生改变时触发,借此来更改 value| |disabled|boolean|optional|false|是否为 disable 状态|

CheckboxItem

通过 CheckboxGroup.Item 取得。

| 配置项 | 类型 | 必填 | 默认值 | 功能/备注 | |---|---|---|---|---| |text|string|optinal|-|checkbox 后面跟着的说明文字| |value|string|required|-|checkbox 对应的值| |disabled|boolean|optional|-|Item 是否为 disable 状态,具有比 Group 更高的优先级| |addons|jsx|optional|-|显示在label后面的添加项,可以用作checkbox的tips|