Counts the SMS character usage for a textarea or text input.
<script src='https://unpkg.com/@seven.io/counter/dist/index.js'></script>
import '@seven.io/counter'
<textarea data-seven-sms></textarea>
<input data-seven-sms/>
For advanced usage see the examples.
Set the window object before loading the library.
window.SEVEN_COUNTER_OPTIONS = {
initEvent: string = 'DOMContentLoaded', // the DOM event for init
position: InsertPosition = 'afterend', // where to add the counter stats span relative to the input
selector: string = '*[data-seven-sms]', // the inputs selector
standalone: boolean = false, // stop attaching input listeners
stats: boolean = false, // whether to output stats or not - also accepts HTMLElement or CSS selector
}
Need help? Feel free to contact us.