-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add NoWrapSpace Text component
- Loading branch information
1 parent
3956f82
commit f69e74b
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Use this component to add a non-breaking space that will not wrap to a new line. | ||
* | ||
* ```tsx | ||
* // Example: | ||
* <p> | ||
* This text will wrap as needed, but the last word will "stick" to the HelpInfoIcon | ||
* <NoWrapSpace /> | ||
* <HelpInfoIcon | ||
* tooltip="This icon will never be orphaned onto its own line all alone - huzzah!🎉" | ||
* /> | ||
* </p> | ||
* ``` | ||
*/ | ||
export const NoWrapSpace = () => ( | ||
<span | ||
style={{ | ||
fontSize: "inherit", | ||
fontWeight: "inherit", | ||
lineHeight: "inherit", | ||
whiteSpace: "nowrap", | ||
}} | ||
> | ||
| ||
</span> | ||
); |