Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Dec 22, 2022
1 parent 8f0f164 commit a62c28a
Show file tree
Hide file tree
Showing 66 changed files with 1,765 additions and 55 deletions.
Binary file added .github/card.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/demo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
node_modules
dist
.DS_Store
.next
30 changes: 30 additions & 0 deletions README.md
@@ -1,5 +1,35 @@
# React Wrap Balancer

One simple component to make your titles more elegant:

![](.github/demo.gif)

Notice that in “Balanced Title Wrapping” above, every line of wrapped text has almost the same width, so it will likely not to have one single word in a line.

## Usage

Install it to your React project:

```bash
npm i react-wrap-balancer
```

And wrap any text with it:

```jsx
import { Balancer } from 'react-wrap-balancer'

// ...

function Title() {
return (
<h1>
<Balancer>My Awesome Title</Balancer>
</h1>
)
}
```

## Requirements

This library uses browser and React 18 APIs such as:
Expand Down
5 changes: 3 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "react-wrap-balancer",
"version": "0.1.0",
"version": "0.2.3",
"description": "Better text wrapping.",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -9,7 +9,7 @@
"dist"
],
"scripts": {
"build": "tsup src/index.tsx --format cjs,esm --dts-resolve --external react"
"build": "tsup src/index.tsx"
},
"keywords": [
"react",
Expand All @@ -20,6 +20,7 @@
"author": "Shu Ding <g@shud.in>",
"license": "MIT",
"devDependencies": {
"@types/node": "^18.11.13",
"react": "^18.2.0",
"tsup": "^6.4.0",
"typescript": "^4.8.4"
Expand Down

1 comment on commit a62c28a

@vercel
Copy link

@vercel vercel bot commented on a62c28a Dec 22, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.