@lydio/login-form
v3.0.0
Published
Reusable login form node for Lydio
Maintainers
Readme
@lydio/login-form
Canonical URL:
https://alexstevovich.com/a/lydio-login-form-nodejs
Software URL:
https://midnightcitylights.com/software/lydio-login-form-nodejs
Reusable login form node for Lydio.
@lydio/login-form provides a clean, ready-to-use HTML login form with
semantic <label> and <input> elements, pre-configured for POST submission.
It’s ideal for quickly embedding authentication fields within programmatically
generated HTML layouts built with Lydio.
Installation
npm install @lydio/login-formExample
import LoginForm from '@lydio/login-form';
const form = new LoginForm('/api/login');
console.log(form.toHtml());
/*
<form method="POST" action="/api/login">
<label for="username">Username</label>
<input id="username" type="text" name="username" placeholder="Username" autocomplete="username" required>
<label for="password">Password</label>
<input id="password" type="password" name="password" placeholder="Password" autocomplete="current-password" required>
<button type="submit">Login</button>
</form>
*/Options
| Option | Default | Description |
| --------------- | ------------ | ---------------------------------- |
| usernameLabel | "Username" | Label text for the username field. |
| passwordLabel | "Password" | Label text for the password field. |
| submitLabel | "Login" | Text for the submit button. |
| classes | [] | Optional list of CSS class names. |
Features
- Semantic markup with and pairs.
- Preconfigured for POST authentication endpoints.
- Clean defaults, fully overridable through constructor options.
License
Licensed under the Apache License 2.0.
Trademark
“Lydio” and related marks are trademarks of Alex Stevovich.
See TRADEMARK.md for details.
