Jane
Yesterday @ 2:30pmLorem, ipsum dolor sit amet consectetur adipisicing elit. Provident blanditiis quidem dolorum ab similique. Voluptatibus quibusdam unde mollitia corrupti assumenda libero. Quibusdam culpa illum unde asperiores accusantium! Unde, cupiditate tenetur.
Michael
Yesterday @ 2:45pmLorem, ipsum dolor sit amet consectetur adipisicing elit. Provident blanditiis quidem dolorum ab similique. Voluptatibus quibusdam unde mollitia corrupti assumenda libero. Quibusdam culpa illum unde asperiores accusantium! Unde, cupiditate tenetur.
Jane
Yesterday @ 2:50pmLorem, ipsum dolor sit amet consectetur adipisicing elit. Provident blanditiis quidem dolorum ab similique. Voluptatibus quibusdam unde mollitia corrupti assumenda libero. Quibusdam culpa illum unde asperiores accusantium! Unde, cupiditate tenetur.
Michael
Yesterday @ 2:52pmLorem, ipsum dolor sit amet consectetur adipisicing elit. Provident blanditiis quidem dolorum ab similique. Voluptatibus quibusdam unde mollitia corrupti assumenda libero. Quibusdam culpa illum unde asperiores accusantium! Unde, cupiditate tenetur.
Layout Columns
We recommend using Tailwind’s grid column utility classes to define horizontal columns for your layout.
Layout Rows
We recommend using Tailwind’s grid row utility classes to define vertical layout rows for your layout.
(feed)
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit dolor ullam, qui et itaque quam distinctio dicta nostrum veritatis harum iure hic sequi aperiam, explicabo earum totam deserunt. Fugiat, temporibus.
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit dolor ullam, qui et itaque quam distinctio dicta nostrum veritatis harum iure hic sequi aperiam, explicabo earum totam deserunt. Fugiat, temporibus.
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit dolor ullam, qui et itaque quam distinctio dicta nostrum veritatis harum iure hic sequi aperiam, explicabo earum totam deserunt. Fugiat, temporibus.
Message Feed
Within our feed element, we’ll generate a feed of messages. Note that we’ll replace the <pre>
tags in the next example.
{ "role": "host", "id": 0, "host": true, "avatar": 48, "name": "Jane", "timestamp": "Yesterday @ 2:30pm", "message": "Some message text.", "color": "variant-soft-primary" }
{ "role": "guest", "id": 1, "host": false, "avatar": 14, "name": "Michael", "timestamp": "Yesterday @ 2:45pm", "message": "Some message text.", "color": "variant-soft-primary" }
Message Bubbles
By mixing Skeleton features with Tailwind styling, we can provided message bubble interfaces for each type of feed post.
Jane
Yesterday @ 2:30pmSome message text.
Michael
Yesterday @ 2:45pmSome message text.
Prompt
We can utilize a Skeleton input group styles to create a custom text prompt.
Scroll to Bottom
Bind your scrollable feed panel element reference (Svelte | React), then use scrollTo to scroll the panel to the bottom on demand. Scroll behavior can be set via behavior: 'smooth'
.
Add a Message
Below we’ll cover how to append the message feed with a new message from the host user. Per our above examples, we’ll use the same messageFeed
data structure.
Then bind to the textarea for your prompt in order to capture any message typed by the user.
Here’s an example of how we might append a new message to the messageFeed
array.
This can be triggered when the prompt’s SEND button is clicked.