All Projects โ†’ kadetXx โ†’ insect

kadetXx / insect

Licence: MIT license
๐Ÿ›  Highly customisable, minimalistic input x select field for React.

Programming Languages

typescript
32286 projects
SCSS
7915 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to insect

react-multi-select-component
Lightweight (~5KB gzipped) multiple selection dropdown component
Stars: โœญ 279 (+745.45%)
Mutual labels:  select, dropdown, react-select
Form Js
Easily create web forms. Supports Meteor, AngularJS, React, Polymer and any CSS library, e.g. Bootstrap.
Stars: โœญ 9 (-72.73%)
Mutual labels:  input, forms, dropdown
Jcf
Advanced form elements customization using CSS/JS
Stars: โœญ 203 (+515.15%)
Mutual labels:  select, forms
Ant Plus
๐Ÿ”บ Ant Design ่กจๅ•็ฎ€ๅŒ–็‰ˆ
Stars: โœญ 212 (+542.42%)
Mutual labels:  select, input
React Native Dropdown Picker
A single / multiple, categorizable & searchable item picker (dropdown) component for react native which supports both Android & iOS.
Stars: โœญ 230 (+596.97%)
Mutual labels:  select, dropdown
Vue Treeselect
A multi-select component with nested options support for Vue.js
Stars: โœญ 2,347 (+7012.12%)
Mutual labels:  select, dropdown
Selectize.js
Selectize is the hybrid of a textbox and <select> box. It's jQuery based, and it has autocomplete and native-feeling keyboard navigation; useful for tagging, contact lists, etc.
Stars: โœญ 12,744 (+38518.18%)
Mutual labels:  select, input
React Dropdown Select
Customisable dropdown select for react
Stars: โœญ 227 (+587.88%)
Mutual labels:  select, dropdown
React Multi Select
A Multi Select component built with and for React
Stars: โœญ 111 (+236.36%)
Mutual labels:  select, react-component
vue-tags-component
Vue.js 2+ tags component
Stars: โœญ 27 (-18.18%)
Mutual labels:  select, dropdown
react-power-select
A highly composable & reusable select/autocomplete components
Stars: โœญ 63 (+90.91%)
Mutual labels:  react-component, react-select
tagselector
Dependency-free JS library that turns select fields in customizable tag clouds
Stars: โœญ 19 (-42.42%)
Mutual labels:  select, dropdown
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: โœญ 179 (+442.42%)
Mutual labels:  select, dropdown
React Ds
๐Ÿ”ฅ React Drag To Select component (tiny, touch friendly, and no dependencies!)
Stars: โœญ 153 (+363.64%)
Mutual labels:  select, react-component
Vue Cool Select
Select with autocomplete, slots, bootstrap and material design themes.
Stars: โœญ 195 (+490.91%)
Mutual labels:  select, input
React Select Me
Fast ๐Ÿ†. Lightweight ๐Ÿœ. Configurable ๐Ÿ™. Easy to use ๐Ÿฆ„. Give it a shot ๐Ÿ‘‰๐Ÿผ
Stars: โœญ 119 (+260.61%)
Mutual labels:  select, dropdown
Angular2 Multiselect Dropdown
Angular 2 Dropdown Multiselect
Stars: โœญ 225 (+581.82%)
Mutual labels:  select, dropdown
choc-autocomplete
๐Ÿ‡ Autocomplete Component Package for Chakra UI
Stars: โœญ 286 (+766.67%)
Mutual labels:  select, dropdown
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: โœญ 100 (+203.03%)
Mutual labels:  select, input
Jhform
JhForm - ่‡ชๅฎšไน‰่กจๅ•ๅทฅๅ…ท,ๆ›ดๅŠ ็ฎ€ๅ•,ๅฟซๆท็š„ๅˆ›ๅปบ่กจๅ•ใ€่ฎพ็ฝฎ้กต้ข
Stars: โœญ 108 (+227.27%)
Mutual labels:  select, input

Insect



insect logo

๐Ÿ›  Highly customisable, minimalistic input x select field for React.

Package version. Make a pull request.


โšก๏ธ Features

  • Tiny size (~4kb Gzip)
  • 100% responsive.
  • Highly customisable.
  • Supports custom rem unit.
  • Zero third party dependency (asides react's recommended prop-types).
  • Typescript ready
  • Multi select options
  • Options search
  • Custom icons support


๐Ÿ’พ Installation

$ yarn add react-insect


๐Ÿ“„ Basic Usage

// Import Insect component
import { Insect } from 'react-insect';

// Use it in your code like so
export const MyComponent = () => {
  return (
    <>
      <Insect
        name="username"
        type="text"
        placeholder="Choose a username"
      />
    </>
  );
};


๐Ÿช„ Props

Insect can be either an input field, a single select field or a multi select field. The props passed in determines what Insect is. Here's a table of all available props for input and for select.



๐Ÿงฉ General props

Prop Description Type default
name Sets the name of the input field. string
type Sets type of input field text | textarea | number | password | email | select text
label Adds a label to the top of insect component. string
placeholder Sets the placeholder for insect component. string Input or select an option
prefixIcon Adds an icon at the left of insect field string | React.ReactNode | null
suffixIcon Adds an icon at the right of insect field string | React.ReactNode | null
className Custom classname for main insect container string
labelClass Custom classname for insect label string
inputWrapperClass Custom classname for the input field wrapper div string
inputClass Custom classname for the main input field string
iconsClass Custom classname for all icons string
onFocus Function to trigger when input field is focused on. (e: React.FocusEvent<HTMLInputElement>) => void
onBlur Function to trigger when input field goes out of focus. (e: React.FocusEvent<HTMLInputElement>) => void


๐Ÿ For Input field type

Prop Description Type default
value Sets the value of the input field. string
rows Sets the number of rows for textarea number
onChange Function to trigger when input field value is changed. (e: React.FormEvent<HTMLInputElement>) => void


๐Ÿ”ฎ For Select field type

Prop Description Type default
allowMultiple Enables multi select by setting the number of selectable items number
search Toggles option search boolean (false)
options A list of options for the select field { title: string; value: string; }[] [ ]
onSelect Funtion to trigger when an item is selected. It returns the field name and then returns a single string for single select and an array of strings for multi select (value: string | string[] | null, name: string) => void
dropdownIcon Custom icon for dropdown caret string | React.ReactNode | null
checkmarkIcon Custom selected item indicator icon string | React.ReactNode | null
dropdownClass Custom classname for the dropdown container div. This div wraps the ul tag which in turn wraps the individual li tags string
checkerClass Custom classname for the selected items indicator icon string
closeOnBlur Determines if the dropdown should close when outside is clicked or not boolean true


๐Ÿฆ„ Usage with custom PX - REM unit

Sometimes, you may want to set the default rem unit to 10rem/1px (or any value at all) by adding font-size: 10px (or some kind of viewport based value) to the html tag in order to simplify rem/px unit conversion. This will cause a lot of problems with third party components but don't worry, insect got you!

Just add the following css variable to your main stylesheet and insect will adapt to your new unit.

:root {
  --insect-rem: 10 !important;
}


๐Ÿ‘ท๐Ÿฝ Contribution Guide

Insect is an opensource project and public contribution is very welcome. You can check Issues for bugs to fix or features to add.

  1. Fork this repository.
  2. Clone the forked repository to your local machine.
  3. Create a new branch with a name like this - feature/name-of-feature.
  4. Run yarn to install dependencies.
  5. Write code and then commit changes.
  6. Run yarn build to compile a build into the dist folder.
  7. Now You can decide to manually copy the index.tsx and index.scss file from here into a local project in order to test the feature/bug you have fixed.
  8. Alternatively, run yarn link in your local insect root folder.
  9. On the local project you want to test the features on, run yarn link 'insect'.
  10. Now navigate back to the terminal on your local insect folder and then run npm link ../path-to-test-project/node_modules/react. This will make insect use the copy of react from your local test project. Now you can test your changes.
  11. After all is done, push to your forked repository and then send a pull request.


โš–๏ธ Licence

MIT (c) Collins Enebeli.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].