0.0.7 • Published 4 years ago

new-select v0.0.7

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

new-select

new-select is a vanilla javascript component which will work in any frontend framework. You can install from npm like this:

npm install --save new-select

Usage: Javascript (assumes es module)

import Select from 'new-select'

let select = new Select({target:document.body, props: { help_text: 'Init Value' });
select.help_text = 'Updated Value'; 
// Other props: label, select_placeholder, is_required, default_option, error_message, is_disable, options, filter, schema, validation

The "target" is where the component is created. Here it is added to the html body with "document.body", but it could also be document.getElementById('id-of-html-element').

You initialize properties with "props" and you can change the prop values by just assigning the props to new values - this will be updated in the UI.

Usage: Legacy Javascript

Below you can see how to use the component with vanilla js.

...
<head>
  ...
  <script src="https://unpkg.com/new-select@0.0.1/index.js"></script>
</head>
<body>
  <script>
    let select = new Select({target:document.body})
  </script>
</body>

Usage: Web Component (aka. Custom Element)

You can use it as a web component.

<head>
  <script src="https://unpkg.com/new-select@0.0.1/index.js"></script>
</head>
<body>
  <svelte-select help_text="Init Value" />    
</body>

Svelte Component

<script>
  import Select from 'new-select';
</script>
<Select/>

Pelte

This component was created by pelte (aka publish-svelte)

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago