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

@jill64/svelte-html

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jill64/svelte-html

🏷️ Declarative attribute binding for the root html element

  • 1.1.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@jill64/svelte-html

npm-version npm-license npm-download-month npm-min-size ci.yml website

🏷️ Declarative attribute binding for the root html element

Demo

Installation

npm i @jill64/svelte-html

Usage

By passing a key-value set to the <SvelteHTML /> component, attributes are bind to the root html element.

<script>
  import { SvelteHTML } from '@jill64/svelte-html'
</script>

<SvelteHTML lang="en" prefix="example" />

<html lang="en" prefix="example">
  <!-- ... -->
</html>

SSR

Attribute binding with <SvelteHTML> is only applied on the client. To assign arbitrary attributes during SSR, use the apply function in the handle hook.

// hooks.server.js
import { apply } from '@jill64/svelte-html'

export const handle = async ({ event, resolve }) => {
  // ...
  return resolve(event, {
    transformPageChunk: apply({
      lang: 'en',
      prefix: 'example'
    })
  })
}

License

MIT

Keywords

FAQs

Package last updated on 05 Feb 2024

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