Skip to content

feat: add optional hint prop to form fields#1139

Open
Alastair Fraser (alastair-simon) wants to merge 1 commit into
mainfrom
feat/meteor-component-hint-prop
Open

feat: add optional hint prop to form fields#1139
Alastair Fraser (alastair-simon) wants to merge 1 commit into
mainfrom
feat/meteor-component-hint-prop

Conversation

@alastair-simon

@alastair-simon Alastair Fraser (alastair-simon) commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #1062

Form fields now accept an optional hint string (with an existing #hint slot still available, and the slot winning when both are used) and show that caption under the field with the standard info icon via mt-field-hint.

Why?

Product and admin UIs need short, consistent helper text under inputs without every consumer hand-rolling markup, layout, and the info icon.

How?

Parents expose a hint prop plus #hint, compute showFieldHint from non-empty prop text or a present hint slot (with mt-unit-field only forwarding #hint when the wrapper actually provides it), gate mt-field-hint with v-if, and keep mt-select/mt-select-base wired so the select wraps hint content the same way.

Testing?

Existing visual tests pass

@vercel

vercel Bot commented Apr 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meteor-component-library Ready Ready Preview, Comment Apr 29, 2026 7:21am

Request Review

refactor: create mt-field-hint component and refactor fields

feat: create mt-field-hint component

refactor: implement figma design

style: code format

test: fix mt-textarea story

update snapshots
@fabianhueske

Copy link
Copy Markdown
Contributor

Would be nice to add a visual test with slot usage.

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.

Hint passed via prop to form components not displayed

2 participants