1.0.6 • Published 3 years ago

@jsdesign/jsd-radio v1.0.6

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

<jsd-radio>

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

Installation

npm install @jsdesign/jsd-radio

Attributes

NameTypeDefaultDescription
idstring''Sets the id attribute for the radio input. Preferred when used inside forms.
namestring''Sets the name attribute for the input. Preferred when used inside forms.
labelstring''Label to display for the radio input.
disabledboolean--When attribute is present, radio input is disabled cannot be interacted with.
requiredboolean--When attribute is present, the input field is marked mandatory.
listArray[]Creates the radio list based on this attribute. Should be a array of value string.
inlineboolean--When attribute is present, the radio inputs will be aligned inline.
valuestring''Sets the default checked value.
themestring'lightWhen 'dark', the input will adapt to dark theme.
error-msgstring''When error message string is provided, the radio input will be error themed and error message is displayed.

Examples

Default Radio

npm.io

<jsd-radio id='test' name='test' value='Male' label="gender" list='["Male", "Female", "Other"]' onchange='test(event)'></jsd-radio>

Inline Radio

npm.io

<jsd-radio id='gender' inline name='gender' label="gender" value='Male' list='["Male", "Female", "Other"]'></jsd-radio>

Radio with error

npm.io

<jsd-radio id='error' name='error' value='' error-msg="Please select your gender" label="gender" list='["Male", "Female", "Other"]'></jsd-radio>

Disabled Radio

npm.io

<jsd-radio id='disabled' name='disabled' disabled value='Male' label="gender" list='["Male", "Female", "Other"]'></jsd-radio>

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.0.6

3 years ago

1.0.5

3 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago