Skip to content

Rich message field

Pro

A message field that formats as you type, with markers in plain text: bold, italic, strike, code, links, lists, quotes and code blocks, with a formatting toolbar, and suggestions while typing (@mentions of people, #tags and emoji after :); plus FormattedText, which shows what it wrote. Not an M3 component (@windmorph/react-pro/rich-text, with Tiptap).

import { RichMessageField, FormattingToolbar, FormattedText, useRichMessageField } from '@windmorph/react-pro/rich-text';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Props

By name or description, across the 81 props below

RichMessageField 63 props

  • maxLengthtype number

    The most characters of the stored text, in the marker format, which the counter counts too: markers and mentions count as stored (*bold* is 6, a mention <@u1|Alex Kim> 14), as an app's limit on the text it saves would. Characters are counted as people see them (grapheme clusters): an emoji sequence, a flag or a letter with a combining accent is one, whatever its UTF-16 length, so a limit in UTF-16 units or bytes on the server needs its own check. The text may go over: the counter then shows in the error colour, the field is invalid and Send waits.

  • valuetype string

    The text in the marker format (controlled).

  • defaultValuetype stringdefault ""

    The text at first, in the marker format (uncontrolled).

  • submitOntype "enter" | "mod-enter" | "none"default "enter"

    When Enter sends: enter (Shift+Enter is a new line), mod-enter (Ctrl/⌘+Enter) or none (only the send button). On touch screens Enter is always a new line.

  • clearOnSubmittype booleandefault false

    Empty the field after onSubmit.

  • placeholdertype string

    Hint inside the field, on one line, ending in … where it doesn't fit.

  • idtype stringdefault a generated id

    The text box's id (the editor's), so a <label for> or an error summary link reaches it.

  • formattingtype "none" | "toggle" | "always"default "toggle"

    How the field offers formatting: toggle, an Aa tool shows and hides the formatting toolbar (comments, replies, phones); always, the toolbar stays (a post's composer on larger windows); none, no toolbar (the markers and shortcuts still work).

  • formattingPlacementtype "auto" | "top" | "bottom"default "auto"

    Where the formatting toolbar sits.

  • formattingToolbartype Pick<FormattingToolbarProps, "classNames" | "groups" | "icons">

    The formatting toolbar's groups and icons.

  • formattingIcontype ReactElement<unknown, string | JSXElementConstructor<any>>

    Replaces the Aa tool's icon.

  • minRowstype numberdefault 1

    The height it keeps when there's less, in lines.

  • maxRowstype numberdefault 10

    Lines after which the text scrolls inside the field.

  • autoFocustype boolean

    Focuses the text when the field appears, without jumping the page: the field glides into view only if it's off screen (at once with reduced motion).

  • mentionstype MentionSuggestionsOptions

    Mentions: @ and a name suggest people from search (the app decides who and in what order), and choosing one puts them in as one token, stored as <@id|Name>. Without it, @ is just a character.

  • tagstype TagSuggestionsOptions

    Tags: # and a word suggest tags from search, and choosing one puts it in as one token, #tag, stored as <#id|tag> (FormattedText shows it). A tag typed that isn't chosen stays text. Without it, # is just a character.

  • emojiSuggestionstype EmojiSuggestionSource

    Emoji: : and two letters (:sm) suggest emoji, and choosing one puts it in place of :sm. Built by createEmojiSuggestions from @windmorph/react-pro/emoji-picker, which holds the data and the options (minChars, replaceOnColon, maxItems, emoticons), so a field without it never loads the emoji data. Off without it.

  • handleReftype Ref<RichMessageFieldHandle>

    insertText, focus, clear and the formatting commands, for the app.

  • sendabletype boolean

    Whether there's something to send. Left out, any text is; set it when attachments count (a photo alone can be sent) or must finish first (an upload still running). Text over maxLength never sends.

  • pendingtype booleandefault false

    The send is in flight (React 19's word for an action under way): Send ignores presses, its name gains labels.sending, which is announced politely, and its loading indicator shows after 200ms.

  • sendtype booleandefault true

    Show the send button.

  • sendVarianttype "filled" | "standard"default "filled"

    filled: a filled circle, as the search bar's action. standard: the icon alone, in the send-color token (primary), a quieter Send beside icon tools.

  • sendIcontype ReactNode

    Replaces the send icon.

  • emptyActiontype ReactNode

    Shown in Send's place while there's nothing to send, e.g. a microphone button.

  • supportingTexttype ReactNode

    Helper text under the field.

  • errorMessagetype ReactNode

    Shown under the field, in the error roles, while invalid; announced when it appears.

  • invalidtype boolean

    Marks the field invalid. A send that ends while invalid shakes the field once.

  • countertype booleandefault false

    Always show the counter (with maxLength), not only from counterThreshold.

  • counterThresholdtype numberdefault 0.9

    The share of maxLength (0–1) from which the counter shows and is announced.

  • sizetype "sm" | "md" | "lg"default "md"

    One-line height: sm 40px, md 48px, lg 56px.

  • varianttype "filled" | "tonal" | "outlined"default "filled"

    The container: filled (surface-container-high), tonal (secondary-container) or outlined (a transparent pill with an outline border).

  • leadingtype ReactNode

    Before the text, centred on its first line: an avatar or icon buttons.

  • trailingtype ReactNode

    Icon buttons after the text, before Send.

  • toolstype ReactNode

    Tools: icon buttons with their own actions (emoji, attach, GIF), in a toolbar (one Tab stop, arrow keys between them). They sit at the end of the text row and, with expandOnFocus, move to their own row when the field opens. They get the field's size and disabled state; useMessageField() lets them insert text.

  • expandOnFocustype booleandefault false

    Opens the field on its first focus, growing from a one-line pill into two rows: the text takes the first row, and the tools and Send move to a second one. It stays open, so the page doesn't move each time focus leaves. It also opens with anything in it.

  • defaultOpentype booleandefault false

    With expandOnFocus, starts open rather than as the pill: a field that appears focused (autoFocus, a reply under a comment) is there at full height, with no opening to run alongside whatever reveals it.

  • toolsWhenIdletype "hidden" | "inline"default "inline"

    Where the tools are while the field is closed (expandOnFocus).

  • bannertype ReactNode

    A row above the text inside the field, such as "Replying to Alex".

  • closeIcontype ReactElement<unknown, string | JSXElementConstructor<any>>

    Replaces the banner's close icon.

  • toolbarPlacementtype "auto" | "top" | "bottom"default "auto"

    Where the toolbar row sits in the open field: top, above the text; bottom, between the text and the tools (in thumb reach on phones); auto, bottom on compact windows and top from medium. Below the text, the row also follows it in the page, so Tab reaches the rows in the order they show.

  • attachmentstype ReactNode

    A row of content above the text inside the field, such as MediaUploadGrid.

  • accepttype readonly string[]

    File types onFileAccept takes: MIME types, wildcards (image/*) or extensions (.pdf). A file's type comes from the system and can differ from the one you expect (a CSV is application/vnd.ms-excel where a spreadsheet app owns the extension), so list the extensions too: ['text/csv', '.csv'].

  • dockedtype boolean | "when-open"default false

    Square corners, as a footer edge to edge with its container (a card's comment field), morphing from the pill on the field's spring. when-open docks once the field opens (expandOnFocus) and stays docked, as it stays open. Where it sits is the app's (className and classNames.field, which data-docked styles).

  • requiredtype booleandefault false

    The field must be filled in (aria-required); the label gets an asterisk.

  • disabledtype booleandefault false

    Disables the field, its slots and its tools.

  • readOnlytype booleandefault false

    The text can be read and selected but not changed; Send hides.

  • reftype Ref<HTMLDivElement>

    The root element.

  • labeltype ReactNode

    The visible label above the field. Give it, aria-label or aria-labelledby: the placeholder is never the only name.

Events

  • onChangetype ((value: string) => void)

    The text in the marker format, as it changes.

  • onSubmittype ((value: string) => void)

    Enter (see submitOn) or Send, with the trimmed text in the marker format.

  • onEscapetype (() => void)

    Escape in the field, e.g. to cancel a reply (once no suggestion list shows).

  • onBannerClosetype (() => void)

    Shows a close button on the banner, e.g. to cancel the reply.

  • onFilePicktype ((pick: FilePick) => void)

    Called once for each paste or drop onto the field that brings files, with every file it brought: the files taken and the files refused with their reasons, in the order they came (accepted is empty when every file was refused, rejected when none was). Called first, then onFileAccept and onFileReject, all in the same task, so an app can treat a paste or drop as one thing (add what fits, and say once what was left out). A paste the field leaves as text calls nothing.

  • onFileAccepttype ((files: File[]) => void)

    Called with files pasted or dropped onto the field that match accept. Without it or onFilePick, files are ignored.

  • onFileRejecttype ((rejections: FileRejection[]) => void)

    Called with the files a paste or drop brought that don't match accept (reason type), after onFileAccept; never with an empty list. Only while the field takes files (onFileAccept or onFilePick, not disabled or read-only). A paste whose HTML holds words is a text paste whatever files it carries (copied cells or a document bring a picture of themselves), neither taken nor reported; one with no file taken goes on as usual, reporting its files unless it carries plain text (a copied file's name).

Text

  • aria-describedbytype string

    More ids describing the text box, after the supporting text and error.

  • aria-detailstype string

    The id of an element with more details about the field.

  • labelstype Partial<RichMessageFieldLabels>

    Every word the field says, from the app’s translations; each key’s default is on RichMessageFieldLabels. A LabelsProvider sets them for the whole app.

  • aria-labeltype string

    Names the field for screen readers when there's no visible label, e.g. "Write a comment".

  • aria-labelledbytype string

    The id of a visible element that names the field, instead of label.

Also accepts the root element's HTML attributes (id, data-*, event handlers).

FormattingToolbar 6 props

  • groupstype readonly (readonly RichTextFormat[])[]default the words, then the blocks

    Which buttons, in groups a divider separates.

  • iconstype Partial<Record<RichTextFormat, ReactElement<unknown, string | JSXElementConstructor<any>>>>

    Replaces a format's icon.

  • reftype Ref<HTMLDivElement>

    The toolbar element. Its other props (id, style, aria-*, data-*) go to it too.

Also accepts the root element's HTML attributes (id, data-*, event handlers).

FormattedText 12 props

  • texttype stringRequired

    Text in the marker format, as RichMessageField writes it.

  • linkReltype stringdefault "ugc nofollow noopener noreferrer"

    rel on links to other sites: people's own links get ugc nofollow too.

  • internalLinkReltype string

    rel on the app's own links (internalLinks): none by default, they're the site's pages.

  • renderMentiontype ((mention: { id: string; label: string; }) => ReactNode)

    How a mention (<@id|Name>) shows, in place of the default @Name in the mention colour: usually a link to the person with the wm-mention class (the colour and weight), or their name as plain text when the reader can't see them.

  • renderTagtype ((tag: { id: string; label: string; }) => ReactNode)

    How a tag (<#id|tag>) shows, in place of the default #tag in the tag colour: usually a link to the tag's page with the wm-tag class (the colour and weight).

  • reftype Ref<HTMLDivElement>

    The root <div>. Its other props (id, aria-*, data-*) go to it too.

Text

  • labelstype Partial<LinkLabels>

    The words the links say to screen readers, from the app’s translations; each key’s default is on LinkLabels. A LabelsProvider sets them for the whole app.

Also accepts the root element's HTML attributes (id, data-*, event handlers).

Hooks

useRichMessageField

useRichMessageField signature
useRichMessageField(): RichMessageFieldContextValue

For FormattingToolbar or a custom formatting control inside a RichMessageField.

Returns RichMessageFieldContextValue

  • activetype Readonly<Record<RichTextFormat, boolean>>Required

    Which formats are on at the caret or across the selection.

  • toggletype (format: RichTextFormat) => voidRequired

    Toggles a format; link asks for the address, or takes the link off.

  • labelstype Pick<RichMessageFieldLabels, RichTextFormat | "formatting">Required

    The field's names for its formatting buttons and their toolbar (its labels, with their English defaults), so a toolbar built on this context reads the same words.

Spec status

Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.

  • Formatting toolbar on demand (formatting="toggle")

    Built

    Configuration · Comment

  • Formatting toolbar always shown, at the top

    Built

    Configuration · Post

  • Mentions

    Built

    Configuration · Mentions

  • Tags and emoji suggested while typing (tags, emojiSuggestions)

    Built

    Configuration · Suggestions

  • Showing what it wrote (FormattedText)

    Built

    Use case · Comment, Mentions

  • A post's composer

    Built

    Use case · Post

  • In a dialog, with a smaller corner than the dialog’s (--wm-message-field-grown-corner)

    Built

    Use case · Dialog

  • Formatting as you type

    Extension

    The message field’s frame with a rich-text editor (Tiptap, an optional peer dependency), handing out plain markers that FormattedText shows.

Mentions, tags and emoji

  • The field suggests as you type, as MessageField does, with the same props: mentions (@ and a name), tags (# and a word) and emojiSuggestions (: and two letters, a source built once by createEmojiSuggestions() from @windmorph/react-pro/emoji-picker). The trigger rules, keys and list are the same in both fields; see Message field's Suggestions while typing.
  • mentions.search(query, { signal }) and tags.search(query, { signal }) return what to suggest, best first: the app decides who and which tags, and how they match. They run after a short pause in typing; signal is aborted once a newer query has replaced the search or the list has closed, and an older answer is ignored, so the loading row follows the latest search only. One that takes a while shows that loading row, and one that fails shows nothing. maxItems caps the list (8).
  • The list opens above the field first, and below where there's no room, drawn as the core's menu: its container, elevation 2, state layers and the pressed ripple. Arrows move (the active suggestion shows keyboard focus), Enter or Tab puts it in, Escape dismisses the list while it shows, and pressing a suggestion picks it; focus stays in the text throughout. The "N people", "N tags" or "N emoji" status is in the page before its first count, so screen readers announce it.
  • A picked person is one @Name token (Backspace takes it out whole), stored as <@id|Name>: the id finds the person later, and the name written stays for anyone who can't see them. A picked tag is one #tag token, stored as <#id|tag>; a tag typed and not picked stays text. An emoji goes in as text. mentionMarker(id, name) and tagMarker(id, tag) write a token; an id's spaces, |, < and > are percent-encoded (and a % that would read as an escape), so any non-empty id reads back as written.
  • FormattedText shows a mention as @Name in the mention colour and a tag as #tag in the tag colour (the mention's, by default), or as renderMention and renderTag draw them: usually a link with the wm-mention or wm-tag class to the person or the tag's page, or the name as plain text.
  • markersToPlainText(text, { mention, tag }) gives the words without the markers, for a page's title and description, a link preview or a notification: mentions read @Name and tags #tag, or as mention and tag write them (a person's current name, say).
  • The list's words are the MessageField labels keys (mentionSuggestions, tagSuggestions, emojiSuggestions and their Loading and Results words), which a LabelsProvider sets under its MessageField key, or its RichMessageField key for this field alone.
  • The suggestion list's rows follow density as the core menu's do (44px at 0, 32px at −3).

Theming & tokens

The field takes every --wm-message-field-* token (see Message field); inside a dialog, a card or a sheet, give the grown field a smaller corner than the container's (--wm-message-field-grown-corner), as the dialog example does. The formatted text, while writing and in FormattedText, takes these, on the text or any ancestor: bold and mentions use the emphasized body weight (tags take the mention's colour and weight unless --wm-rich-text-tag-color or --wm-rich-text-tag-weight says otherwise), inline code keeps the text's size and code blocks are body-medium. classNames reaches the field's parts and, through formattingToolbar, the toolbar's root, button and divider; formattingIcon and formattingToolbar.icons replace the icons.

Rich text tokens
VariableDefaultPaints
--wm-rich-text-code-colorvar(--md-sys-color-tertiary)Inline `code`’s text.
--wm-rich-text-code-containervar(--md-sys-color-surface-container-lowest)Inline `code`’s and code blocks’ background.
--wm-rich-text-code-outlinevar(--md-sys-color-outline-variant)The hairline around inline `code` and code blocks.
--wm-rich-text-code-cornervar(--md-sys-shape-corner-extra-small)Inline `code`’s corners.
--wm-rich-text-code-fontvar(--md-ref-typeface-mono)Code’s typeface.
--wm-rich-text-code-size1emInline `code`’s size: the surrounding text’s, so it stays on its type role.
--wm-rich-text-code-block-colorvar(--md-sys-color-on-surface)A code block’s text.
--wm-rich-text-code-block-cornervar(--md-sys-shape-corner-small)A code block’s corners.
--wm-rich-text-code-block-sizevar(--md-sys-typescale-body-medium-size)A code block’s text size (`body-medium`).
--wm-rich-text-code-block-line-heightvar(--md-sys-typescale-body-medium-line-height)A code block’s line height (`body-medium`).
--wm-rich-text-quote-barvar(--md-sys-color-outline)The bar beside a quote.
--wm-rich-text-quote-bar-width3pxIts width.
--wm-rich-text-link-colorvar(--md-sys-color-primary)Links while writing.
--wm-rich-text-mention-colorvar(--md-sys-color-primary)Mentions (`@Name`).
--wm-rich-text-mention-weightvar(--md-sys-typescale-body-large-emphasized-weight)Mentions’ weight (the emphasized body weight).
--wm-rich-text-tag-colorvar(--_wm-rich-text-mention-color)Tags (`#tag`): the mention colour.
--wm-rich-text-tag-weightvar(--_wm-rich-text-mention-weight)Tags’ weight: the mention weight.
--wm-rich-text-strong-weightvar(--md-sys-typescale-body-large-emphasized-weight)Bold text’s weight (the emphasized body weight).
--wm-rich-text-list-indent20pxHow far list items sit in.
--wm-rich-text-block-gap4pxAbove and below quotes, lists and code blocks.

The suggestion list (for people, tags and emoji) carries the core menu's tokens, and its container, corner and label-color default to the --md-comp-menus-* ones, so an app's menu theme reaches it too. Its own tokens are these. It renders in a popover outside the field, so set them on :root or a theme wrapper, or for one field in the classNames.list of mentions, tags or the emoji source (for example [--wm-mention-list-corner:8px]). Each classNames also reaches its item, avatar, icon, label, description and loading, with Tailwind classes that win over the defaults.

Suggestion list tokens
VariableDefaultPaints
--wm-mention-list-containervar(--_md-comp-menus-container-color)The list’s background: the core menu’s container colour.
--wm-mention-list-cornervar(--_md-comp-menus-container-shape)The list’s corners: the core menu’s container shape.
--wm-mention-list-padding4pxBetween the list’s edge and its suggestions.
--wm-mention-list-max-heightcalc(5.5 * (56px + var(--md-sys-density, 0) * 4px) + 8px)How tall it grows: five and a half suggestions, so a cut-off one shows there’s more (rows lose 4px a density step).
--wm-mention-list-one-line-max-heightcalc(5.5 * (44px + var(--md-sys-density, 0) * 4px) + 8px)How tall it grows when no row has a second line (emoji, most tags): five and a half rows.
--wm-mention-list-item-cornervar(--md-sys-shape-corner-medium)The first and last suggestion’s outer corners, nested in the list’s (16 − 4).
--wm-mention-list-item-corner-innervar(--md-sys-shape-corner-extra-small)The corners between suggestions.
--wm-mention-list-item-min-heightcalc(44px + var(--md-sys-density, 0) * 4px)A suggestion’s least height: the core menu item’s, 44px at density 0 and 4px less a step (32px at −3).
--wm-mention-list-item-padding-inline12pxInside a suggestion’s row, at its sides.
--wm-mention-list-item-padding-blockcalc(8px + var(--md-sys-density, 0) * 2px)Inside a suggestion’s row, above and below, when it has a description: 8px, 2px less a density step, as the core menu’s.
--wm-mention-list-avatar-gap12pxBetween a person’s avatar and the label.
--wm-mention-list-icon-size24pxThe box of a tag’s icon, an emoji or a custom emoji’s image.
--wm-mention-list-icon-colorvar(--md-sys-color-on-surface-variant)A tag’s icon.
--wm-mention-list-emoji-font"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", "Segoe UI Symbol", sans-serifThe emoji’s typeface: each platform’s colour emoji font, as the emoji picker’s.
--wm-mention-list-emoji-size20pxThe emoji’s size.
--wm-mention-list-label-colorvar(--_md-comp-menus-menu-item-label-text-color)The label (a name, a tag, an emoji’s shortcode): the core menu item’s label colour.
--wm-mention-list-label-fontvar(--md-sys-typescale-label-large-font)The label’s typeface.
--wm-mention-list-label-sizevar(--md-sys-typescale-label-large-size)The label’s size.
--wm-mention-list-label-line-heightvar(--md-sys-typescale-label-large-line-height)The label’s line height.
--wm-mention-list-label-weightvar(--md-sys-typescale-label-large-weight)The label’s weight.
--wm-mention-list-description-colorvar(--md-sys-color-on-surface-variant)The second line (`@username · Friend`).
--wm-mention-list-description-fontvar(--md-sys-typescale-body-medium-font)The second line’s typeface.
--wm-mention-list-description-sizevar(--md-sys-typescale-body-medium-size)The second line’s size.
--wm-mention-list-description-weightvar(--md-sys-typescale-body-medium-weight)The second line’s weight.
--wm-mention-list-description-line-heightvar(--md-sys-typescale-body-medium-line-height)The second line’s line height.
--wm-mention-list-active-layervar(--md-sys-color-on-surface)The highlight on the active suggestion: this colour at the hover state layer’s opacity.
The field's own tokens
Message field tokens
VariableDefaultPaints
--wm-message-field-containervar(--md-sys-color-surface-container-high)Varies with variant.The field’s background.
--wm-message-field-contentvar(--md-sys-color-on-surface)Varies with variant.The text.
--wm-message-field-placeholdervar(--md-sys-color-on-surface-variant)Varies with variant.The placeholder, the banner’s text and the icons in the slots and tools.
--wm-message-field-outlinetransparentVaries with variant.The 1px border.
--wm-message-field-caretvar(--md-sys-color-primary)The text cursor.
--wm-message-field-focus-outlinevar(--md-sys-color-primary)The border of a focused outlined field, and of any field while files are dragged over it.
--wm-message-field-errorvar(--md-sys-color-error)The border while invalid, and the counter over the limit.
--wm-message-field-disabled-containercolor-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-container-opacity) * 100%), transparent)Varies with variant.The background while disabled.
--wm-message-field-disabled-contentcolor-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity) * 100%), transparent)The text, placeholder and icons while disabled.
--wm-message-field-disabled-outlinetransparentVaries with variant.The border while disabled.
--wm-message-field-labelvar(--md-sys-color-on-surface-variant)The visible label above the field.
--wm-message-field-supporting-textvar(--md-sys-color-on-surface-variant)The supporting text under the field.
--wm-message-field-countervar(--md-sys-color-on-surface-variant)The character counter.
--wm-message-field-send-colorvar(--md-sys-color-primary)The send icon with `sendVariant="standard"`.
--wm-message-field-cornervar(--md-sys-shape-corner-full)One line’s corners, capped at half the height (a pill by default).
--wm-message-field-grown-cornervar(--md-sys-shape-corner-extra-large)The corners once the field grows: wrapped text, a row, or open. Inside a container with corners of its own (a dialog, a card, a sheet), set a smaller one than the container’s, such as `large`.
--wm-message-field-docked-cornervar(--md-sys-shape-corner-none)The corners while `docked`.
--wm-message-field-pressed-cornervar(--md-sys-shape-corner-medium)Varies with size.MessageFieldTrigger’s corners while pressed.
--wm-message-field-height48pxVaries with size.The one-line height, the border included.
--wm-message-field-padding-inline16pxVaries with size.Between the edge and the text when no slot is there.
--wm-message-field-gap8pxVaries with size.Between a slot and the text.
--wm-message-field-slot-gap8pxVaries with size.Between the items of a slot or the tools: 48px less the buttons’ height, so their 48px touch targets don’t overlap.
--wm-message-field-button-extent40pxVaries with size.The slot buttons’ height, which centres them on one line. Set it with the buttons’ size.
--wm-message-field-text-fontvar(--md-sys-typescale-body-large-font)Varies with size.The text’s typeface.
--wm-message-field-text-sizevar(--md-sys-typescale-body-large-size)Varies with size.The text’s size.
--wm-message-field-text-line-heightvar(--md-sys-typescale-body-large-line-height)Varies with size.The text’s line height.
--wm-message-field-text-trackingvar(--md-sys-typescale-body-large-tracking)Varies with size.The text’s letter spacing.
--wm-message-field-text-weightvar(--md-sys-typescale-body-large-weight)Varies with size.The text’s weight.
--wm-message-field-spring-durationvar(--md-sys-motion-spring-spatial-default-duration)How long growing, shrinking, opening and docking take (follows the motion scheme).
--wm-message-field-spring-easingvar(--md-sys-motion-spring-spatial-default-easing)Their spring curve.
--wm-message-field-shrink-easingvar(--md-sys-motion-spring-effects-default-easing)The curve as the text box gets shorter (over the same duration): the effects spring, which never overshoots, so the text is never clipped and bounced back.
--wm-message-field-label-padding-inline16pxThe visible label’s inset from the field’s start edge.
--wm-message-field-label-gap4pxBetween the visible label and the field.
--wm-message-field-supporting-padding-inline16pxThe supporting text, error and counter’s inset from the field’s edges.
--wm-message-field-supporting-gap4pxBetween the field and the supporting text, error and counter under it.
--wm-message-field-counter-gap16pxBetween the supporting text and the counter.
--wm-message-field-row-padding-top4pxAbove the banner, and above the formatting row when it’s on top.
--wm-message-field-banner-min-height44pxThe banner row’s least height (“Replying to …”).
--wm-message-field-attachments-padding8pxAround the attachments row, at its sides and above it.
--wm-message-field-icon-size24pxMessageFieldTrigger’s trailing icon (M3’s 24px icon).