1.0.1 • Published 4 years ago

azir-search v1.0.1

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

Azir Framwork : https://azir.io/docs

Search

Azir Search is used to search or filter items. Use Azir Search when the number of items directly impacts a user's ability to find one of them.

Installation

to install the latest version of azir-search you only need to run:

npm install azir-search  --save

or

yarn add azir-search

Examples

Basic With Handlers :

import React, { useState } from "react";
import Search from "azir-search";
---
const [txt, setTxt] = useState("");
---
<Search
  value={txt}
  placeholder={"Search"}
  onChangeText={text => setTxt(text)}
  onFocus={() => console.log("Focused")}
  onCancel={() => console.log("UnFocused")}
  onClear={() => console.log("Cleared")}
  onBlur={() => console.log("UnFocused")}
/>

Advance with Styles :

import React, { useState } from "react";
import Search from "azir-search";
import Icon, {SolidIcons } from "azir-icon";//you need to import solid icons font into your app
---
const [txt, setTxt] = useState("");
---
<Search
  searchStyle={ { padding: 0 } }
  style={ { borderColor: "red", borderLeftWidth: 0, borderTopWidth: 0, borderRightWidth: 0 } }
  endIconStyle={ { color: "red" } }
  color="red"
  value={txt}
  onChangeText={text => setTxt(text)}
  startIcon={<Icon color="red" size={24} icon={SolidIcons.searchLocation}></Icon>}
/>

Advance with Loadingg :

import React, { useState } from "react";
import Search from "azir-search";
import Icon, {SolidIcons } from "azir-icon";//you need to import solid icons font into your app
---
const [txt, setTxt] = useState("");
---
<Search
  searchStyle={ { padding: 0 } }
  value={txt}
  onChangeText={text => setTxt(text)}
  startIconColor="green"
  placeholder={"Search Donuts"}
  startIconSize={50}
  showLoading
  loadingColor="green"
  loadingSize="large"
  startIconStyle={ { color: "green" } }
  endIconStyle={ { color: "green" } }
/>

Props

Azir Search using Azir-input for its seach input so you can also pass all azir-input props.


Reference

value

Set the value of the input text

TypeRequiredDefault
stringNoempty

searchIcon

override the search Icon props, you can use azir-icon to change default icon.

TypeRequiredDefault
stringNoAzirIcons.Search

cancelIcon

override the Cancel Icon props, you can use azir-icon to change default icon.

TypeRequiredDefault
stringNoltr:AzirIcons.ArrowLeft;rtl:AzirIcons.ArrowRight

showCancel

Show or hide Cancel icon..

TypeRequiredDefault
booleanNotrue

clearIcon

override the Clear Icon props, you can use azir-icon to change default icon.

TypeRequiredDefault
stringNoAzirIcons.SearchClear

showClear

Show or hide Clear icon..

TypeRequiredDefault
booleanNotrue

onClear

method to fire when input is cleared

TypeRequired
functionNo

onFocus

method to fire when input is focused

TypeRequired
functionNo

onBlur

method to fire when input is Blured

TypeRequired
functionNo

onChangeText

method to fire when the text input is Changed

TypeRequired
functionNo

onCancel

method to fire when the text input is Canceled

TypeRequired
functionNo

showLoading

Show Activity indicator when the value is true.

TypeRequiredDefault
booleanNofalse

loadingColor

Loading Color of input loading indicator

TypeRequiredDefault
azir-colorNotheme

loadingSize

set the loading Size.

TypeRequiredDefault
("small" , "large" , number)Nosmall

shadow

If true, show shadow effect for this component.

TypeRequiredDefault
boolNofalse

searchStyle

override input Container Style , if you want to change the pdding which is default = 8

TypeRequired
styleNo

startIconStyle

override the start icon style ( ARROW RIGHT , ARROW LEFT)

TypeRequired
styleNo

endIconStyle

override the start icon style ( clear icon)

TypeRequired
styleNo