TidalUI

Chat composer preview

Write messages with attachments, keyboard shortcuts and send or stop controls.

pro · Blocks · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/chat-composer

Import components/ui/tidal.css, components/ui/chat-composer.css. Wrap installed components in tidal-scope.

Preview

Chat composer component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/chat-composer.css";
import{TidalChatComposer}from"./components/ui/chat-composer";
export default()=><div className="tidal-scope"><TidalChatComposer onSend={() => {}} onValueChange={() => {}} value={"value"}/></div>;

API and props

TidalChatComposer.onSend (required)
(value: string, event: FormEvent<HTMLFormElement>) => void

Callback invoked when the send interaction is proposed.

TidalChatComposer.onValueChange (required)
(value: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void

Callback invoked when the value change interaction is proposed.

TidalChatComposer.value (required)
string

Required value value accepted by this exported component.

TidalChatComposer.attachmentTray
TidalAttachmentTrayProps | undefined

Optional attachment tray value accepted by this exported component.

TidalChatComposer.busy
boolean | undefined

Optional busy value accepted by this exported component.

TidalChatComposer.canSend
boolean | undefined

Optional can send value accepted by this exported component.

TidalChatComposer.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalChatComposer.error
string | undefined

Optional error value accepted by this exported component.

TidalChatComposer.label
string | undefined

Optional label value accepted by this exported component.

TidalChatComposer.labels
{ send?: string; stop?: string; sending?: string; } | undefined

Optional labels value accepted by this exported component.

TidalChatComposer.onStop
MouseEventHandler<HTMLButtonElement> | undefined

Callback invoked when the stop interaction is proposed.

TidalChatComposer.placeholder
string | undefined

Optional placeholder value accepted by this exported component.

TidalChatComposer.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalChatComposer.submitButtonProps
Omit<TidalButtonProps, "variant" | "loading" | "form" | "type" | "children"> | undefined

Optional submit button props value accepted by this exported component.

TidalChatComposer.submitButtonRef
Ref<HTMLButtonElement> | undefined

Optional submit button ref value accepted by this exported component.

TidalChatComposer.submitShortcut
"none" | "enter" | "mod-enter" | undefined

Optional submit shortcut value accepted by this exported component.

TidalChatComposer.textareaProps
TextareaProps | undefined

Optional textarea props value accepted by this exported component.

TidalChatComposer.textareaRef
Ref<HTMLTextAreaElement> | undefined

Optional textarea ref value accepted by this exported component.

TidalChatComposer.tools
ReactNode

Optional tools value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas