Skip to content

Form row label append default text style - #10067

Merged
mgadewoll merged 13 commits into
elastic:mainfrom
JoseLuisGJ:Form-row-labelAppend-default-text-style
Oct 5, 2026
Merged

mgadewoll merged 13 commits into
elastic:mainfrom
JoseLuisGJ:Form-row-labelAppend-default-text-style

Conversation

@JoseLuisGJ

@JoseLuisGJ JoseLuisGJ commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • What: EuiFormRow's labelAppend now has a default text style (xs + subdued) instead of inheriting the large, high-contrast body text.
  • Why: Fixes [EuiFormRow] Define a default text style to the labelAppend prop #10021. String labelAppend values (e.g. “Optional”) currently render at 16px / primary text, so product teams keep wrapping or overriding them by hand.
  • How:
    • Added an internal EuiFormLabelAppend wrapper used by EuiFormRow.
    • String children render in a .euiFormLabelAppend span with euiFontSize(..., 'xs') and colors.textSubdued.
    • Non-string children (links, buttons, custom nodes) skip that span and are wrapped in EuiText size="xs", so custom elements still work and pick up the smaller size without the subdued text color.
    • labelAppend remains typed as any — tightening that type is out of scope here.
  • EuiFormLabelAppend is not exported from the public @elastic/eui index; it is a form-row subcomponent (Storybook + internal use only).

API Changes

component / parent prop / child change description
EuiFormRow labelAppend Visual default String content now renders as xs + textSubdued instead of inherited 16px / primary text
EuiFormLabelAppend — Added Internal wrapper that applies the default string styles; custom React nodes still render

Screenshots

Before After
CleanShot 2026-09-21 at 15 33 28@2x Before: string labelAppend at 16px / black CleanShot 2026-09-21 at 15 32 06@2x After: same string at xs / subdued

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes — No API removals or signature changes. labelAppend still accepts strings or custom React nodes.
  • 💅 Visual changes — Every string labelAppend will shrink from default body text (16px / primary) to xs + subdued. Consumers who already wrap strings in EuiText size="xs" (or similar) may look slightly smaller / double-wrapped and can drop those overrides. Custom nodes (e.g. the docs EuiText + EuiLink pattern) still render; they now also inherit EuiText size="xs".
  • 🧪 Test impact — EUI Jest snapshots updated (form_row, new form_label_append). Downstream snapshots that assert labelAppend HTML will now see a <span class="euiFormLabelAppend euiFormRow__labelAppend"> around string content.
  • 🔧 Hard to integrate — No Kibana staging required for API compatibility. Optional follow-up: remove redundant EuiText size="xs" / color overrides around string labelAppend usages.

Impact level: 🟡 Moderate

Release Readiness

QA instructions for reviewer

  • Open Storybook: Forms → EuiForm → EuiFormRow.
    • Set labelAppend to a string (e.g. Optional) and confirm it renders xs and subdued, not 16px / primary.
    • Confirm the append still sits to the right of the label (not inside the <label>).
  • Open Storybook: Forms → EuiForm → EuiFormRow → Subcomponents → EuiFormLabelAppend.
    • Playground: string child uses .euiFormLabelAppend + subdued xs text.
    • CustomContent: a link/custom node still renders (no .euiFormLabelAppend span); size is xs via EuiText.
  • Repeat string + custom-element cases in light and dark.
  • Check compressed / display variants of EuiFormRow — append alignment should stay on the label row.
  • Keyboard / SR: labelAppend is still outside the <label>, so it is not announced as part of the field name (same as before).

Checklist before marking Ready for Review

  • Filled out all sections above
  • QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen reader
  • QA: Tested in CodeSandbox and Kibana
  • QA: Tested docs changes
  • Tests: Added/updated Jest (form_label_append + form_row snapshots). Cypress VRT
  • Changelog: Added changelog entry (packages/eui/changelogs/upcoming/10067.md)
  • Breaking changes: Added breaking change label (if applicable)

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@JoseLuisGJ JoseLuisGJ self-assigned this Sep 21, 2026
@JoseLuisGJ
JoseLuisGJ marked this pull request as ready for review September 21, 2026 12:07
@JoseLuisGJ
JoseLuisGJ requested a review from a team as a code owner September 21, 2026 12:07
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

📷 4 visual difference(s) found

Look at the visual diff below. If everything is expected, run Approve visual changes to update baselines, re-run the job or make appropriate fixes.

See the visual regression testing wiki for more information.

Expand to review

euiform (4 differences)

StoryDiff %BeforeAfterDiff
custom content desktop 99.21%
playground desktop 70.92%
custom content mobile 96.91%
playground mobile 70.92%

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Kibana Regression Integration Test

Status: 💔 Kibana CI failed
Branch: update-dependencies/1790176127
Kibana PR: elastic/kibana#293033

Please check Kibana CI logs for details.

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but before we continue we need to prep the changes necessary in Kibana

Copilot AI balanced review requested due to automatic review settings October 5, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Custom-node attributes are dropped, the public type change contradicts the stated scope, and the changelog advertises a nonexistent public component.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds default extra-small styling for EuiFormRow.labelAppend while preserving custom React content.

Changes:

  • Adds the internal EuiFormLabelAppend wrapper and styles.
  • Updates form-row integration, documentation, stories, and tests.
  • Adds a changelog entry.
File Description
row.mdx Simplifies the custom-link example.
form_row.tsx Integrates the new append wrapper.
form_row.test.tsx.snap Updates form-row markup snapshot.
form_label_append/​index.ts Adds internal exports.
form_label_append.tsx Implements conditional text rendering.
form_label_append.test.tsx Tests string and custom content.
form_label_append.styles.ts Adds subdued extra-small styling.
form_label_append.stories.tsx Adds component stories.
form_label_append.test.tsx.snap Captures string markup.
10067.md Adds the release note.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mgadewoll mgadewoll removed the ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR label Oct 5, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @JoseLuisGJ

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @JoseLuisGJ

@mgadewoll

Copy link
Copy Markdown
Contributor

ℹ️ The changes were run in Kibana CI 🟢

@mgadewoll
mgadewoll merged commit 6d7ca1d into elastic:main Oct 5, 2026
8 checks passed
skynetigor pushed a commit to skynetigor/kibana that referenced this pull request Oct 7, 2026
## Dependency updates

`@elastic/eui` - v123.0.0 ⏩ v123.1.0

## Package updates

### `@elastic/eui`
[v123.1.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Removed the left color highlight from `EuiCallOut`
([elastic#10109](elastic/eui#10109))
- Updated Flyout menu height to 50px
([elastic#10103](elastic/eui#10103))
- Added new icons: `chartMix`, `chartWaffle`, `clipboardWarning`,
`clockUp`, `emergencyLight`, `productCanvas`, `productElasticAgent`,
`productFleet`, `productLens`, `puzzlePiece`, `shield`
([elastic#10111](elastic/eui#10111))
- Added `hasAriaDisabled` prop on `EuiSelectableListItem` and `type
EuiSelectableOption`
([elastic#10090](elastic/eui#10090))
- Added refs for `EuiFlyoutHeader`, `EuiFlyoutFooter`, and the outer
`EuiFlyout` scroll container.
([elastic#10105](elastic/eui#10105))
- Corrected `EuiFlyoutHeaderProps`, `EuiFlyoutFooterProps`, and
`EuiFlyoutBodyProps` to describe component props instead of component
types. ([elastic#10105](elastic/eui#10105))
- Updated `EuiFormRow`'s `labelAppend` to render string content with an
extra-small, subdued text style.
([elastic#10067](elastic/eui#10067))

**Bug fixes**

- Fixed a bug on `EuiSelectable` with `searchable={true}` that could
result in an infinite loop if all search results are disabled
([elastic#10090](elastic/eui#10090))
- Fixed `EuiSuperSelect` omitting the currently selected value from its
accessible name when an `aria-label` or `aria-labelledby` was passed.
External labels are now combined with the selected value instead of
overriding it ([elastic#10039](elastic/eui#10039))

---------

Co-authored-by: Ángeles Martínez Barrio <[email protected]>
Co-authored-by: Alexey Antonov <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
weronikaolejniczak pushed a commit to boriskirov/eui that referenced this pull request Nov 11, 2026
Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Lene Gadewoll <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiFormRow] Define a default text style to the labelAppend prop

5 participants