@blackblock/react-anchor-heading

A React heading component with id that automatically changes with textContent for anchoring.

Usage no npm install needed!

<script type="module">
  import blackblockReactAnchorHeading from 'https://cdn.skypack.dev/@blackblock/react-anchor-heading';
</script>

README

React anchor heading

Maintainability Test Coverage Known Vulnerabilities Codacy Badge

A React heading component with id that automatically changes with textContent for anchoring.

import Heading from '@blackblock/react-anchor-heading'

//Input
<Heading as={'h2'}>Hello world</Heading>

//Output
<h2 id="hello-world">Hello world</h2>

Installation

npm i @blackblock/react-anchor-heading