New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

jb-select-react

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jb-select-react

select react component

latest
Source
npmnpm
Version
5.0.1
Version published
Weekly downloads
17
750%
Maintainers
0
Weekly downloads
 
Created
Source

jb-select-react

[!WARNING]
this package is deprecated and moved to jb-select/react

select component for react

installation

run npm install jb-select-react to install package with npm

usage

use below syntax in your render function.

<JBSelect></JBSelect>

label

use label property to describe your select component.

<JBSelect label='your label name' ></JBSelect>

option value

set an array object. example:

render(){
    const obj = [{name:'reza',family:'asadi',userId:1},{name:'peter',family:'peterson',userId:2}];
    getOptionTitle:(option)=>{
        return `${option.name} ${option.family}`;
    },
    getOptionValue:(option)=>{
        return option.userId;
    }
    return(
        <JBSelect label='your label name' optionList={obj} getOptionTitle={getOptionTitle} getOptionValue={getOptionValue}></JBSelect>;
    );
}

Add Icon or Any Element into box

sometimes you want to add icon into the select box before value box. you can customize this entire section by adding a div or any other Tag with the slot="start-section"

like the example the below:

<JBSelect>
    <div slot="start-section">
        <img class="your-custom-icon" src="./path/to/file.svg">
    </div>
</JBSelect>

set custom style

in some cases in your project you need to change defualt style of the component for example you need zero margin or different border-radius and etc.
if you want to set a custom style to this component all you need is to set css variable.

css variable namedescription
--jb-select-marginweb-component margin default is 0 0
--jb-select-widthchange the select component width default is 100%
--jb-select-border-radiusweb-component border-radius defualt is 16px
--jb-select-border-colorborder color of select in normal mode
--jb-select-border-color-selectedborder color when user select a value from list
--jb-select-bgcolorbackground color of input
--jb-select-overlay-bgcolorbackground of select overlay when open in mobile and tablet screen
--jb-select-list-max-heightmax height of option list
--jb-select-border-bottom-widthwidth of border bottom
--jb-select-border-widthwidth of border
--jb-select-label-colorcolor of label default is #1f1735
--jb-input-label-font-sizelabel font size default is 0.8em
--jb-input-label-font-weightcolor of label defualt is #1f1735
--jb-select-option-colorchange option text color
--jb-select-option-color-hoverchange option text color on hover
--jb-select-option-background-colorbackground of options default is transparent
--jb-select-option-background-color-hoverbackground of options on mouse hover default is #1073db
--jb-select-input-colorcolor of input value
--jb-select-bgcolor-selectedset background color for selected status
--jb-select-selected-value-colorselected value text color default is #1f1735
--jb-select-selected-value-font-sizefont-size of selected value default is 1.1rem
--jb-select-message-colormessage text color default is #929292
--jb-select-message-font-sizefont size of message default is 0.7em
--jb-select-message-font-weightfont weight of message box default is normal
--jb-select-placeholder-colorplaceholder color default is initial
--jb-select-placeholder-font-sizeplaceholder font-size default is 1.1em
--jb-select-heightjb-select box height
--jb-select-mobile-search-input-heightwhen user open select on mobile there is a search box input this var will set its height
--jb-select-mobile-item-list-marginwhen user open select on mobile there is gap between search box & list that can be customized
--jb-select-list-paddingpadding of opened list box default is 16px 0
--jb-select-close-bg-colorclose button bg-color default is #1f1735
--jb-select-close-x-colorclose button x color default is #fff
--jb-select-close-bg-opacityclose button bg opacity default is 0.4
--jb-select-mobile-input-bgcolorbackground color search input when open in mobile
--jb-select-mobile-search-border-widthwhen user open select on mobile, search box can have its own border width config
--jb-select-mobile-search-border-colorwhen user open select on mobile, search box can have its own border color config
--jb-select-mobile-search-border-bottom-widthwhen user open select on mobile, search box can have its own border bottom width config
--jb-select-mobile-search-border-bottom-colorwhen user open select on mobile, search box can have its own border bottom color config
--jb-select-mobile-search-border-radiuswhen user open select on mobile, search box can have its own border radius
--jb-select-middle-div-heightseparator line between input and list default is 0px and hidden but you can cahange it
--jb-select-middle-div-colorchange separator line color
--jb-select-middle-div-marginchange seprator line margin
--jb-select-middle-div-mobile-marginchange separator line margin in mobile modal
--jb-select-middle-div-radiuschange separator line border-radius
--jb-select-list-scroll-colorlist item scroll color default is #c3c3c3
--jb-select-list-scroll-border-radiuslist item scroll border-radius default is 4px
--jb-select-select-box-marginmargin of internal element called select box that wrapper display element of form in one box

Keywords

jb

FAQs

Package last updated on 26 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts