Skip to content

Add wrap-anywhere option for Text component#925

Merged
sindresorhus merged 4 commits into
vadimdemedes:masterfrom
virskyline:feat/wrap-anywhere
Apr 7, 2026
Merged

Add wrap-anywhere option for Text component#925
sindresorhus merged 4 commits into
vadimdemedes:masterfrom
virskyline:feat/wrap-anywhere

Conversation

@virskyline

Copy link
Copy Markdown
Contributor

Add 'wrap-anywhere' as a new value for the wrap prop on .

Unlike the default 'wrap' which tries to break at word boundaries, 'wrap-anywhere' fills each line to the full column width, breaking mid-word when needed. Uses wrap-ansi with wordWrap: false.

Closes #741

Add 'wrap-anywhere' as a new value for the wrap prop on <Text />.

Unlike the default 'wrap' which tries to break at word boundaries,
'wrap-anywhere' fills each line to the full column width, breaking
mid-word when needed. Uses wrap-ansi with wordWrap: false.

Closes #741
@sindresorhus

Copy link
Copy Markdown
Collaborator

The wrap value should really have been normal, not wrap, since wrap="wrap" is really weird.

So I don't think we should continue that bad API choice and instead name this explicitly: wrap="hard".

@virskyline virskyline left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good Point

@sindresorhus

Copy link
Copy Markdown
Collaborator

You have merge conflict

@virskyline

Copy link
Copy Markdown
Contributor Author

Merge Conflict solved

@sindresorhus sindresorhus merged commit 2b1e3a6 into vadimdemedes:master Apr 7, 2026
2 checks passed
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.

[Feature Request] Support word-break like props for <Text /> component

2 participants