1.0.4 • Published 3 years ago

@jsdesign/jsd-pin-input v1.0.4

Weekly downloads
5
License
MIT
Repository
-
Last release
3 years ago

<jsd-pin-input>

Simple input web-component to be use accross web irrespective of frameworks.

Installation

npm install @jsdesign/jsd-pin-input

Attributes

NameTypeDefaultDescription
idstring''Sets the id attribute for the input. Preferred when used inside forms.
namestring''Sets the name attribute for the input. Preferred when used inside forms.
typestring'textAllowed input type values: text, password, number
labelstring''Label to display for the input.
disabledstring--When attribute is present, input is disabled cannot be interacted with.
requiredstring--When attribute is present, the input field is marked mandatory.
valuestring''Sets the value property of the input. Can be used to set default value
autofocusstring--Sets the input autofocus attribute.
lengthstring'4'Sets the length pf pin.
themestring'lightWhen attribute is present, the input will adapt to dark theme.
full-widthstring--When attribute is present, the input will take full width of the container. By default the max-width is 300px.
error-msgstring''When error message string is provided, the input will be error themed and error message is displayed.
help-msgstring''When help message string is provided, help message is displayed.

Examples

Default Input

npm.io

<jsd-pin-input></jsd-pin-input>

PIN Input with label and value

npm.io

<jsd-pin-input id="name" name="name" label="name"></jsd-pin-input>

PIN Input with error

npm.io

<jsd-pin-input id="error" name="error" label="error" error-msg='Name is required'></jsd-pin-input>

Full width PIN input

npm.io

<jsd-pin-input id="error" name="error" label="error" full-width error-msg='Name is required'></jsd-pin-input>

Disabled PIN Input

npm.io

<jsd-pin-input label='disabled' disabled type='text' value="1234"></jsd-pin-input>

<jsd-pin-input label='disabled' disabled type='text'></jsd-pin-input>

Cutomizable property list

NameDefault
--color-primary#1eba68;
--color-primary-dark#1ba75e;
--color-secondary#f6f6f6;
--color-secondary-dark#efefef;
--color-secondary-darkthemergba(255, 255, 255, 0.3);
--color-secondary-dark-darkthemergba(255, 255, 255, 0.6);
--color-error#dd4421;
--color-error-background#ffebe6;
--color-placeholder#737373;
--color-placeholder-disabled#e0e0e0;
--color-placeholder-darktheme#e0e0e0;
--color-label#909090;
--color-black#2c2c2c;
--color-header-black#252525;
--color-header-tag#747373;
--color-white#ffffff;
--color-border#edebeb;
--border-radius0.5rem;
--border-width1px;
--border-width-hover3px;
--label-spacing0.2rem;
--label-caseuppercase;
--label-font-size0.8rem;
--button-font-weight500;