All Projects → jifalops → chat-window

jifalops / chat-window

Licence: MIT license
A simple and flexible chat window for listing messages.

Programming Languages

HTML
75241 projects

Projects that are alternatives of or similar to chat-window

Polyserve
Moved to Polymer/tools monorepo
Stars: ✭ 194 (+618.52%)
Mutual labels:  polymer, web-components
fullcalendar-calendar
Web Component wrapper for FullCalendar
Stars: ✭ 21 (-22.22%)
Mutual labels:  polymer, web-components
Storybook
📓 The UI component explorer. Develop, document, & test React, Vue, Angular, Web Components, Ember, Svelte & more!
Stars: ✭ 67,445 (+249696.3%)
Mutual labels:  polymer, web-components
scheduler-component
A Web Component wrapper for FullCalendar library that uses Polymer version 2.0 and ES6.
Stars: ✭ 24 (-11.11%)
Mutual labels:  polymer, web-components
nuxeo-ui-elements
Library of UI web components
Stars: ✭ 20 (-25.93%)
Mutual labels:  polymer, web-components
Polymer Analyzer
Moved to Polymer/tools monorepo
Stars: ✭ 162 (+500%)
Mutual labels:  polymer, web-components
page-title
A Polymer element for easily updating a webpage's title, such as in a SPA.
Stars: ✭ 13 (-51.85%)
Mutual labels:  polymer, web-components
Hot Table
Handsontable - Best Data Grid Web Component with Spreadsheet Look and Feel.
Stars: ✭ 114 (+322.22%)
Mutual labels:  polymer, web-components
abdonrd.com
My little personal website
Stars: ✭ 16 (-40.74%)
Mutual labels:  polymer, web-components
eslint-plugin-lit
lit-html support for ESLint
Stars: ✭ 90 (+233.33%)
Mutual labels:  polymer, web-components
Gwt Polymer Elements
Polymer Web Components for GWT. A collection of Material Design widgets for desktop and mobile.
Stars: ✭ 153 (+466.67%)
Mutual labels:  polymer, web-components
lego
🚀 Web-components made lightweight & Future-Proof.
Stars: ✭ 69 (+155.56%)
Mutual labels:  polymer, web-components
Cleverstyle Framework
CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework
Stars: ✭ 150 (+455.56%)
Mutual labels:  polymer, web-components
Polymer Skeleton
💀 Skeleton for Polymer 3 app with Webpack, PostCSS and Service Workers ready.
Stars: ✭ 185 (+585.19%)
Mutual labels:  polymer, web-components
Polydev
Automatic web components profiling in chrome devtools
Stars: ✭ 118 (+337.04%)
Mutual labels:  polymer, web-components
mc-viewer
🌐🏠 A Web Component for visualizing Minecraft schematics
Stars: ✭ 25 (-7.41%)
Mutual labels:  polymer, web-components
Gulp Vulcanize
Concatenate a set of Web Components into one file
Stars: ✭ 101 (+274.07%)
Mutual labels:  polymer, web-components
Polymer Build
Moved to Polymer/tools monorepo
Stars: ✭ 107 (+296.3%)
Mutual labels:  polymer, web-components
ibm-toolbar
Horizontal toolbar containing items that can be used for label, navigation, search and actions
Stars: ✭ 18 (-33.33%)
Mutual labels:  polymer, web-components
moment-element
Web Component (with Polymer) wrapper for the moment library
Stars: ✭ 15 (-44.44%)
Mutual labels:  polymer, web-components

Published on Vaadin  Directory Stars on vaadin.com/directory Published on webcomponents.org

chat-window

The easiest way to have a chat.

Installation

bower i -S chat-window        # Polymer 2.0 hybrid (1.x compatible)
bower i -S chat-window#0.5.0  # Polymer 1.x based

Usage

  • Pass it a list of messages and it will display them with live relative timestamps using from-now.
  • Listen for the send event to handle sending messages.

Demo

Mouse-over messages to see the absolute timestamp.

<chat-window
  id="chat"
  author="me"
  single-line>
</chat-window>
<script>
  var chat = document.getElementById('chat');
  var author;
  chat.messages = messages;
  chat.addEventListener('send', function(e) {
    author = author == 'me' ? 'you' : 'me'; // For demo
    chat.push('messages',{
      author: author,
      text: e.detail,
      created: Date.now()
    });
    chat.inputText = '';
  });
</script>

Full demo: webcomponents.org | github.

API: webcomponents.org | github.

Features

  • Single or multi line input.
  • Send-on-enter option, default is on for single-line and off for multi-line input.
  • Slots for a header, footer, and a custom input field.
  • Styling hooks for full styling flexibility
  • Automatically scrolls to bottom when a new message arrives (can be disabled).
  • Absolute timestamps can be shown via configurable date format.
  • Auto-updating message timestamps using Moment.js that
    • Show every 5 minutes if less than one hour old,
    • Show every hour if less than a day old,
    • Show every four hours if a less than a week old,
    • Otherwise show once per day.

TODO

  • Allow author: msg format instead of alignment based format.
  • Use material guidelines for showing relative vs absolute timestamps as well as their format.

Contributing

  1. Fork it on Github.
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].