Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@daviddarnes/heading-anchors

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daviddarnes/heading-anchors

A Web Component to add anchor links to headings with IDs

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

heading-anchors

A Web Component to add anchor links to headings with IDs.

Demo

Examples

<script type="module" src="heading-anchors.js"></script>

<heading-anchors>
  <h2 id="heading-level-2">Heading level 2</h2>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Alias repudiandae expedita totam nesciunt quisquam voluptatum eos optio iste sunt temporibus suscipit, et inventore veniam neque corrupti est facere rem incidunt?</p>

  <h3 id="heading-level-3">Heading level 3</h3>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi eligendi exercitationem, ratione, in delectus vitae veritatis dolorem porro cupiditate quam eaque voluptates. Aliquid reprehenderit iusto blanditiis ea, temporibus perferendis libero.</p>
</heading-anchors>

Features

This Web Component allows you to:

  • Add anchor links to headings which have an ID attribute and value

Installation

You have a few options (choose one of these):

  1. Install via npm: npm install @daviddarnes/heading-anchors
  2. Download the source manually from GitHub into your project.
  3. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)

Usage

Make sure you include the <script> in your project (choose one of these):

<!-- Host yourself -->
<script type="module" src="heading-anchors.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script type="module" src="https://www.unpkg.com/@daviddarnes/heading-anchors@1.0.0/heading-anchors.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script type="module" src="https://esm.sh/@daviddarnes/heading-anchors@1.0.0"></script>

Credit

With thanks to the following people:

Keywords

FAQs

Package last updated on 11 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc