1.2.1 • Published 4 years ago

@zestui/input v1.2.1

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

<zest-input>

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

Installation

npm install @zestui/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, search, tel, url, email, password, date, month, week, time, datetime-local, number, color
labelstring''Label to display for the input.
disabledstring'false'When 'true' input is disabled cannot be interacted with.
requiredstring'false'When 'true' the input field is marked mandatory.
valuestring''Sets the value property of the input. Can be used to set default value
placeholderstring'Enter value'Sets the input placeholder.
autofocusbooleanfalseSets the input autofocus attribute.
patternstring''Sets the input attribute property for validation.
minstring''Sets the input min attribute for number input.
maxstring''Sets the input max attribute for number input.
maxlengthstring''Sets the input maxlength attribute.
themestring'lightWhen 'true', the input will adapt to dark theme.
full-widthstring'false'When 'true', 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.
iconstring'false'When 'true', icon will be displayed before the placeholder.

Examples

Default Input

npm.io

<zest-input></zest-input>

Input with label and value

npm.io npm.io

<zest-input id="name" name="name" label="name" placeholder="Enter your name" value='Jay'></zest-input>

Input with error

npm.io

<zest-input id="error" name="error" label="error" placeholder="Enter your name" error-msg='Name is required'></zest-input>

Disabled Input

npm.io

<zest-input disabled='true' type='text' value="Jayabratha" placeholder="Disabled Input"></zest-input>

<zest-input disabled='true' type='text' placeholder="Disabled Input"></zest-input>

Icon Input

npm.io

<zest-input type='text' icon='true' placeholder="Icon Input">
    <span slot='icon' class='icon'>&hearts;</span>
</zest-input>

Cutomization

npm.io

<zest-input id="custom-input" name="custom" label="Custom Input" placeholder="Enter your name"></zest-input>
#custom-input {
    --color-primary: #1eba68;
    --border-radius: 30px;
    --label-case: normal;
    --label-spacing: 0;
}

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;
1.2.1

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.1

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.1

4 years ago