Kinetic UI
Back to Introduction
Forms

Physics Auth Form

An interactive authentication form powered by matter.js that drops physical blocks representing password strength as you type.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add physics-auth-form
Physics Auth Form

Login

Type your password to see physics in action.

Installation

npx kinetic-ui-cli@latest add

Usage

This form uses `matter-js` to create a physical environment that reacts to user input. It is highly engaging and gamifies the process of choosing a strong password.

import { PhysicsAuthForm } from "@/components/creative/physics-auth-form";

export function AuthPage() {
  const handleLogin = (email: string, pass: string) => {
    console.log("Authenticating...", email);
  };

  return (
    <div className="w-full flex justify-center p-8">
      <PhysicsAuthForm onLogin={handleLogin} />
    </div>
  );
}

Props

PropTypeDefaultDescription
classNamestringundefinedAdditional CSS classes for the form wrapper.
onLogin(email: string, pass: string) => voidundefinedCallback function triggered when the form is submitted.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { PhysicsAuthForm } from "@/components/creative/physics-auth-form";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { PhysicsAuthForm } from "@/components/creative/physics-auth-form";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <PhysicsAuthForm
        onLogin="example"
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.