0.0.199 • Published 4 years ago

@vx/text v0.0.199

Weekly downloads
80,669
License
MIT
Repository
github
Last release
4 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

4 years ago

0.0.198

4 years ago

0.0.197

4 years ago

0.0.196

4 years ago

0.0.195

4 years ago

0.0.194

4 years ago

0.0.193

4 years ago

0.0.193-alpha.2

4 years ago

0.0.193-alpha.1

4 years ago

0.0.193-alpha.0

4 years ago

0.0.192

5 years ago

0.0.191

5 years ago

0.0.190

5 years ago

0.0.189

5 years ago

0.0.183

5 years ago

0.0.182

5 years ago

0.0.179

6 years ago

0.0.175

6 years ago

0.0.173

6 years ago

0.0.165

6 years ago

0.0.165-beta.1

6 years ago

0.0.165-beta.0

6 years ago

0.0.161

6 years ago

0.0.159

6 years ago

0.0.153

6 years ago

0.0.152

6 years ago

0.0.151

6 years ago

0.0.150

6 years ago

0.0.143

7 years ago

0.0.140

7 years ago

0.0.136

7 years ago

0.0.127

7 years ago

0.0.126

7 years ago

0.0.125

7 years ago

0.0.120

7 years ago

0.0.114

7 years ago

0.0.111

7 years ago

0.0.110

7 years ago

0.0.109

7 years ago

0.0.84

7 years ago

0.0.79

7 years ago

0.0.75

7 years ago

0.0.71

7 years ago

0.0.67

7 years ago

0.0.66

7 years ago

0.0.65

7 years ago

0.0.63

7 years ago

0.0.62

7 years ago