s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Messages · Components

ComposeForm

Full message compose form with type-adaptive fields

Public export

typescript
import { ComposeForm } from '@happyvertical/smrt-messages/svelte';
Import path
@happyvertical/smrt-messages/svelte
Props
6
Props described
6 of 6
Bindable state
0
Callback events
3
Verified release
0.44.0

Props

NameTypeRequiredDescription
type'email' | 'slack' | 'tweet'NoMessage type to compose: email, Slack message, or tweet.
accountsAccountData[]NoAvailable accounts to select as sender.
initialStatePartial<ComposeState>NoPre-fill the form with these values.
onsend(state: ComposeState) => voidNoCalled when user sends the message.
onsavedraft(state: ComposeState) => voidNoCalled when user saves the draft.
ondiscard() => voidNoCalled when user discards the compose.

Bindable state

This component has no bindable public state.

Callback events

  • onsend(state: ComposeState) => void
  • onsavedraft(state: ComposeState) => void
  • ondiscard() => void

Examples and explanation