UNPKG

pkui-designs

Version:
107 lines (95 loc) 2.97 kB
# pkui-designs > Data grid with virtualization and lazy loading > Autocomplete/typeahead > Input Fields > Checkboxes > RadioButton > Switches [![NPM](https://img.shields.io/npm/v/pkui-designs.svg)](https://www.npmjs.com/package/pkui-designs) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) ## Install ```bash npm install --save pkui-designs ``` ```bash yarn add pkui-designs ``` ## Usage ```jsx import React, { Component } from 'react' import { Grid, AutoComplete, Select, Input, CheckBox, RadioButton, Switch } from 'pkui-designs' class App extends Component { render () { return ( <Grid data={[]} // actual row data headers={[]} // columns id={'pkgrid'} // unique identifier height={540} // height of the container hasMore={hasMore} // if grid has more data to load -- boolean loadMore={() => {}} // lazy loading function showLazyLoader={showLazyLoader} // show rows loader -- boolean loading={loading} // show grid loader -- boolean serverSorting={true} // enable api call serverFiltering={true} // enable api call onFilter={filters => {}} // filter function onSort={sort => {}} // sort function onRowClick={row => {}} // on row click function rowHeight={34} // default 34 autoFitColumn={true} // if columns to be fit into the provided width /> <AutoComplete dataSource={[]} multiple={false} id={'single'} onRemove={() => {}} onChange={selected => {}} onSelect={(value, selected) => {}} onInputChange={(e, value) => {}} placeholder={'Select country...'} defaultFirstOptionSelected={true} openDropDownOnFocus={false} isAsync={true} loading={false} value={''} open={true} selectOnBlur={false} animate={true||false} /> <Select dataSource={[]} placeHolder={''} selected={anyof('', {})} onSelect={selected => {}} id={'id'} animate={true||false} /> <Input placeholder='Enter user name' label='Enter user name' showClear={true} onChange={e => {}} value={''} /> <CheckBox label={'label text'} checked={true||false} disabled={true||false} onChange={checked => {}} name={'checkboxname'} /> <RadioButton options={[{ label: 'Label', value: 'label' }]} selected={selectedValue} onChange={selected => {}} /> <Switch checked={true||false} disabled={true||false} onChange={checked => {}} /> ) } } ``` ## License MIT © [PrabhuKathiresan](https://github.com/PrabhuKathiresan)