Skip to content
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
209 characters left
  • v-model is the text of the post. max is 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 post with 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.
  • author shows the avatar of the writer.
  • Change the words with labels or a label pack: placeholder, image, poll, addChoice, post, and the functions left, over, choice, and removeImage.

Usage ​

ts
import { BlessPostComposer } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
author{ name: string; avatar?: string | undefined; }—the author, for the avatar
maxnumber280the most characters in a post
maxImagesnumber4the most images in a post
labelsPartial<{ 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; }>—
modelValuestring""

Events

NamePayloadDescription
update:modelValue[value: string]
post[post: BlessNewPost]

Released under the MIT License. Character names and artwork belong to their owners.