Live Preview and Source
Interactive preview
UI·Your next page is taking shape...
Opening Your Next Page…
Loading the guide and preparing its examples for you to explore. The page will appear here automatically when it’s ready, so you can keep this view open without refreshing.
Made for Preact. Built to be yours.
Layout Block
Registration card with password confirmation, terms gate, and OAuth. Connect submit and OAuth handlers to your authentication service. Catalog variants expose typed props; session persistence and network calls remain in your application.
Interactive preview
Copy this variant into your Preact project, install the dependencies you are missing and connect your own data and callbacks. The source stays local, so you can change its layout without introducing another application framework.
Open the Showcase’s Code Tab and copy the files below relative to src/components/blocks. Keep the source folder structure so relative imports resolve. These are destination paths; the Code tab’s display labels such as app/auth/page.tsx are not the installation paths. The examples below assume your importing file is src/App.tsx.
Plain Textauth/auth-sign-up/auth-sign-up.tsx
auth/shared/catalog-form.ts
auth/shared/oauth-row.tsx
auth/shared/status-message.tsx
auth/shared/google-icon.tsxForms use shared validation and provider helpers. Branded and illustrated layouts also need their listed SVGs and URL helpers. Keep ?url imports in a Vite app, or adapt them to your bundler. If TypeScript cannot resolve an SVG import, include Vite’s client types (for example, import "vite/client" in an existing declaration file). Keep the repository’s license with your copied source.
Install only what your app does not already have. Preact renders the block, Kamod UI provides its interactive components, and Icons supplies its icons. Themes and Signals support the shared Kamod setup.
pnpm add @kamod-ch/ui @kamod-ch/icons preact @kamod-ch/themes @preact/signalsFollow the Theme and Tailwind Setup. Import your global stylesheet and make sure Tailwind scans the copied source and Kamod components. Keep your existing setup if the app already uses Kamod.
TypeScriptimport { AuthSignUp } from "@kamod-ch/blocks/auth/auth-sign-up";
export const Example = () => <AuthSignUp />;The @kamod-ch/blocks/auth/auth-sign-up path identifies source in this repository; the blocks package is private. Use the local import above rather than trying to install that path as a published package.
The form controls, borders and page background should follow your app’s theme. If the layout appears unstyled, check the global CSS import and Tailwind source detection before changing the block’s classes. If an import fails, first compare your folder paths with the copy list; renaming only one file can break its relative imports.
Import the component from your copied source or the documented package path, then pass the typed props your screen needs. The registry usage snippet matches the catalog export for this variant.
TypeScriptimport { AuthSignUp } from "@kamod-ch/blocks/auth/auth-sign-up";
export const Example = () => <AuthSignUp />;AuthSignUp is a ready-made demonstration page with no public props. The reference below describes the Local Form you can configure after copying the source. Definitions come directly from the implementation; descriptions explain where your application takes over. Start with the component or data shape you want to change, then follow its type link to the complete definition.
The signatures below come from the copied source files. Use the Data Type Reference to inspect complete definitions and required fields. Optional callbacks do not imply that a backend is included. Select a table row’s type name to open its definition automatically. Use import type from the corresponding copied file when typing your own data or component inputs. This reference describes the shipped source; changes in your local files will not update this page.
? means the field may be omitted, not that every optional field has a fallback value. When a field accepts an array, its required marker means you must supply the array; check the helper’s behavior before using an empty [].| Prop / type | Description |
|---|---|
onSubmit | Name, email, and password. |
validatePassword | Optional extra password rules from the consumer. |
onOauth | OAuth button callback. |
Expand a definition to copy its exact TypeScript shape. Required fields are listed below each summary for fields declared in that definition. The code header shows the file's installation path; copy the definition with the button beside it. For intersections, also inspect the referenced base type’s required fields. Local types can be imported from the same files as your copied components; they are not added to the zero-prop page wrapper.
ComponentPropsComponentProps before adapting it.onSubmit, validatePassword, onOauthThe form validates an email and a password before awaiting onSubmit. GitHub and Google buttons call onSocialLogin independently. Your authentication service handles the session, provider redirect and post-login destination.
onSocialLogin to your provider flow. Showing a provider button alone does not configure OAuth or create a session.TypeScript<LoginForm
onSocialLogin={startProviderLogin}
onSubmit={signIn}
/>The callback names above represent functions supplied by your app. Keep server-side validation and credential handling in your authentication service. Adapt the form’s demo messages to that service’s actual result.
The page provides the setting; the form owns the interaction. This composition combines Input, Label, Button and Alert into a complete sign-in interface. Your application supplies the authentication service and real destinations; a successful preview interaction does not create a session.
Edit page.tsx for centering, surfaces, branding and any cover image. Edit auth-form.tsx for fields and submission. The full-page wrapper takes no configuration props; pass callbacks to LoginForm inside that page. See Render the Page or Form for both entry points.
Shared auth/shared helpers supply validation and provider artwork; optional branding lives in shared/branding. Keep imported helpers when reusing the form elsewhere. Its values are local component state: there is no public value or initialValues prop. To add a field or prefill values, update state, validation and the payload type together.
Wait for the actual sign-in result. The LoginValues payload contains email and password. Return your service promise so pending feedback lasts until the operation completes.
This line in the Submission Handler is the handoff to your application, after local validation:
TypeScriptawait onSubmit?.(values);The optional callback means the demo can show success without a connected service. A rejected promise enters the form’s error state; a resolved error object does not do so automatically. Follow Connect Your Authentication Service to map your service’s result and replace the demo messages.
A centered, constrained form uses fluid outer padding. On narrow screens it fills the available content width without a fixed desktop canvas. Its compact layout works well when the form itself is the page’s main task.
Let the page grow when feedback appears. The full-page wrappers use min-h-svh, not a fixed content height. Keep labels, legal links and errors able to wrap, and test with the on-screen keyboard open. When embedding the form in a Dialog, preserve its scroll area and keep the submit button reachable.
Pair bg-background with text-foreground and card surfaces with their matching foreground token. The block theming guide explains how to keep fields, errors and loading states legible in both modes. Review replacement images at each breakpoint; decorative art should not carry instructions or duplicate the form’s text alternative.
Label associated with its control’s id, retain aria-invalid and link help/errors through aria-describedby. A placeholder is secondary guidance, not a label. If you render two instances, give labels, inputs and messages distinct ID prefixes.focusFirstError before sending data. Include new inputs in that logic and keep messages beside the field they explain. Server failures need a clear retry path without exposing sensitive account details; review the input accessibility guidance when extending feedback.loading disables submission controls, while role="status" and aria-live="polite" announce messages. Preserve these cues when changing button copy. If the next step navigates away, your application should also manage focus in the destination page.Invalid input → correction → pending request → success or a recoverable failure. Repeat at 320px, 768px, 1024px and 1440px, with keyboard-only input, 200% zoom and both color modes. Use Check the Complete Flow for the integration checklist.
Replace simulation before connecting real users. Remove sleep()and demoRejects(), rewrite the success/error messages and provide real account and legal URLs. Check Form Props for the destinations this variant exposes. Branded layouts also need a real home destination on KamodBrandLink, whose fallback is #.
Connect onSocialLogin separately from onSubmit. Provider buttons start their own flow; displaying GitHub or Google does not configure an OAuth service. The variant behavior notes explain these callback boundaries.
Keep server validation, sessions and recovery in your application’s service layer. Reuse the form’s visual structure while adapting its messages and next steps to your actual product. Finish with the whole-journey review, including a slow request and a failed one.
Use the Checked-in Kamod Implementation as your reference when adapting this variant. The Showcase’s Code Tab includes its supporting files, and the Setup Instructions explain where to place them and how to keep their imports intact. Before changing a helper, trace where it is used in the composition and check its inputs in the Props and Data Reference. This helps you adapt one part of the block without overlooking the files or behavior it depends on.
Source: Auth Sign Up on GitHub
Keep your local copy focused on the layout and interactions your app actually uses. Start with the data and content, then adjust composition and styling using the same semantic theme tokens.
Ready to integrate? Follow Add This Block and the Local Usage Example.
This variant follows the corresponding auth design in the shadcn/ui collection. Use the reference to compare . Adapt the branding, copy and destinations to your product, then follow the Usage Example to connect the form’s callbacks to your authentication service.
This version uses Kamod’s Preact form components and theme tokens.
Inspect the Original Variant’s Source for the reference composition. The Variant Details above describe this implementation’s behavior and integration boundaries.
Use the original as a design reference. To install the Preact version shown here, follow Add This Block and use this page’s Code tab. Its files and imports are prepared for Kamod.
You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.
Return to Bring a Complete Layout into Your App to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.
Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.
Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.
Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.