Skip to contentSkip to content

ChatComposerLabel API

API reference docs for the React ChatComposerLabel component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

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

Learn about the difference by reading this guide on minimizing bundle size.

Props

NameTypeDescription
childrennode

Label text. Falls back to the locale text composerInputAriaLabel when omitted, so the default is consistent with the textarea's aria-label.

htmlForstring

The id of the textarea this label is associated with. Passed directly to the native htmlFor attribute. When provided, the label is semantically linked to the textarea so that clicking the label focuses the input and screen readers announce it on focus.

The component cannot hold a ref.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

Class nameRule nameDescription
.Mui-disabledStyles applied to the root element when disabled.
.MuiChatComposerLabel-attachButtonattachButtonStyles applied to the attach button element.
.MuiChatComposerLabel-attachmentListattachmentListStyles applied to the attachment list element.
.MuiChatComposerLabel-helperTexthelperTextStyles applied to the helper text element.
.MuiChatComposerLabel-labellabelStyles applied to the input label element.
.MuiChatComposerLabel-rootrootStyles applied to the input root element.
.MuiChatComposerLabel-sendButtonsendButtonStyles applied to the send button element.
.MuiChatComposerLabel-textAreatextAreaStyles applied to the textarea element.
.MuiChatComposerLabel-toolbartoolbarStyles applied to the toolbar element.
.MuiChatComposerLabel-variantCompactvariantCompactStyles applied to the root element when variant="compact".

You can override the style of the component using one of these customization options:

Source code

If you did not find the information in this page, consider having a look at the implementation of the component for more detail.