• Docs
  • Components
  • Blocks
  • Admin
CtrlK
Get Started
  • Introduction
  • Setup
  • CLI
  • VS Code Extension
  • Figma Code Connect
  • MCP Server
  • llms.txt
  • Changelog
Foundations
  • Design Tokens
  • Theming & Modes
  • Semantic Colors
  • Spacing
  • Typography
Testing
  • Test Guide
  • Performance Tests
  • Visual Regression
Components
  • Accordion
  • Activity Feed
  • Alert
  • Avatar
  • Badge
  • Breadcrumbs
  • Button
  • Card
  • Carousel
  • Checkbox
  • Collapsible
  • Combobox
  • Command Palette
  • Context Menu
  • Date Picker
  • Dialog
  • Dropdown Menu
  • File Upload
  • Hover Card
  • Input
  • Kbd
  • Label
  • Menubar
  • Metric Card
  • Multi Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Quick Actions
  • Radio
  • Rating
  • Resizable
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Skeleton
  • Slider
  • Spinner
  • Split Button
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree View
Blocks
  • Activity Feed
  • App Shell
  • Authentication Block
  • Benefits Section
  • Cta Section
  • Data Table
  • Empty State
  • Faq Section
  • Feature Grid Section
  • Footer Section
  • Hero Section
  • Kpi Dashboard
  • Kpi Strip
  • Link Card
  • Metric Card
  • Navigation Header
  • Pagination Footer
  • Pricing Table
  • Quick Actions
  • Settings Screen
Resources
  • API Reference

Registration

Registration example demonstrating Fragment UI components and patterns.

Example

Code

import {
  FormEnhanced,
  FormFieldEnhanced,
  validators,
  Button,
  Input,
} from "@fragment_ui/ui";

function RegistrationForm() {
  return (
    <FormEnhanced
      onSubmit={(data) => {
        console.log("Form submitted", data);
      }}
      validationMode="onBlur"
    >
      <div className="space-y-4">
        <FormFieldEnhanced
          name="name"
          label="Full Name"
          rules={validators.compose(
            validators.required(),
            validators.minLength(2)
          )}
        >
          <Input placeholder="John Doe" />
        </FormFieldEnhanced>

        <FormFieldEnhanced
          name="email"
          label="Email"
          rules={validators.compose(
            validators.required(),
            validators.email()
          )}
        >
          <Input type="email" placeholder="john@example.com" />
        </FormFieldEnhanced>

        <FormFieldEnhanced
          name="password"
          label="Password"
          rules={validators.compose(
            validators.required(),
            validators.minLength(8)
          )}
        >
          <Input type="password" />
        </FormFieldEnhanced>

        <Button type="submit">Register</Button>
      </div>
    </FormEnhanced>
  );
}

Features

  • Form validation with error messages
  • Email format validation
  • Password strength requirements
  • Accessible form fields with ARIA labels
  • Visual error feedback