Calm motion: animations on this site only fade, with no movement
Post composer
Write a post with images, a poll, and a count of the characters left
The box at the top of a social feed or a community page. To show posts, use the activity feed or the thread.
Basic
v-modelis the text of the post.maxis the most characters (default 280).- The count under the box says how many characters are left. An emoji counts as one character, as people see it. Near the limit, the count is bold. Over the limit, the box is not valid and the count says how many characters are too many.
- The image button adds pictures with a preview, up to
maxImages(default 4). The ✕ on a preview removes it. - The poll button adds two choice fields, and "Add a choice" grows the poll to four. A poll needs at least two choices.
- "Post" emits
postwith the text, the image files, and the poll choices. It is off for an empty post, a post over the limit, or a poll with fewer than two choices. authorshows the avatar of the writer.- Change the words with
labelsor a label pack:placeholder,image,poll,addChoice,post, and the functionsleft,over,choice, andremoveImage.
Usage
ts
import { BlessPostComposer } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
author | { name: string; avatar?: string | undefined; } | — | the author, for the avatar |
max | number | 280 | the most characters in a post |
maxImages | number | 4 | the most images in a post |
labels | Partial<{ placeholder: string; left: (count: number) => string; over: (count: number) => string; image: string; poll: string; choice: (n: number) => string; addChoice: string; removeImage: (n: number) => string; post: string; }> | — | |
modelValue | string | "" |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: string] | |
post | [post: BlessNewPost] |