Socket
Socket
Sign inDemoInstall

svelte-github-corner

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    svelte-github-corner

Display an animated Octocat in a corner of the screen to link to the GitHub repo.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Octocat
 Svelte GitHub Corner

NPM version GitHub Pages pre-commit.ci status

Live demo

🔨   Installation

npm install -D svelte-github-corner

📙   Usage

<script>
  import GitHubCorner from 'svelte-github-corner'
</script>

<!-- minimal -->
<GitHubCorner href="https://github.com/janosh/svelte-github-corner" />

<!-- kitchen sink -->
<GitHubCorner
  href="https://github.com/janosh/svelte-github-corner"
  title="Fancy words"
  ariaLabel="Click here for riches"
  target="_blank"
  corner="top-left"
  style="z-index: 42;"
  --ghc-bg="white"
  --ghc-color="var(--bodyBg)"
/>

🔣   Props

  • href: string: (required) The GitHub URL to link to.
  • title: string = 'View code on GitHub': Text to display in hover tooltip.
  • ariaLabel: string = title: Accessible name for SVG button describing its function. See MDN. Should not be set to empty string.
  • target: '_self' | '_blank' = '_self': Whether to open href in same ('_self') or new tab ('_blank').
  • corner: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' = 'top-right': Which corner of the screen to position the Octocat. 'bottom-(left|right)' look bad, shouldn't normally be used.
  • style: string = '': Inline styles that will be applied to the <a> tag.

✨   Styling

With CSS variables:

fill: var(--ghc-bg, black);
color: var(--ghc-color, white);
width: var(--ghc-size, min(50pt, 15vw));

Can be passed as props or set in a global stylesheet.

Keywords

FAQs

Last updated on 04 Jan 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc