Skip to content

Chat

ChatSendButton

Send/stop button for a chat composer.

import { ChatSendButton } from '@var-ui/react';

ChatSendButton

Send/stop button for a chat composer. Reuses the existing Button and Icon rather than a dedicated recipe. See ChatComposer for the full composer wiring.

Examples

Default

There is no @var-ui/astro ChatSendButton — Astro and HTML show a static send-state button; the streaming send/stop toggle is React-only.

Demo.tsxTSX
import { useState } from 'react';
import { ChatSendButton } from '@var-ui/react';

function SendToggle() {
  const [isStreaming, setIsStreaming] = useState(false);
  return (
    <ChatSendButton
      streaming={isStreaming}
      onClick={() => setIsStreaming(true)}
      onStop={() => setIsStreaming(false)}
    />
  );
}

loading shows a spinner and ignores presses while a send is in flight; streaming still wins, keeping stop pressable.

Props

Accessibility

aria-label switches between “Send message” and “Stop generating” based on streaming.