npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hi-contact

v0.2.6

Published

Hi.new contact form with an ease

Downloads

554

Readme

HiContact Web Component

hi-contact is a customizable web component. It allows users to display a contact form on their website, with the option to send emails or OTPs (One-Time Passwords). The component supports both dark and light themes and can be styled with rounded corners.

Features

  • Username Prop: Set the username to personalize the form.
  • Button or Form Display: Optionally display the contact form as a button that opens the form on click.
  • Theming: Choose between dark or light themes.
  • Rounded Corners: Optionally apply rounded corners to the form.
  • OTP Mode: Enable or disable OTP functionality.

Installation

You can install the hi-contact component via npm:

npm install hi-contact # yarn add hi-contact 

Or directly import the script in your HTML:

<script type="module" crossorigin src="https://unpkg.com/hi-contact@latest/dist/hiContact.js"></script>

Example

Here’s an example of how to use the component with different settings:

<hi-contact
  username="JaneDoe"
  asButton
  theme="light"
  corners="rounded"
  otp>
  <div>Contact me</div>
</hi-contact>

Attributes

  • username: string - The username to be displayed in the form.
  • asButton: boolean - Displays the form with a slot with hook (button).
  • otp: boolean - Enables OTP mode when set.
  • theme: 'dark' | 'light' - Sets the theme of the form. Default is 'dark'.
  • corners: 'rounded' | '' - Adds rounded corners to the form.

Usage

Basic Usage

To use the hi-contact component, include it in your HTML as follows:

<hi-contact username="JohnDoe"></hi-contact>

Button Mode

If you prefer to display a button that triggers the contact form, set the asButton attribute to true:

<hi-contact username="JohnDoe" asButton>
  <div>Contact me</div>
</hi-contact>

OTP Mode

Enable OTP functionality by setting the otp attribute to true:

<hi-contact username="JohnDoe" otp></hi-contact>

Theming

The component supports dark and light themes. The default theme is dark. To switch to the light theme, use the theme attribute:

<hi-contact username="JohnDoe" theme="light"></hi-contact>

Rounded Corners

To apply rounded corners to the form, use the corners attribute:

<hi-contact username="JohnDoe" corners="rounded"></hi-contact>

Styling

You can further customize the appearance of the component using CSS. For example:

hi-contact {
  --hi-bg-color:  rgba(86, 57, 216, 0.603); 
  --hi-text-color:  rgb(187, 43, 43);
  --hi-border-color:  rgb(243, 244, 246, 0.1);
  --hi-button-color:  rgb(2, 17, 12);
  --hi-button-hover-color:  rgb(24, 181, 129);
  --hi-button-text-color:  rgb(225, 28, 28);
  --hi-button-text-hover:  rgb(76, 9, 9);
  --hi-placeholder-text:  rgb(184, 32, 32);
  --hi-placeholder-color:  rgb(6, 5, 5);
  }