0.0.199 • Published 5 years ago

@vx/text v0.0.199

Weekly downloads
80,669
License
MIT
Repository
github
Last release
5 years ago

@vx/text

The @vx/text provides a better SVG <Text> component with the following features

  • Word-wrapping (when width prop is defined)
  • Vertical alignment (verticalAnchor prop)
  • Rotation (angle prop)
  • Scale-to-fit text (scaleToFit prop)

Example

Simple demo to show off a useful feature. Since svg <text> itself does not support verticalAnchor, normally text rendered at 0,0 would be outside the viewport and thus not visible. By using <Text> with the verticalAnchor="start" prop, the text will now be visible as you'd expect.

import React from 'react';
import { render } from 'react-dom';
import { Text } from '@vx/text';

const App = () => (
  <svg>
    <Text verticalAnchor="start">Hello world</Text>
  </svg>
);

render(<App />, document.getElementById('root'));

Installation

npm install --save @vx/text
0.0.199

5 years ago

0.0.198

5 years ago

0.0.197

5 years ago

0.0.196

5 years ago

0.0.195

5 years ago

0.0.194

5 years ago

0.0.193

5 years ago

0.0.193-alpha.2

5 years ago

0.0.193-alpha.1

5 years ago

0.0.193-alpha.0

6 years ago

0.0.192

6 years ago

0.0.191

6 years ago

0.0.190

6 years ago

0.0.189

6 years ago

0.0.183

6 years ago

0.0.182

7 years ago

0.0.179

7 years ago

0.0.175

7 years ago

0.0.173

7 years ago

0.0.165

7 years ago

0.0.165-beta.1

7 years ago

0.0.165-beta.0

7 years ago

0.0.161

7 years ago

0.0.159

7 years ago

0.0.153

7 years ago

0.0.152

7 years ago

0.0.151

7 years ago

0.0.150

8 years ago

0.0.143

8 years ago

0.0.140

8 years ago

0.0.136

8 years ago

0.0.127

8 years ago

0.0.126

8 years ago

0.0.125

8 years ago

0.0.120

8 years ago

0.0.114

8 years ago

0.0.111

8 years ago

0.0.110

8 years ago

0.0.109

8 years ago

0.0.84

8 years ago

0.0.79

8 years ago

0.0.75

8 years ago

0.0.71

8 years ago

0.0.67

8 years ago

0.0.66

8 years ago

0.0.65

8 years ago

0.0.63

8 years ago

0.0.62

8 years ago