@blackblock/react-anchor-heading
Version:
A React heading component with id that automatically changes with textContent for anchoring.
22 lines (14 loc) • 1.2 kB
Markdown
# React anchor heading
[](https://codeclimate.com/github/winston0410/react-anchor-heading/maintainability) [](https://codeclimate.com/github/winston0410/react-anchor-heading/test_coverage) [](https://snyk.io/test/github/winston0410/react-anchor-heading?targetFile=package.json) [](https://www.codacy.com/gh/winston0410/react-anchor-heading/dashboard?utm_source=github.com&utm_medium=referral&utm_content=winston0410/react-anchor-heading&utm_campaign=Badge_Grade)
A React heading component with id that automatically changes with textContent for anchoring.
```javascript
import Heading from '@blackblock/react-anchor-heading'
//Input
<Heading as={'h2'}>Hello world</Heading>
//Output
<h2 id="hello-world">Hello world</h2>
```
## Installation
```shell
npm i @blackblock/react-anchor-heading
```