0.2.5 • Published 4 years ago

@idli/idli-select v0.2.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

Built With Stencil

Using this component

Script tag

  • Put a script tag similar to this <script src='https://unpkg.com/@idli/idli-select@0.2.5/dist/idli-select.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

Node Modules

  • Run npm install @idli/idli-select --save
  • Put a script tag similar to this <script src='node_modules/@idli/idli-select/dist/idli-select.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

In a stencil-starter app

  • Run npm install @idli/idli-select --save
  • Add an import to the npm packages import @idli/idli-select;
  • Then you can use the element anywhere in your template, JSX, html etc

Example:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <script src='https://unpkg.com/@idli/idli-select@0.2.5/dist/idli-select.js'></script>
</head>
<body>
      <idli-select label="Name" placeholder="John Snow" id="select-box"/>
      
      <script>
          const $sel = document.getElementById('select-box');
          $sel.options = [{
              value: 'jack',
              label: 'Jack'
          }, {
              value: 'jill',
              label: 'Jill'
          }, {
              value: 'sun',
              label: 'Sun'
          }];
      
          $sel.addEventListener('inputChange', function (evt) {
              console.log(evt.detail);
          });
      </script>
</body>
</html>

Demo:

Click here for demo

Code of Conduct

Contributor Covenant

License

Apache License 2.0