1.0.7 • Published 3 years ago

epic-chip-react-native v1.0.7

Weekly downloads
121
License
MIT
Repository
github
Last release
3 years ago

Epic React Native Chip

npm npm runs with expo

An elegant & fully customizable chip 🚀

Epic Chip React Native


Features

  • 🌟 Full customizable.
  • Smooth & faster animation.
  • Support IOS and, Android.
  • Compatible with Expo.
  • Written in TypeScript.

Getting Started

For npm Type npm i epic-chip-react-native to install it on your project.

For yarn do yarn add epic-chip-react-native.

Important

Please install React Native Vector Icons npm i react-native-vector-icons @types/react-native-vector-icons.

Installation

Use npm or yarn to install the library

NPM: npm i epic-chip-react-native

Yarn: yarn add epic-chip-react-native

import { EpicChip } from 'epic-chip-react-native';

const App = () => {
  return <EpicChip labelOptions={{label: "Epic Chip"}} />;
}

export detault App;

Using Ref

You can also toggle chip using ref hook.

import { EpicChip, EpicChipRef } from 'epic-chip-react-native';

const App = () => {

const EpicChipRef = useRef<EpicChipRef>(null);

  return (
    <>
        <EpicChip 
        ref={EpicChipRef} 
        labelOptions={{label: "Epic Chip"}} 
        onChange={e => console.log(e)} // print boolean;
        />
        
        </View style={{marginVertical: 30}}>
            <Button 
            onPress={()=> EpicChipRef.current?.toggleCheck()}>
            Toggle Chip
            </Button>
        </View> 
        
    </>
  );
}

export detault App;

Props

namedescriptionrequiredtypedefault
labelOptionsChip label options includes label, Icon.NOstring or JSX Element
optionsChip options, chipStyles, labelStyles, backgroundColor, labelColorNOchipStyles: StyleProp<ViewStyle>, labelStyles: StyleProp<TextStyle>, backgroundColor: {focusColor: #hexCode, inActiveColor: #hexCode}, labelColor: {focusColor: #hexCode, inActiveColor: #hexCode}
typeChip typeNOMini, Micro, Large
modeChip mode.NOOutlined, SolidOutlined
checkIconIf you want to hide the checkmark icon, just make it false.NObooleanfalse
radiusBorder Radius of the chip.NOnumber15
isCheckedyou can specify a default value.NOboolean
isDisabledFor disabling the chip`. | NO | 'boolean' | false
checkedIconChanging the default check icon`. | NO | React.ReactNode
onChangeCallback on item changeNO(value: boolean) => void
refref hook toggleCheck() // void functionNO

Author

  • Abdullah Khan
  • Saif Ali Khan

License

MIT

Liked the Component? 😇