Skip to content

phothinmg/hono-social-icons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social icons with links for Hono Jsx (Deno Only)

Icons are get from https://tabler.io/


Install

From JSR

deno add @ptm/hono-social-icons
import { SocialIcon } from "@ptm/hono-social-icons";

From denoland/x

import { SocialIcon } from "https://deno.land/x/[email protected]/src/mod.ts";

Setup

Hono jsx runtime in deno.json.

{
  "compilerOptions": {
    "jsx": "precompile",
    "jsxImportSource": "jsr:@hono/hono@^4.4.6/jsx"
  }
}

CSS link in <head> </head> (Optional)

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/gh/phothinmg/master-repo@main/hono-icons/sicons.css"
  type="text/css"
/>

You can styled to class .clink

Default Style

:root {
  --clink-color: #585858;
}
html[data-theme="light"] {
  --clink-color: #585858;
}
html[data-theme="dark"] {
  --clink-color: #ababab;
}
.clink {
  color: var(--clink-color);
  text-decoration: none;
}
.clink:hover {
  color: goldenrod;
}

FC<{ name: string; href: string; size?: number; stoke?: number }>;

Example

<SocialIcon name={"github"} href={"https://github.com/--"} size={30} />
<SocialIcon name={"twitter"} href={"link_to_profile"} size={18} stoke={1.5} />
 <SocialIcon name={"discord"} href={"link_to_profile"} />
  • name: Name of social , Required
  • href: URL to social profile , Required
  • size: Size of icon , Optional , default 24
  • stoke: Size of stoke width , Optional , default 2 (limit =< 2)

Text for available icons

  • "github"
  • "twitter"
  • "linkedin"
  • "facebook"
  • "whatsapp"
  • "wordpress"
  • "wechat"
  • "gitlab"
  • "bitbucket"
  • "discord"