Repository navigation
feat(text): add element components Text.h1 to Text.h6, Text.p, Text.span, and Text.div - #654
Merged
Merged
Conversation
…pan, and Text.div Each element component always renders its named HTML element with a default typography role, and takes variant, className, the element's own attributes, and a ref typed for the element. It does not take render. Defaults: h1 heading-lg, h2 heading-md, h3-h6 heading-sm, p body-md, span label-md, div body-md. Headings written this way do not trigger jsx-a11y/heading-has-content, so they need no disable comment. Text and its render prop do not change. The decision record gets a "Fourth change" section, and the Text docs page documents the new API. Refs tailor-inc/platform-planning#2225 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Code Metrics Report
Details | | main (f16bacc) | #654 (b5d95bb) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 89.5% | 89.5% | +0.0% |
| Files | 236 | 236 | 0 |
| Lines | 7504 | 7512 | +8 |
+ | Covered | 6719 | 6727 | +8 |
- | Test Execution Time | 2m33s | 2m36s | +3s |Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)
Reported by octocov |
IzumiSy
approved these changes
Oct 28, 2026
interacsean
requested changes
Oct 28, 2026
interacsean
left a comment
Contributor
There was a problem hiding this comment.
Looks like we just need to still update docs-src/skill/SKILL.template.md:70, docs-src/guides/quickstart.docs.outline.md:83 (also lines 123 and 141), docs-src/concepts/styling-theming.docs.outline.md:295
and then run pnpm docs:sync
…nd skill Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@interacsean Thanks, updated in dca3d7a:
This PR now covers these docs, so I removed them from the follow-up list in |
…an-83a597 # Conflicts: # decisions/typography-roles.md # docs-manifest.json
interacsean
approved these changes
Oct 28, 2026
…an-83a597 # Conflicts: # docs-manifest.json
wemra3
pushed a commit
that referenced
this pull request
Oct 30, 2026
The rendered output does not change, and the skill rule change shipped with #654, so consumers have nothing to act on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add element components to
Text:Text.h1toText.h6,Text.p,Text.span, andText.div.Each component always renders its named HTML element. It takes
variant,className, the element's own attributes, and a ref typed for the element. It does not takerender.Textand itsrenderprop do not change.Refs tailor-inc/platform-planning#2225 (part of tailor-inc/platform-planning#2214).
Decisions from the Slack discussion (#pf-app-shell, 2026-10-27)
Scope: the elements in the issue (
h1toh6,p,span) anddiv. Other elements, such ascode,small,pre,blockquote,figcaption,time,kbd, andlabel, keep usingTextwithrenderand a lint disable comment. We can add more later if they are used often.No
asprop. It would do the same thing asText.h1.Defaults:
variantText.h1heading-lgText.h2heading-mdText.h3–Text.h6heading-smText.pbody-mdText.spanlabel-mdText.divbody-mdText.spanuseslabel-md, notbody-md, to follow the default elements ofText(body roles renderp, label and code roles renderspan).Text.divusesbody-md, the default role ofText.Changes
packages/core/src/components/text/text.tsx: a small factory creates each element component. It renders the element directly, without Base UI'suseRender, because there is norenderprop. It setsdata-slot="text"and the same classes asText. TheTextexport keeps an explicit type, asLayoutandAutocompletedo.React.ComponentProps<typeof Text.h2>gives it, and the docs show this. Adding a named type later is not a breaking change; removing one would be.variantoverride,nullvariant,classNamemerge, native attributes, typed refs,displayName(the root staysText), and@ts-expect-errorchecks thatrenderandasare rejected.Text.h1toText.h6.app-shell-patternsskill rule now useText.h1andText.h3instead ofrender={<h1 />}andrender={<h3 />}.Decision record
decisions/typography-roles.md:levelprop: plain HTML elements useText.<element>, and composition usesrender.Text.h1toText.h6, and the disable comment remains only for other elements inrender.Lint check
With oxlint 1.64 and the core config,
jsx-a11y/heading-has-contentreports<Text variant="heading-lg" render={<h1 />}>but not<Text.h1>or<Text.h3 variant="heading-lg">. I did not check the ESLint version ofjsx-a11y.Not in this PR
render={<h3 />}for now. Changing them to element components is a separate change..agents/references/component-design.md, which still showsrender={<h3 />}with the disable comment.Checks
pnpm fmt:check,lint,type-check,test,build, anddocs:checkpass locally.🤖 Generated with Claude Code