Skip to content
Yuva discussion composerMenu

Yuva discussion composer

A Markdown composer with Write and Preview tabs for new discussions, replies and edits, and the reader sign-in prompt.

Markdown is supported.

The preview runs on sample data. It needs no network and no channel.

Installation

Run this in a shadcn project. The files are copied into your own code.

Shell
npx shadcn@latest add https://useyuva.com/r/yuva-discussion-composer.json

Usage

tsx
import { YuvaDiscussionComposer } from "@/components/yuva-discussion-composer"

<YuvaDiscussionComposer withTitle onSubmit={async ({ title, body }) => {}} />

Props

YuvaDiscussionComposerProps

PropType
withTitle?boolean
initialTitle?string
initialBody?string
submitLabel?string
placeholder?string
autoFocus?boolean
labels?Partial<YuvaDiscussionsLabels>
className?string
onTitleChange?(title: string) => void
onSubmit(input: { title: string; body: string }) => Promise<unknown>
onCancel?() => void

YuvaSignInProps

PropType
labels?Partial<YuvaDiscussionsLabels>
className?string

Labels

The labels are listed on Yuva discussions.

Dependencies

Installing this item also adds the following.

Components from shadcn/ui

Other Yuva items

npm packages