본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Chat - 컴포저

원문 보기 위키 갱신

Chat - 컴포저 (Composer)

자동 크기 조절 텍스트 영역, 키보드 단축키, 첨부 파일 지원으로 채팅 메시지를 작성하고 전송합니다.

개요

컴포저는 채팅 화면 하단의 입력 영역입니다. ChatComposer는 Material UI 스타일링을 제공합니다: 테두리, 패딩, 테마 토큰이 자동으로 적용됩니다. 이 페이지의 데모는 컴포저와 그것이 의존하는 provider 컨텍스트만 렌더링합니다.

인터랙티브 플레이그라운드

ChatComposer props를 직접 실험해 보세요: variant, 첨부 파일, 도움말 텍스트, 플레이스홀더를 토글합니다:

import * as React from 'react';
import AttachIcon from '@mui/icons-material/AttachFile';
import SendIcon from '@mui/icons-material/Send';
import Box from '@mui/material/Box';
import {
  ChatComposer,
  ChatComposerAttachButton,
  ChatComposerAttachmentList,
  ChatComposerHelperText,
  ChatComposerSendButton,
  ChatComposerTextArea,
  ChatComposerToolbar,
} from '@mui/x-chat';
import type { ChatAttachmentsConfig, ChatVariant } from '@mui/x-chat/headless';
import { PlaygroundCard } from 'docs/src/modules/components/chat-playground/PlaygroundCard';
import {
  ScopedChat,
  ChatChrome,
} from 'docs/src/modules/components/chat-playground/sharedProviders';
import { emptyConversation } from 'docs/src/modules/components/chat-playground/sharedFixtures';
import {
  ChoiceControl,
  DividerLabel,
  NumberControl,
  SwitchControl,
  TextControl,
} from 'docs/src/modules/components/chat-playground/controls';
import {
  useCustomizations,
  type CustomizationDef,
} from 'docs/src/modules/components/chat-playground/useCustomizations';

const DEFAULTS = {
  variant: 'default' as ChatVariant,
  disabled: false,
  attachments: true,
  showHelperText: true,
  maxFileCount: 0,
  maxFileSizeMB: 0,
  acceptedMimeTypes: 'image/*,application/pdf',
  placeholder: 'Ask anything…',
};

type ClassKey =
  | 'root'
  | 'disabled'
  | 'variantCompact'
  | 'textArea'
  | 'sendButton'
  | 'attachButton'
  | 'toolbar'
  | 'attachmentList'
  | 'helperText';

const CLASS_DEFS: ReadonlyArray<CustomizationDef<ClassKey>> = [
  { name: 'root', description: 'Outermost form element.' },
  {
    name: 'disabled',
    selector: '.MuiChatComposer-disabled',
    description: 'Applied to the root when disabled.',
  },
  {
    name: 'variantCompact',
    selector: '.MuiChatComposer-variantCompact',
    description: 'Applied to the root when variant="compact".',
  },
  {
    name: 'textArea',
    selector: '.MuiChatComposer-textArea',
    description: 'Applied to the text area input.',
  },
  {
    name: 'sendButton',
    selector: '.MuiChatComposer-sendButton',
    description: 'Applied to the send button.',
  },
  {
    name: 'attachButton',
    selector: '.MuiChatComposer-attachButton',
    description: 'Applied to the attach button.',
  },
  {
    name: 'toolbar',
    selector: '.MuiChatComposer-toolbar',
    description: 'Applied to the toolbar row.',
  },
  {
    name: 'attachmentList',
    selector: '.MuiChatComposer-attachmentList',
    description: 'Applied to the attachment list above the textarea.',
  },
  {
    name: 'helperText',
    selector: '.MuiChatComposer-helperText',
    description: 'Applied to the helper text below the textarea.',
  },
];

export default function ChatComposerPlayground() {
  const [variant, setVariant] = React.useState<ChatVariant>(DEFAULTS.variant);
  const [disabled, setDisabled] = React.useState(DEFAULTS.disabled);
  const [attachments, setAttachments] = React.useState(DEFAULTS.attachments);
  const [showHelperText, setShowHelperText] = React.useState(
    DEFAULTS.showHelperText,
  );
  const [maxFileCount, setMaxFileCount] = React.useState(DEFAULTS.maxFileCount);
  const [maxFileSizeMB, setMaxFileSizeMB] = React.useState(DEFAULTS.maxFileSizeMB);
  const [acceptedMimeTypes, setAcceptedMimeTypes] = React.useState(
    DEFAULTS.acceptedMimeTypes,
  );
  const [placeholder, setPlaceholder] = React.useState(DEFAULTS.placeholder);
  const classesCustomizations = useCustomizations<ClassKey>(CLASS_DEFS);

  const handleReset = React.useCallback(() => {
    setVariant(DEFAULTS.variant);
    setDisabled(DEFAULTS.disabled);
    setAttachments(DEFAULTS.attachments);
    setShowHelperText(DEFAULTS.showHelperText);
    setMaxFileCount(DEFAULTS.maxFileCount);
    setMaxFileSizeMB(DEFAULTS.maxFileSizeMB);
    setAcceptedMimeTypes(DEFAULTS.acceptedMimeTypes);
    setPlaceholder(DEFAULTS.placeholder);
  }, []);

  const attachmentConfig: boolean | ChatAttachmentsConfig = React.useMemo(() => {
    if (!attachments) {
      return false;
    }
    const config: ChatAttachmentsConfig = {};
    const types = acceptedMimeTypes
      .split(',')
      .map((s) => s.trim())
      .filter(Boolean);
    if (types.length > 0) {
      config.acceptedMimeTypes = types;
    }
    if (maxFileCount > 0) {
      config.maxFileCount = maxFileCount;
    }
    if (maxFileSizeMB > 0) {
      config.maxFileSize = maxFileSizeMB * 1024 * 1024;
    }
    return Object.keys(config).length === 0 ? true : config;
  }, [attachments, acceptedMimeTypes, maxFileCount, maxFileSizeMB]);

  const composerSx = classesCustomizations.toClassesSx();
  return (
    <PlaygroundCard
      title="ChatComposer"
      description="Form surface for the prompt — attachment list, textarea, toolbar."
      previewMinHeight={180}
      span={2}
      onReset={handleReset}
      classCustomizations={classesCustomizations.customizations}
      onClassesReset={classesCustomizations.reset}
      controls={
        <React.Fragment>
          <DividerLabel>props</DividerLabel>
          <ChoiceControl<ChatVariant>
            label="variant"
            value={variant}
            options={['default', 'compact'] as const}
            onChange={setVariant}
          />
          <SwitchControl
            label="disabled"
            checked={disabled}
            onChange={setDisabled}
            helperText="palette.action.disabledBackground."
          />
          <DividerLabel>features.attachments</DividerLabel>
          <SwitchControl
            label="attachments"
            checked={attachments}
            onChange={setAttachments}
            helperText="Show the attach button + preview list."
          />
          <TextControl
            label="acceptedMimeTypes"
            value={acceptedMimeTypes}
            onChange={setAcceptedMimeTypes}
            placeholder="image/*,application/pdf"
            disabled={!attachments}
            helperText="Comma-separated MIME list."
          />
          <NumberControl
            label="maxFileCount"
            value={maxFileCount}
            min={0}
            max={10}
            disabled={!attachments}
            valueFormatter={(value) => (value === 0 ? '∞' : value.toString())}
            helperText="0 disables the limit."
            onChange={setMaxFileCount}
          />
          <NumberControl
            label="maxFileSize"
            value={maxFileSizeMB}
            min={0}
            max={50}
            disabled={!attachments}
            valueFormatter={(value) => (value === 0 ? 'unlimited' : `${value}MB`)}
            helperText="0 disables the limit."
            onChange={setMaxFileSizeMB}
          />
          <DividerLabel>composition (children)</DividerLabel>
          <TextControl
            label="ChatComposerTextArea.placeholder"
            value={placeholder}
            onChange={setPlaceholder}
          />
          <SwitchControl
            label="render ChatComposerHelperText"
            checked={showHelperText}
            onChange={setShowHelperText}
            helperText="default variant only."
          />
        </React.Fragment>
      }
      preview={
        <ScopedChat conversations={[emptyConversation]}>
          <ChatChrome variant={variant} density="standard">
            <Box sx={{ width: '100%' }}>
              {variant === 'default' ? (
                <ChatComposer
                  variant="default"
                  disabled={disabled}
                  features={{ attachments: attachmentConfig }}
                  sx={composerSx}
                >
                  {attachments ? <ChatComposerAttachmentList /> : null}
                  <ChatComposerTextArea placeholder={placeholder} />
                  {showHelperText ? (
                    <ChatComposerHelperText>
                      Press Enter to send, Shift+Enter for a new line.
                    </ChatComposerHelperText>
                  ) : null}
                  <ChatComposerToolbar>
                    {attachments ? (
                      <ChatComposerAttachButton>
                        <AttachIcon />
                      </ChatComposerAttachButton>
                    ) : null}
                    <ChatComposerSendButton>
                      <SendIcon />
                    </ChatComposerSendButton>
                  </ChatComposerToolbar>
                </ChatComposer>
              ) : (
                <ChatComposer
                  variant="compact"
                  disabled={disabled}
                  features={{ attachments: attachmentConfig }}
                  sx={composerSx}
                >
                  {attachments ? <ChatComposerAttachmentList /> : null}
                  {attachments ? (
                    <ChatComposerAttachButton>
                      <AttachIcon />
                    </ChatComposerAttachButton>
                  ) : null}
                  <ChatComposerTextArea maxRows={5} placeholder={placeholder} />
                  <ChatComposerSendButton>
                    <SendIcon />
                  </ChatComposerSendButton>
                </ChatComposer>
              )}
            </Box>
          </ChatChrome>
        </ScopedChat>
      }
    />
  );
}

Import

import {
  ChatComposer,
  ChatComposerLabel,
  ChatComposerTextArea,
  ChatComposerSendButton,
  ChatComposerAttachButton,
  ChatComposerAttachmentList,
  ChatComposerToolbar,
  ChatComposerHelperText,
} from '@mui/x-chat';

:::info ChatBox를 사용할 때 컴포저는 이미 포함되어 있습니다. 사용자 정의 레이아웃을 만들 때만 이 컴포넌트들을 직접 import 하세요. :::

컴포넌트 구조

ChatBox 안에서 컴포저는 다음 구조를 렌더링합니다:

ChatComposer                  ← <form> element, border-top divider
  ChatComposerLabel           ← optional <label> for accessibility
  ChatComposerTextArea        ← auto-resizing textarea
  ChatComposerToolbar         ← button row
    ChatComposerAttachButton  ← file attach trigger
    ChatComposerSendButton    ← submit button (disabled when the draft is empty or while streaming)
  ChatComposerHelperText      ← disclaimer or character count

Variants

ChatComposer는 variant="default"(textarea 위에 ChatComposerToolbar 버튼 행이 있는 테두리 박스) 또는 variant="compact"(ChatComposerAttachButton과 ChatComposerSendButton이 툴바 없이 자식으로 직접 배치되는 단일 행 레이아웃)를 받습니다.

variant는 둘러싼 채팅 컨텍스트에서도 올 수 있습니다; 명시적 prop이 컨텍스트 값보다 우선합니다.

'use client';
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import {
  ChatComposer,
  ChatComposerAttachButton,
  ChatComposerAttachmentList,
  ChatComposerSendButton,
  ChatComposerTextArea,
  ChatComposerToolbar,
} from '@mui/x-chat';
import { ChatProvider } from '@mui/x-chat/headless';
import { createEchoAdapter } from 'docs/data/chat/core/examples/shared/demoUtils';
import { minimalConversation } from 'docs/data/chat/core/examples/shared/demoData';

const adapter = createEchoAdapter({
  respond: (text) => `Draft submitted: "${text}".`,
});

export default function ComposerVariantsStandalone() {
  return (
    <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
      <Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>
        <Typography variant="caption" color="text.secondary">
          variant=&quot;default&quot;
        </Typography>
        <ChatProvider
          adapter={adapter}
          initialActiveConversationId={minimalConversation.id}
          initialConversations={[minimalConversation]}
        >
          <ChatComposer variant="default">
            <ChatComposerTextArea
              aria-label="Message"
              placeholder="Type a message"
            />
            <ChatComposerToolbar>
              <ChatComposerAttachButton>Attach</ChatComposerAttachButton>
              <ChatComposerSendButton>Send</ChatComposerSendButton>
            </ChatComposerToolbar>
          </ChatComposer>
        </ChatProvider>
      </Box>
      <Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>
        <Typography variant="caption" color="text.secondary">
          variant=&quot;compact&quot;
        </Typography>
        <ChatProvider
          adapter={adapter}
          initialActiveConversationId={minimalConversation.id}
          initialConversations={[minimalConversation]}
        >
          <ChatComposer variant="compact">
            <ChatComposerAttachmentList />
            <ChatComposerAttachButton>Attach</ChatComposerAttachButton>
            <ChatComposerTextArea
              aria-label="Message"
              maxRows={5}
              placeholder="Type a message"
            />
            <ChatComposerSendButton>Send</ChatComposerSendButton>
          </ChatComposer>
        </ChatProvider>
      </Box>
    </Box>
  );
}

텍스트 영역

ChatComposerTextArea는 콘텐츠에 따라 커지는 자동 크기 조절 <textarea>입니다. Enter로 제출하고 Shift+Enter로 새 줄을 삽입합니다.

maxRows를 사용하여 자동 확장을 제한할 수 있습니다: textarea는 한 줄에서 시작해 maxRows 줄까지 커진 뒤 스크롤됩니다.

플레이스홀더 커스터마이즈

ChatComposerTextArea에서 직접 플레이스홀더를 커스터마이즈합니다:

'use client';
import * as React from 'react';
import { ComposerDemoShell } from './ComposerDemoShell';

export default function ComposerCustomPlaceholderStandalone() {
  return (
    <ComposerDemoShell
      inputProps={{ placeholder: 'Ask anything…' }}
      helperText="This standalone example customizes the textarea placeholder directly."
    />
  );
}

IME 조합

컴포저는 CJK 언어를 위한 IME(입력 방식 편집기) 조합을 처리합니다. 사용자가 문자를 조합하는 동안(예: 한자를 선택하는 중) Enter를 누르면 메시지를 제출하는 대신 문자 선택을 확인합니다. 조합이 끝날 때까지 제출이 차단됩니다.

보내기 버튼

ChatComposerSendButton은 다음 경우에 자동으로 비활성화됩니다:

  • 텍스트 영역이 비어 있고 대기 중인 첨부 파일이 없을 때.
  • 응답이 스트리밍 중일 때.
  • 컴포저가 명시적으로 비활성화되었을 때.

첨부 버튼

첨부 버튼은 브라우저 파일 선택기를 엽니다. 선택한 파일은 초안 첨부 파일로 대기열에 들어가고 컴포저 영역에서 미리 봅니다.

첨부 파일이 화면의 일부가 아닐 때는 툴바에서 ChatComposerAttachButton을 생략하세요:

'use client';
import * as React from 'react';
import { ComposerDemoShell } from './ComposerDemoShell';

export default function ComposerHiddenAttachButtonStandalone() {
  return (
    <ComposerDemoShell
      hideAttachButton
      helperText="This toolbar omits ChatComposerAttachButton, leaving only the send action."
    />
  );
}

구성된 제한(maxFileCount, maxFileSize, acceptedMimeTypes)을 초과하는 파일은 대기열에 들어가지 않으며 내장된 거부 UI는 없습니다 — onAttachmentReject 콜백을 처리하여 피드백을 표시하세요.

허용되는 MIME 유형, 파일 크기 제한, 업로드 수명 주기에 대한 자세한 내용은 첨부 파일을 참고하세요.

도움말 텍스트

컴포저 아래에 도움말 텍스트 한 줄이 나타납니다. 법적 고지, 문자 수, 또는 상황에 맞는 힌트에 사용하세요.

'use client';
import * as React from 'react';
import { ComposerDemoShell } from './ComposerDemoShell';

export default function ComposerHelperTextStandalone() {
  return <ComposerDemoShell helperText="Files are uploaded after you send." />;
}

제어된 컴포저 값

ChatProvider 상태를 통해 컴포저 값을 외부에서 제어할 수 있습니다. 아래 데모는 현재 컴포저 값을 독립형 컴포저 위에 표시합니다:

'use client';
import * as React from 'react';
import Typography from '@mui/material/Typography';
import { ComposerDemoShell } from './ComposerDemoShell';

export default function ComposerControlledStandalone() {
  const [value, setValue] = React.useState('');

  return (
    <ComposerDemoShell
      beforeComposer={
        <Typography variant="body2" color="text.secondary">
          Composer value: {value ? `"${value}"` : '(empty)'}
        </Typography>
      }
      composerValue={value}
      onComposerValueChange={setValue}
      helperText="The current draft value is controlled outside the composer."
    />
  );
}

Hook으로 컴포저 상태 접근

더 깊은 제어를 위해 useChatComposer() hook이 컴포저 상태에 직접 접근할 수 있게 해 줍니다:

'use client';
import * as React from 'react';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Typography from '@mui/material/Typography';
import { useChatComposer } from '@mui/x-chat/headless';
import { ComposerDemoShell } from './ComposerDemoShell';

function ComposerInfo() {
  const composer = useChatComposer();
  return (
    <Box sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}>
      <Typography variant="body2" color="text.secondary">
        Current value: {composer.value ? `"${composer.value}"` : '(empty)'}
      </Typography>
      <Typography variant="body2" color="text.secondary">
        Attachments: {composer.attachments.length}
      </Typography>
      <Typography variant="body2" color="text.secondary">
        Submitting: {composer.isSubmitting ? 'Yes' : 'No'}
      </Typography>
      <Button
        size="small"
        onClick={() => composer.clear()}
        sx={{ alignSelf: 'flex-start' }}
      >
        Clear
      </Button>
    </Box>
  );
}

export default function ComposerHookStateStandalone() {
  return (
    <ComposerDemoShell
      beforeComposer={<ComposerInfo />}
      helperText="Type, attach a file, or send to watch the hook state update."
    />
  );
}

hook은 다음을 반환합니다:

Property Type Description
value string Current text value
setValue (value: string) => void Update the text value
attachments ChatDraftAttachment[] Queued file attachments
addAttachment (file: File) => void Add a file to the draft
removeAttachment (localId: string) => void Remove a queued file
clear () => void Reset value and attachments
submit () => Promise<void> Submit the current draft
isSubmitting boolean Whether a send is in progress

컴포저 비활성화

ChatComposer에 disabled를 전달하여 모든 상호작용을 막습니다. 비활성화되면 텍스트 영역은 읽기 전용이 되고 보내기 버튼은 비활성화됩니다.

'use client';
import * as React from 'react';
import { ComposerDemoShell } from './ComposerDemoShell';

export default function ComposerDisabledStandalone() {
  return (
    <ComposerDemoShell
      composerProps={{ disabled: true }}
      helperText="Disabled state comes from ChatComposer and makes the entire draft surface inert."
    />
  );
}

접근성

텍스트 영역은 폴백 체인을 통해 접근 가능한 이름을 결정합니다: 명시적 aria-label이 우선하며, aria-labelledby를 전달하면 기본값을 억제하고, 그 외에는 로케일 텍스트 composerInputAriaLabel("Message")이 자동으로 적용됩니다.

ChatComposerLabel은 보이는 <label>을 렌더링합니다. htmlFor(추가로 aria-labelledby/id)를 사용해 텍스트 영역에 연결하면 중복 접근 가능한 이름을 피할 수 있습니다. 자식이 없으면 동일한 composerInputAriaLabel 텍스트로 폴백되어 보이는 이름과 알려지는 이름을 일관되게 유지합니다. 디자인상 보이는 라벨이 필요할 때 사용하세요; 그 외에는 자동 aria-label으로 충분합니다.

보내기와 첨부 버튼은 composerSendButtonLabel과 composerAttachButtonLabel에서 접근 가능한 이름을 가져옵니다 (아래 Localization 표 참고).

전체 키보드 탐색과 접근성 모델은 메시지 목록 참고를 확인하세요.

현지화 (Localization)

컴포저는 다음 로케일 텍스트 키를 사용합니다 (ChatBox 또는 ChatRoot의 localeText로 커스터마이즈 가능):

Key Default Used by
composerInputPlaceholder "Type a message" TextArea placeholder
composerInputAriaLabel "Message" TextArea aria-label, Label fallback
composerSendButtonLabel "Send message" SendButton aria-label
composerAttachButtonLabel "Add attachment" AttachButton aria-label

ChatComposerAttachButton API

데모

이 React 컴포넌트의 사용 예시와 세부사항은 컴포넌트 데모 페이지를 방문하세요:

Import

import { ChatComposerAttachButton } from '@mui/x-chat/ChatComposer';
// or
import { ChatComposerAttachButton } from '@mui/x-chat';

Note: The ref is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

CSS

Rule name

Global class Rule name Description
- attachButton Styles applied to the attach button element.
- attachmentList Styles applied to the attachment list element.
.Mui-disabled - Styles applied to the root element when disabled.
- helperText Styles applied to the helper text element.
- label Styles applied to the input label element.
- root Styles applied to the input root element.
- sendButton Styles applied to the send button element.
- textArea Styles applied to the textarea element.
- toolbar Styles applied to the toolbar element.
- variantCompact Styles applied to the root element when variant="compact".

소스 코드

이 페이지에서 원하는 정보를 찾지 못했다면, 컴포넌트의 구현을 살펴보는 것도 좋습니다.

ChatComposerAttachmentList API

데모

이 React 컴포넌트의 사용 예시와 세부사항은 컴포넌트 데모 페이지를 방문하세요:

Import

import { ChatComposerAttachmentList } from '@mui/x-chat/ChatComposer';
// or
import { ChatComposerAttachmentList } from '@mui/x-chat';

Note: The ref is forwarded to the root element.

CSS

Rule name

Global class Rule name Description
- attachButton Styles applied to the attach button element.
- attachmentList Styles applied to the attachment list element.
.Mui-disabled - Styles applied to the root element when disabled.
- helperText Styles applied to the helper text element.
- label Styles applied to the input label element.
- root Styles applied to the input root element.
- sendButton Styles applied to the send button element.
- textArea Styles applied to the textarea element.
- toolbar Styles applied to the toolbar element.
- variantCompact Styles applied to the root element when variant="compact".

소스 코드

이 페이지에서 원하는 정보를 찾지 못했다면, 컴포넌트의 구현을 살펴보는 것도 좋습니다.

ChatComposerHelperText API

데모

이 React 컴포넌트의 사용 예시와 세부사항은 컴포넌트 데모 페이지를 방문하세요:

Import

import { ChatComposerHelperText } from '@mui/x-chat/ChatComposer';
// or
import { ChatComposerHelperText } from '@mui/x-chat';

Note: The ref is forwarded to the root element.

CSS

Rule name

Global class Rule name Description
- attachButton Styles applied to the attach button element.
- attachmentList Styles applied to the attachment list element.
.Mui-disabled - Styles applied to the root element when disabled.
- helperText Styles applied to the helper text element.
- label Styles applied to the input label element.
- root Styles applied to the input root element.
- sendButton Styles applied to the send button element.
- textArea Styles applied to the textarea element.
- toolbar Styles applied to the toolbar element.
- variantCompact Styles applied to the root element when variant="compact".

소스 코드

이 페이지에서 원하는 정보를 찾지 못했다면, 컴포넌트의 구현을 살펴보는 것도 좋습니다.

ChatComposerLabel API

데모

이 React 컴포넌트의 사용 예시와 세부사항은 컴포넌트 데모 페이지를 방문하세요:

Import

import { ChatComposerLabel } from '@mui/x-chat/ChatComposer';
// or
import { ChatComposerLabel } from '@mui/x-chat';

Props

Name Type Default Required Description
children node - No
htmlFor string - No

Note: The ref is forwarded to the root element.

CSS

Rule name

Global class Rule name Description
- attachButton Styles applied to the attach button element.
- attachmentList Styles applied to the attachment list element.
.Mui-disabled - Styles applied to the root element when disabled.
- helperText Styles applied to the helper text element.
- label Styles applied to the input label element.
- root Styles applied to the input root element.
- sendButton Styles applied to the send button element.
- textArea Styles applied to the textarea element.
- toolbar Styles applied to the toolbar element.
- variantCompact Styles applied to the root element when variant="compact".

소스 코드

이 페이지에서 원하는 정보를 찾지 못했다면, 컴포넌트의 구현을 살펴보는 것도 좋습니다.

ChatComposerSendButton API

데모

이 React 컴포넌트의 사용 예시와 세부사항은 컴포넌트 데모 페이지를 방문하세요:

Import

import { ChatComposerSendButton } from '@mui/x-chat/ChatComposer';
// or
import { ChatComposerSendButton } from '@mui/x-chat';

Note: The ref is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

CSS

Rule name

Global class Rule name Description
- attachButton Styles applied to the attach button element.
- attachmentList Styles applied to the attachment list element.
.Mui-disabled - Styles applied to the root element when disabled.
- helperText Styles applied to the helper text element.
- label Styles applied to the input label element.
- root Styles applied to the input root element.
- sendButton Styles applied to the send button element.
- textArea Styles applied to the textarea element.
- toolbar Styles applied to the toolbar element.
- variantCompact Styles applied to the root element when variant="compact".

소스 코드

이 페이지에서 원하는 정보를 찾지 못했다면, 컴포넌트의 구현을 살펴보는 것도 좋습니다.

ChatComposerTextArea API

데모

이 React 컴포넌트의 사용 예시와 세부사항은 컴포넌트 데모 페이지를 방문하세요:

Import

import { ChatComposerTextArea } from '@mui/x-chat/ChatComposer';
// or
import { ChatComposerTextArea } from '@mui/x-chat';

Props

Name Type Default Required Description
maxRows number - No

Note: The ref is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

CSS

Rule name

Global class Rule name Description
- attachButton Styles applied to the attach button element.
- attachmentList Styles applied to the attachment list element.
.Mui-disabled - Styles applied to the root element when disabled.
- helperText Styles applied to the helper text element.
- label Styles applied to the input label element.
- root Styles applied to the input root element.
- sendButton Styles applied to the send button element.
- textArea Styles applied to the textarea element.
- toolbar Styles applied to the toolbar element.
- variantCompact Styles applied to the root element when variant="compact".

소스 코드

이 페이지에서 원하는 정보를 찾지 못했다면, 컴포넌트의 구현을 살펴보는 것도 좋습니다.

ChatComposerToolbar API

데모

이 React 컴포넌트의 사용 예시와 세부사항은 컴포넌트 데모 페이지를 방문하세요:

Import

import { ChatComposerToolbar } from '@mui/x-chat/ChatComposer';
// or
import { ChatComposerToolbar } from '@mui/x-chat';

Note: The ref is forwarded to the root element.

CSS

Rule name

Global class Rule name Description
- attachButton Styles applied to the attach button element.
- attachmentList Styles applied to the attachment list element.
.Mui-disabled - Styles applied to the root element when disabled.
- helperText Styles applied to the helper text element.
- label Styles applied to the input label element.
- root Styles applied to the input root element.
- sendButton Styles applied to the send button element.
- textArea Styles applied to the textarea element.
- toolbar Styles applied to the toolbar element.
- variantCompact Styles applied to the root element when variant="compact".

소스 코드

이 페이지에서 원하는 정보를 찾지 못했다면, 컴포넌트의 구현을 살펴보는 것도 좋습니다.

더 알아보기 (Learn more)