npm

jcb-input

1.0.8 • Public • Published

Install

npm install jcb-input

Usage example

parcel index.html

index.html

<!DOCTYPE html>
<body>
   <jcb-input
      id="phone-input"
      type="text"
      name="phone"
      label="Téléphone mobile"
      placeholder="Ex : 06 50 90 04 72"
      value="123"
      error-message="Invalid phone number"
   ></jcb-input>
</body>

<script>
   import 'jcb-input'
   import "@fontsource/roboto/300.css"

   const phoneInput = document.getElementById('phone-input')
   // phoneInput.value = "234"

   phoneInput.addEventListener('input', event => {
      console.log('input', event.target.value)
   })
</script>

<style>
:root {
   font-family: "Roboto";
   font-weight: 300;
}
</style>

API references

jcb-input

Attributes

Name Type Default Description
type String ''
name String ''
label String ''
value String '' entered text
error-message String '' error message

Events

Name Description Value
input Emitted whenever text is changed

CSS variables

Name Default Description
--jcb-input-xxx xxx xxx

Readme

Keywords

Package Sidebar

Install

npm i jcb-input

Weekly Downloads

0

Version

1.0.8

License

MIT

Unpacked Size

5.52 kB

Total Files

4

Last publish

Collaborators

  • jcbuisson