{"repo":"github/text-expander-element","free":true,"listed":false,"github":"https://github.com/github/text-expander-element","clone":"git clone https://github.com/github/text-expander-element.git","description":"Activates a suggestion menu to expand text snippets as you type.","language":"JavaScript","stars":227,"topics":["web-components","custom-elements"],"license":"MIT","category":"ui-components","readme_excerpt":"&lt;text-expander&gt; element Activates a suggestion menu to expand text snippets as you type. Installation Usage Script Import as ES modules: With a script tag: Markup Attributes - keys is a space separated list of menu activation keys - multiword defines whether the expansion should use several words or not - you can provide a space separated list of activation keys that should support multi-word matching - suffix is a string that is appended to the value during expansion, default is a single space character Events text-expander-change is fired when a key is matched. In event.detail you can find: - key : The matched key; for example: : . - text : The matched text; for example: cat , for :cat . - If the key is specified in the multiword attribute then the matched text can contain multiple words; for example cat and dog for :cat and dog . - provide : A function to be called when you have the menu results. Takes a Promise with {matched: boolean, fragment: HTMLElement} where matched tells the element whether a suggestion is available, and fragment is the menu content to be displayed on the page. The returned fragment should be consisted of filtered [role=option] items to be selected. For example: text-expander-value is fired when an item is selected. In event.detail you can find: - key : The matched key; for example: : . - item : The selected item. This would be one of the [role=option] . Use this to work out the value . - value : A null value placeholder to replace the query. ","default_branch":null,"files":null,"tree":[],"storefront":"/r/github","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/github/text-expander-element/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}