Creating a Web Component With Open-WC
Here is a summary of the text: The article describes the creation of a keypad component using Material Design Web Components. The component will render a display and buttons with digits 0-9, *, and #. It will also have an 'Action' button that sends all the digits pressed as a custom event to the application outside of the component. Another button is available to 'End' the action, which clears the display and sends another custom event. The Web Component has a public method that switches it to the 'active' state, displaying the 'End' button. It uses lit-html and Open Web Components (Open-WC) for building and rendering. The component accepts various attributes and properties, such as noAsterisk, noHash, noDisplay, actionText, cancelText, actionStarted, and digits. After publishing the Web Component on npm, it can be used in a project by installing it locally or using a Content Delivery Network (CDN) like unpkg.com. The component is now available for use in web applications with minimal hassle.
Company
Vonage
Date published
Nov. 7, 2020
Author(s)
Dwane Hemmings
Word count
1796
Language
English
Hacker News points
None found.