Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

search-bar

v1.0.9arrow_drop_down
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
STATUS
Passing
DOWNLOADS
81
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 months ago
SIZE
8 KB
Renders a search field and takes the size of the container.
1 contributor
Use search-bar in your project ?
Copied
npm i @bit/lekanmedia.shared-ui.search-bar
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
revert changes
reload
toggle layout
maximize
modifieddraft
modifieddraft
chevron_left
chevron_right
SearchBar (
props.className:string,
props.done:boolean,
props.placeholder:string,
props.children:JSX.Element,
props.onSearch:function,
props.cancelSearch:function
) : JSX.Element

Renders a search field and takes the size of the container.

Arguments
props.className: string

The default class of the search-bar.

props.done: boolean

Accepts a boolean value to set the ongoing search as completed.

props.placeholder: string

Placeholder text for the search bar.

props.children: JSX.Element

React Elements

props.onSearch: function

A function to collect the search text.

props.cancelSearch: function

A function to cancel an ongoing search.

Returns
JSX.Element

A search input with a spinner component.

LongSearchButton (
props.className:string,
props.addClass:string,
props.width:number,
props.height:number,
props.text:string,
props.textStyle:object,
props.iconStyle:object,
props.onClick:function
) : JSX.Element

Renders an icon and a text into an PrimaryButton.

Arguments
props.className: string

The default class of the button.

props.addClass: string

Add extra class styles to overwrite default class.

props.width: number

Width of the button.

props.height: number

Height of the button.

props.text: string

Text for the button.

props.textStyle: object

Style Inline CSS styles for the button text.

props.iconStyle: object

Style Inline CSS styles for icon.

props.onClick: function

onclick event function of the button.

Returns
JSX.Element

A `TextIconButton` with an _search_ icon and _Search_ text.