Customizing Search Component
Search Component is where users can search for stickers with search tags like happy, sad, what!, and more and find stickers they can send on chat. You can think of it like the GIF search engine, but optimized for stickers. The sticker search engine will get you the best results from 150,000+ stickers. By adding a single line of code, you'll be able to add this feature to your app, and customize the UI to make it better.
Before you begin
Make sure you went through all processes in Before You Begin to sign up for stipop dashborad and get API Key, which is reuiqred to complete development of the SDK.
Using Search Component
apikey : Stipop API key for your app.
userId : Unique value for every user to distinguish unique users. The userId can be a string of any format.
React
React
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { SearchComponent } from 'stipop-react-sdk'
const App = () => {
return (
<SearchComponent
params={{
apikey: 'apikey',
userId: 'userId',
}}
/>
)
}
export default App
Next.js
Next.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import dynamic from 'next/dynamic'
const SearchComponent = dynamic(
() => import('stipop-react-sdk/dist/SearchComponent'),
{
ssr: false,
})
const App = () => {
return (
<SearchComponent
params={{
apikey: 'apikey',
userId: 'userId',
}}
/>
)
}
export default App
Customizing Parameters
Name | Type | Description | Required |
---|---|---|---|
apikey | string | Stipop API Key for your app. Visit developer dashboard for new API Key. | Required |
userId | string | Unique value for every user to distinguish unique users. The userId can be in any string format. Important: Using same userId for multiple users is not allowed. | Required |
lang | string | Specify default language for regional stickers. Use a 2-letter ISO 639-1 language code. Default Value: en | Strongly Recommended |
countryCode | string | Specify default country for local stickers. Use a 2-letter ISO 3166-1 country code. Default Value: US | Strongly Recommended |
default | string | Specify default search keyword to show search result when search component is rendered. Default Value: hi | Optional |
limit | int | The maximum number of stickers per page. Use pageNumber accordingly for optimized sticker view. Default Value: 20 (max: 50) | Optional |
pageNumber | int | Specify pageNumber to show limit number of stickers per page. | Optional |
Name | Type | Description | Required |
---|---|---|---|
width | int | Specify search component width. Default Value: 360(px) | Optional |
height | int | Specify search component height. Default Value: 300(px) | Optional |
imgSize | int | Specify search component img size. Default Value: 60(%) | Optional |
Name | Type | Description | Required |
---|---|---|---|
border | string | Specify search component border. Default Value: 1px solid lightgray | Optional |
radius | object | Specify search component border radius. Default Value: {leftTop: 10, rightTop: 10, leftBottom: 10, rightBottom: 10} all : This parameter preferentially applies the same value to all of the corners at once. | Optional |
Name | Type | Description | Required |
---|---|---|---|
width | int | Specify search component input width. Default Value: 100(%) | Optional |
height | int | Specify search component input height. Default Value: 32(px) | Optional |
border | string | Specify search component input border. Default Value: 2px solid lightgray | Optional |
radius | int | Specify search component input border radius. Default Value: 50(px) | Optional |
backgroundColor | string | Specify search component input background color. Default Value: #fff | Optional |
color | string | Specify search component input text color. Default Value: #000 | Optional |
focus | string | Specify search component focused input border and search icon color. Default Value: lightgray | Optional |
search | string | Specify search component input search icon color. Default Value: #d5d5d5 | Optional |
Type | Description | Required |
---|---|---|
string | Specify search component background color. Default Value: #fff | Optional |
Type | Description | Required |
---|---|---|
int | Specify the number of columns in which the search result images are displayed. Default Value: 4 | Optional |
Type | Description | Required |
---|---|---|
boolean | Specify whether scroll is shown or not. Default Value: true | Optional |
Type | Description | Required |
---|---|---|
string | Specify the color of the scroll when mouse hovered over the scroll. Default Value: #6d7072 | Optional |
Type | Description | Required |
---|---|---|
function | Return the sticker URL when the sticker is clicked. - Function signature: stickerClick={(url) => console.log(url)} | Optional |
Type | Description | Required |
---|---|---|
boolean | Specify whether a preview image is shown when a sticker is clicked. Default Value: false | Optional |
Type | Description | Required |
---|---|---|
string | Specify the color of the loading spinner displayed while the sticker is loading. Default Value: #ff4500 | Optional |
Type | Description | Required |
---|---|---|
string | Specify search component shadow effect. Default Value: 0 10px 20px 6px rgba(0, 0, 0, 0.1) | Optional |
Was this page helpful?
We’re here to help. Contact us.