Rich message field
ProA 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
RichMessageField 63 props
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.The text in the marker format (controlled).
The text at first, in the marker format (uncontrolled).
When Enter sends:
enter(Shift+Enter is a new line),mod-enter(Ctrl/⌘+Enter) ornone(only the send button). On touch screens Enter is always a new line.Empty the field after
onSubmit.Hint inside the field, on one line, ending in … where it doesn't fit.
The text box's id (the editor's), so a
<label for>or an error summary link reaches it.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).Where the formatting toolbar sits.
The formatting toolbar's groups and icons.
Replaces the Aa tool's icon.
The height it keeps when there's less, in lines.
Lines after which the text scrolls inside the field.
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).
Mentions:
@and a name suggest people fromsearch(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.Emoji:
:and two letters (:sm) suggest emoji, and choosing one puts it in place of:sm. Built bycreateEmojiSuggestionsfrom@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.insertText,focus,clearand the formatting commands, for the app.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
maxLengthnever sends.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.Show the send button.
filled: a filled circle, as the search bar's action.standard: the icon alone, in thesend-colortoken (primary), a quieter Send beside icon tools.Replaces the send icon.
Shown in Send's place while there's nothing to send, e.g. a microphone button.
Helper text under the field.
Shown under the field, in the error roles, while
invalid; announced when it appears.Marks the field invalid. A send that ends while invalid shakes the field once.
Always show the counter (with
maxLength), not only fromcounterThreshold.The share of
maxLength(0–1) from which the counter shows and is announced.One-line height:
sm40px,md48px,lg56px.The container:
filled(surface-container-high),tonal(secondary-container) oroutlined(a transparent pill with anoutlineborder).Before the text, centred on its first line: an avatar or icon buttons.
Icon buttons after the text, before Send.
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.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.
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.Where the tools are while the field is closed (
expandOnFocus).Replaces the banner's close icon.
Where the
toolbarrow 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.A row of content above the text inside the field, such as
MediaUploadGrid.File types
onFileAccepttakes: 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 isapplication/vnd.ms-excelwhere a spreadsheet app owns the extension), so list the extensions too:['text/csv', '.csv'].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-opendocks once the field opens (expandOnFocus) and stays docked, as it stays open. Where it sits is the app's (classNameandclassNames.field, whichdata-dockedstyles).The field must be filled in (
aria-required); the label gets an asterisk.Disables the field, its slots and its tools.
The text can be read and selected but not changed; Send hides.
The root element.
The visible label above the field. Give it,
aria-labeloraria-labelledby: the placeholder is never the only name.
Events
The text in the marker format, as it changes.
Enter (see
submitOn) or Send, with the trimmed text in the marker format.Escape in the field, e.g. to cancel a reply (once no suggestion list shows).
Shows a close button on the banner, e.g. to cancel the reply.
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 (
acceptedis empty when every file was refused,rejectedwhen none was). Called first, thenonFileAcceptandonFileReject, 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.Called with files pasted or dropped onto the field that match
accept. Without it oronFilePick, files are ignored.Called with the files a paste or drop brought that don't match
accept(reasontype), afteronFileAccept; never with an empty list. Only while the field takes files (onFileAcceptoronFilePick, 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
More ids describing the text box, after the supporting text and error.
The id of an element with more details about the field.
Every word the field says, from the app’s translations; each key’s default is on
RichMessageFieldLabels. ALabelsProvidersets them for the whole app.The Aa button, and the formatting toolbar's name.
The bold button.
The italic button.
The strikethrough button.
The inline code button.
The link button, which asks for an address or takes the link off.
The bulleted list button.
The numbered list button.
The quote button.
The code block button.
The link dialog's title.
Its address field.
Its confirm button.
The link dialog's Cancel button.
The send button's name and tooltip.
Added to Send's name while
pending("Send, Sending"), and announced politely when a send starts.The banner's close button.
labels.countertype(count: number, max: number) => stringdefault"1,840 / 2,000", in the locale's digitsThe visible counter.
The tools toolbar's name.
The list of people
@suggests (withmentions).The list's loading indicator, while a search for people runs a while.
What the list's status says.
The list of tags
#suggests (withtags).The list's loading indicator, while a search for tags runs a while.
What the tag list's status says.
The list of emoji
:suggests (withemojiSuggestions).The list's loading indicator, while the emoji data loads.
What the emoji list's status says.
labels.nearLimittype(left: number) => stringdefault (left) =>${left} characters left("1 character left")Announced once the counter's threshold is reached.
Announced when the text reaches
maxLength.labels.overLimittype(over: number) => stringdefault (over) =>${over} characters over the limit("1 character over the limit")Announced when the text goes over
maxLength.
Names the field for screen readers when there's no visible
label, e.g. "Write a comment".The id of a visible element that names the field, instead of
label.
Classes for the root; consumer classes always win.
Classes for each part, merged after the defaults.
The root, holding the label, the field and the supporting text; merged with
className.The visible
label.The rounded field holding the rows and the text.
The toolbar row's content (a formatting row).
The attachments row's content.
The panel slot below the field, where a tool can dock (the emoji picker on phones).
The panel slot above the field (before its label), where a tool can dock from the medium window size (the emoji picker on a computer), taking the room of what's above the field. In the page only while a tool is docked there.
The
leadingslot (before the text).The text box: the
<textarea>or the rich editor.The
toolstoolbar.The
trailingslot, holdingtrailingand Send oremptyAction.The send button's parts.
The cell holding
emptyAction.The supporting text or error message.
The visible character counter.
Inline styles for the root, e.g. a
--wm-message-field-*token.
Also accepts the root element's HTML attributes (id, data-*, event handlers).
FormattingToolbar 6 props
Classes for the toolbar; consumer classes always win.
Classes for each part, merged after the defaults.
Inline styles for the root element.
Also accepts the root element's HTML attributes (id, data-*, event handlers).
FormattedText 12 props
Text in the marker format, as
RichMessageFieldwrites it.Links as links (http and https only: other sites' in a new tab, the app's own, picked by
internalLinks, in the same one), or as plain words inside something pressable, such as a comment bubble that opens the conversation, where a link can't go.relon links to other sites: people's own links getugc nofollowtoo.The app's own links (another post, a profile): a link this returns true for is an ordinary link in the same tab, with no new-tab mark or words. One on the page's own origin goes through the app's React Aria
RouterProvider, whosenavigategets the link as written (a fullhttps://…address); for a router that wants a path, userenderLinkwith the link'spath, never the URL's rawpathname, which can name another site (//other.example/x). An address whose path starts with//is never one of the app's own, whatever this says. It runs as the text renders, on the server too, so it must answer the same there: compare with a constant origin, neverlocation.relon the app's own links (internalLinks): none by default, they're the site's pages.Renders a link yourself, for instance the app's own through its router's link component (
<RouterLink href={link.path}>). Returnundefinedto keep the default for that link (a new tab for other sites), as does a boolean (a failedcond && …);nullrenders nothing in its place, the link and its words alike. A link whose address can't be parsed isn't offered to it, and shows as a link to another site.How a mention (
<@id|Name>) shows, in place of the default@Namein the mention colour: usually a link to the person with thewm-mentionclass (the colour and weight), or their name as plain text when the reader can't see them.How a tag (
<#id|tag>) shows, in place of the default#tagin the tag colour: usually a link to the tag's page with thewm-tagclass (the colour and weight).The root
<div>. Its other props (id,aria-*,data-*) go to it too.
Text
The words the links say to screen readers, from the app’s translations; each key’s default is on
LinkLabels. ALabelsProvidersets them for the whole app.
Also accepts the root element's HTML attributes (id, data-*, event handlers).
Hooks
useRichMessageField
For FormattingToolbar or a custom formatting control inside a RichMessageField.
Returns RichMessageFieldContextValue
Which formats are on at the caret or across the selection.
Toggles a format;
linkasks for the address, or takes the link off.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.
| Item | Status | Details |
|---|---|---|
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. |
Formatting toolbar on demand (
Builtformatting="toggle")Configuration · Comment
Formatting toolbar always shown, at the top
BuiltConfiguration · Post
Mentions
BuiltConfiguration · Mentions
Tags and emoji suggested while typing (
Builttags,emojiSuggestions)Configuration · Suggestions
A post's composer
BuiltUse case · Post
In a dialog, with a smaller corner than the dialog’s (
Built--wm-message-field-grown-corner)Use case · Dialog
Formatting as you type
ExtensionThe message field’s frame with a rich-text editor (Tiptap, an optional peer dependency), handing out plain markers that
FormattedTextshows.
Mentions, tags and emoji
- The field suggests as you type, as
MessageFielddoes, with the same props:mentions(@and a name),tags(#and a word) andemojiSuggestions(:and two letters, a source built once bycreateEmojiSuggestions()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 })andtags.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;signalis 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.maxItemscaps 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
@Nametoken (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#tagtoken, stored as<#id|tag>; a tag typed and not picked stays text. An emoji goes in as text.mentionMarker(id, name)andtagMarker(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. FormattedTextshows a mention as@Namein the mention colour and a tag as#tagin the tag colour (the mention's, by default), or asrenderMentionandrenderTagdraw them: usually a link with thewm-mentionorwm-tagclass 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@Nameand tags#tag, or asmentionandtagwrite them (a person's current name, say).- The list's words are the
MessageFieldlabelskeys (mentionSuggestions,tagSuggestions,emojiSuggestionsand theirLoadingandResultswords), which aLabelsProvidersets under itsMessageFieldkey, or itsRichMessageFieldkey 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.
| Variable | Default | Paints |
|---|---|---|
--wm-rich-text-code-color | var(--md-sys-color-tertiary) | Inline `code`’s text. |
--wm-rich-text-code-container | var(--md-sys-color-surface-container-lowest) | Inline `code`’s and code blocks’ background. |
--wm-rich-text-code-outline | var(--md-sys-color-outline-variant) | The hairline around inline `code` and code blocks. |
--wm-rich-text-code-corner | var(--md-sys-shape-corner-extra-small) | Inline `code`’s corners. |
--wm-rich-text-code-font | var(--md-ref-typeface-mono) | Code’s typeface. |
--wm-rich-text-code-size | 1em | Inline `code`’s size: the surrounding text’s, so it stays on its type role. |
--wm-rich-text-code-block-color | var(--md-sys-color-on-surface) | A code block’s text. |
--wm-rich-text-code-block-corner | var(--md-sys-shape-corner-small) | A code block’s corners. |
--wm-rich-text-code-block-size | var(--md-sys-typescale-body-medium-size) | A code block’s text size (`body-medium`). |
--wm-rich-text-code-block-line-height | var(--md-sys-typescale-body-medium-line-height) | A code block’s line height (`body-medium`). |
--wm-rich-text-quote-bar | var(--md-sys-color-outline) | The bar beside a quote. |
--wm-rich-text-quote-bar-width | 3px | Its width. |
--wm-rich-text-link-color | var(--md-sys-color-primary) | Links while writing. |
--wm-rich-text-mention-color | var(--md-sys-color-primary) | Mentions (`@Name`). |
--wm-rich-text-mention-weight | var(--md-sys-typescale-body-large-emphasized-weight) | Mentions’ weight (the emphasized body weight). |
--wm-rich-text-tag-color | var(--_wm-rich-text-mention-color) | Tags (`#tag`): the mention colour. |
--wm-rich-text-tag-weight | var(--_wm-rich-text-mention-weight) | Tags’ weight: the mention weight. |
--wm-rich-text-strong-weight | var(--md-sys-typescale-body-large-emphasized-weight) | Bold text’s weight (the emphasized body weight). |
--wm-rich-text-list-indent | 20px | How far list items sit in. |
--wm-rich-text-block-gap | 4px | Above 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.
| Variable | Default | Paints |
|---|---|---|
--wm-mention-list-container | var(--_md-comp-menus-container-color) | The list’s background: the core menu’s container colour. |
--wm-mention-list-corner | var(--_md-comp-menus-container-shape) | The list’s corners: the core menu’s container shape. |
--wm-mention-list-padding | 4px | Between the list’s edge and its suggestions. |
--wm-mention-list-max-height | calc(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-height | calc(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-corner | var(--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-inner | var(--md-sys-shape-corner-extra-small) | The corners between suggestions. |
--wm-mention-list-item-min-height | calc(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-inline | 12px | Inside a suggestion’s row, at its sides. |
--wm-mention-list-item-padding-block | calc(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-gap | 12px | Between a person’s avatar and the label. |
--wm-mention-list-icon-size | 24px | The box of a tag’s icon, an emoji or a custom emoji’s image. |
--wm-mention-list-icon-color | var(--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-serif | The emoji’s typeface: each platform’s colour emoji font, as the emoji picker’s. |
--wm-mention-list-emoji-size | 20px | The emoji’s size. |
--wm-mention-list-label-color | var(--_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-font | var(--md-sys-typescale-label-large-font) | The label’s typeface. |
--wm-mention-list-label-size | var(--md-sys-typescale-label-large-size) | The label’s size. |
--wm-mention-list-label-line-height | var(--md-sys-typescale-label-large-line-height) | The label’s line height. |
--wm-mention-list-label-weight | var(--md-sys-typescale-label-large-weight) | The label’s weight. |
--wm-mention-list-description-color | var(--md-sys-color-on-surface-variant) | The second line (`@username · Friend`). |
--wm-mention-list-description-font | var(--md-sys-typescale-body-medium-font) | The second line’s typeface. |
--wm-mention-list-description-size | var(--md-sys-typescale-body-medium-size) | The second line’s size. |
--wm-mention-list-description-weight | var(--md-sys-typescale-body-medium-weight) | The second line’s weight. |
--wm-mention-list-description-line-height | var(--md-sys-typescale-body-medium-line-height) | The second line’s line height. |
--wm-mention-list-active-layer | var(--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
| Variable | Default | Paints |
|---|---|---|
--wm-message-field-container | var(--md-sys-color-surface-container-high)Varies with variant. | The field’s background. |
--wm-message-field-content | var(--md-sys-color-on-surface)Varies with variant. | The text. |
--wm-message-field-placeholder | var(--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-outline | transparentVaries with variant. | The 1px border. |
--wm-message-field-caret | var(--md-sys-color-primary) | The text cursor. |
--wm-message-field-focus-outline | var(--md-sys-color-primary) | The border of a focused outlined field, and of any field while files are dragged over it. |
--wm-message-field-error | var(--md-sys-color-error) | The border while invalid, and the counter over the limit. |
--wm-message-field-disabled-container | color-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-content | color-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-outline | transparentVaries with variant. | The border while disabled. |
--wm-message-field-label | var(--md-sys-color-on-surface-variant) | The visible label above the field. |
--wm-message-field-supporting-text | var(--md-sys-color-on-surface-variant) | The supporting text under the field. |
--wm-message-field-counter | var(--md-sys-color-on-surface-variant) | The character counter. |
--wm-message-field-send-color | var(--md-sys-color-primary) | The send icon with `sendVariant="standard"`. |
--wm-message-field-corner | var(--md-sys-shape-corner-full) | One line’s corners, capped at half the height (a pill by default). |
--wm-message-field-grown-corner | var(--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-corner | var(--md-sys-shape-corner-none) | The corners while `docked`. |
--wm-message-field-pressed-corner | var(--md-sys-shape-corner-medium)Varies with size. | MessageFieldTrigger’s corners while pressed. |
--wm-message-field-height | 48pxVaries with size. | The one-line height, the border included. |
--wm-message-field-padding-inline | 16pxVaries with size. | Between the edge and the text when no slot is there. |
--wm-message-field-gap | 8pxVaries with size. | Between a slot and the text. |
--wm-message-field-slot-gap | 8pxVaries 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-extent | 40pxVaries with size. | The slot buttons’ height, which centres them on one line. Set it with the buttons’ size. |
--wm-message-field-text-font | var(--md-sys-typescale-body-large-font)Varies with size. | The text’s typeface. |
--wm-message-field-text-size | var(--md-sys-typescale-body-large-size)Varies with size. | The text’s size. |
--wm-message-field-text-line-height | var(--md-sys-typescale-body-large-line-height)Varies with size. | The text’s line height. |
--wm-message-field-text-tracking | var(--md-sys-typescale-body-large-tracking)Varies with size. | The text’s letter spacing. |
--wm-message-field-text-weight | var(--md-sys-typescale-body-large-weight)Varies with size. | The text’s weight. |
--wm-message-field-spring-duration | var(--md-sys-motion-spring-spatial-default-duration) | How long growing, shrinking, opening and docking take (follows the motion scheme). |
--wm-message-field-spring-easing | var(--md-sys-motion-spring-spatial-default-easing) | Their spring curve. |
--wm-message-field-shrink-easing | var(--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-inline | 16px | The visible label’s inset from the field’s start edge. |
--wm-message-field-label-gap | 4px | Between the visible label and the field. |
--wm-message-field-supporting-padding-inline | 16px | The supporting text, error and counter’s inset from the field’s edges. |
--wm-message-field-supporting-gap | 4px | Between the field and the supporting text, error and counter under it. |
--wm-message-field-counter-gap | 16px | Between the supporting text and the counter. |
--wm-message-field-row-padding-top | 4px | Above the banner, and above the formatting row when it’s on top. |
--wm-message-field-banner-min-height | 44px | The banner row’s least height (“Replying to …”). |
--wm-message-field-attachments-padding | 8px | Around the attachments row, at its sides and above it. |
--wm-message-field-icon-size | 24px | MessageFieldTrigger’s trailing icon (M3’s 24px icon). |