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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@litforge/login-form

v0.1.21

Published

A complete login form component built with Lit, featuring email and password inputs, validation, and customizable styling.

Downloads

610

Readme

@litforge/login-form

A complete login form component built with Lit, featuring email and password inputs, validation, and customizable styling.

Overview

The LoginForm component provides a ready-to-use login form with:

  • Email and password inputs with validation
  • Optional password visibility toggle
  • Loading states
  • Error handling
  • Logo support
  • Fully customizable via CSS variables

Installation

npm install @litforge/login-form
# or
pnpm add @litforge/login-form
# or
yarn add @litforge/login-form

Note: This component depends on:

  • @litforge/email-input
  • @litforge/password-input
  • @litforge/loading-button
  • @litforge/logo-img

Basic Usage

<script type="module">
  import '@litforge/login-form';
</script>

<login-form
  heading="Welcome Back"
  subheading="Sign in to your account"
  button-label="Sign In"
  @login-submit="${handleLogin}"
></login-form>

Properties

| Property | Type | Default | Description | |----------|------|---------|-------------| | heading | string | undefined | Main heading text | | subheading | string | undefined | Subheading text | | logoImgSrc | string | undefined | Logo image source URL | | logoImgAlt | string | undefined | Logo image alt text | | logoImgSize | string | undefined | Logo image size | | email | string | undefined | Initial email value | | emailLabel | string | undefined | Email input label | | emailPlaceholder | string | undefined | Email input placeholder | | emailError | string | undefined | Email error message | | password | string | undefined | Initial password value | | passwordLabel | string | undefined | Password input label | | passwordPlaceholder | string | undefined | Password input placeholder | | passwordError | string | undefined | Password error message | | buttonLabel | string | undefined | Submit button label | | login | boolean | false | Shows login state | | disabled | boolean | false | Disables the form | | showPasswordToggle | boolean | false | Shows password visibility toggle | | errorMessage | string | undefined | General error message | | allowUsername | boolean | false | Allows login with username instead of email validation |

Events

login-submit

Fired when the form is submitted with valid data.

interface LoginSubmitDetail {
  email: string;
  password: string;
}

Examples

Basic Login Form

<login-form
  heading="Sign In"
  button-label="Login"
  @login-submit="${(e) => console.log(e.detail)}"
></login-form>

With Logo and Custom Labels

<login-form
  heading="Welcome Back"
  subheading="Sign in to continue"
  logo-img-src="/logo.png"
  logo-img-alt="Company Logo"
  email-label="Email Address"
  password-label="Password"
  button-label="Sign In"
  show-password-toggle
  @login-submit="${handleLogin}"
></login-form>

With Error Handling

<login-form
  email-error="${emailError}"
  password-error="${passwordError}"
  error-message="${generalError}"
  @login-submit="${handleLogin}"
></login-form>

With Username Support

When allowUsername is enabled, the form will accept both email and username formats without email validation:

<login-form
  allow-username
  heading="Sign In"
  subheading="Use your username or email"
  email-label="Username or Email"
  email-placeholder="username or [email protected]"
  button-label="Login"
  @login-submit="${handleLogin}"
></login-form>

Note: When allowUsername is true, the email field will only validate that it's not empty, allowing both usernames and email formats.

Event Handling

function handleLogin(event) {
  const { email, password } = event.detail;
  // Handle login logic
  console.log('Login attempt:', { email, password });
}

document.querySelector('login-form')
  .addEventListener('login-submit', handleLogin);

Styling

The component uses CSS variables for theming:

login-form {
  --lf-login-form-font-family: 'Inter', sans-serif;
  --lf-login-form-text-color: #111827;
  --lf-login-form-radius: 12px;
  --lf-login-form-space-lg: 16px;
  /* ... more variables */
}

TypeScript

import { LoginForm } from '@litforge/login-form';
import type { LoginFormProps, LoginSubmitDetail } from '@litforge/login-form';

const props: LoginFormProps = {
  heading: 'Welcome',
  buttonLabel: 'Sign In',
  onLoginSubmit: (event: CustomEvent<LoginSubmitDetail>) => {
    console.log(event.detail);
  }
};

License

Part of the LitForge component library.