Skip to content
Aggarly OS
  • Getting Started
    • Introduction
  • Foundations
    • Colors
    • Spacing
    • Radius
    • Typography
    • Shadows
    • Z-Index
    • Gradients
    • Tokens
    • RTL & Direction
    • Theming
  • Layout
    • Containers
    • Grid System
    • Layout Utilities
  • Components
    • Alerts
    • Avatars
    • Buttons
    • Button Group
    • Badges
    • Inputs
    • Select
    • Checkbox
    • Counters-timers
    • Radio
    • Switch
    • Stepper
    • Select-pro
    • Cards
    • Modals
    • Dropdown
    • Popover
    • Tooltip
    • Accordion
    • Breadcrumb
    • Tabs
    • Navbar
    • List Group
    • Toasts
    • Skeleton
    • Pagination
    • Progress
    • Table
    • Icons
    • Form
    • Ribbons
    • Spinner
    • Offcanvas
    • Feedback
    • Grid
    • Data UI
  • Data UI
    • Overview
  • Platform
    • Reference DataCore
  • Widgets
    • KPI
    • Analytics
    • Behavior
  • Brand
    • Logo
    • Brand Usage
Components/Form

Form

Enterprise form primitives for consistent labeling, hint/error messaging, accessibility wiring, and premium production layouts. Use FormSection for grouped surfaces, FormRow for responsive columns, and FormFooter for actions.

Enterprise Sectioned Form

Premium grouped form with header, description, actions, responsive rows, framed fields, and a footer action bar.

Student details
Core identity fields used across scheduling, notes, and exports.
Used for audit logs, billing exports, and cross-system matching.
Show code
Sectioned enterprise form (JSX)
import {
  Form, FormSection, FormRow, FormField, FormLabel, FormControl, FormHint, FormFooter
} from "@/design-system/components/form";
import { Input } from "@/design-system/components/Input";
import { Button } from "@/design-system/components/Button";

export function Example() {
  return (
    <Form density="comfortable">
      <FormSection
        tone="primary"
        variant="surface"
        title="Student details"
        description="Core identity fields used across scheduling, notes, and exports."
        actions={<Button size="sm" variant="ghost">Auto-fill</Button>}
      >
        <FormRow columns={2}>
          <FormField name="firstName" required framed>
            <FormLabel>First name</FormLabel>
            <FormControl asChild>
              <Input placeholder="First name" autoComplete="given-name" />
            </FormControl>
          </FormField>

          <FormField name="lastName" required framed>
            <FormLabel>Last name</FormLabel>
            <FormControl asChild>
              <Input placeholder="Last name" autoComplete="family-name" />
            </FormControl>
          </FormField>
        </FormRow>

        <FormField name="studentId" required framed>
          <FormLabel>Student ID</FormLabel>
          <FormControl asChild>
            <Input placeholder="e.g. THR-10429" autoComplete="off" />
          </FormControl>
          <FormHint>Used for audit logs, billing exports, and cross-system matching.</FormHint>
        </FormField>

        <FormFooter align="end" divider>
          <Button size="sm" variant="ghost">Cancel</Button>
          <Button size="sm" variant="primary">Save</Button>
        </FormFooter>
      </FormSection>
    </Form>
  );
}

Horizontal Settings Form

Labels left, controls right. Ideal for settings, admin screens, and dense enterprise workflows.

Used for scheduling and reminders.
Show code
Horizontal form (JSX)
import { Form, FormField, FormLabel, FormControl, FormHint } from "@/design-system/components/form";
import { Input } from "@/design-system/components/Input";

export function Example() {
  return (
    <Form layout="horizontal" density="compact">
      <FormField name="timezone" framed>
        <FormLabel>Timezone</FormLabel>
        <FormControl asChild>
          <Input placeholder="America/New_York" />
        </FormControl>
        <FormHint>Used for scheduling and reminders.</FormHint>
      </FormField>

      <FormField name="npi" framed>
        <FormLabel optional>NPI</FormLabel>
        <FormControl asChild>
          <Input placeholder="Optional" />
        </FormControl>
      </FormField>
    </Form>
  );
}

Interactive Validation Preview

Client-side preview demonstrating how FormError drives aria-describedby and invalid styling without server->client handler issues.

Invite student
Example client-side validation with enterprise form primitives.
Used across scheduling, notes, and exports.
Optional. Used for portal invitations.
Show code
Interactive validation preview (JSX)
// See: src/app/[locale]/docs/components/form/_components/FormValidationPreview.tsx

Program Variant (Admin / Power-User)

A "desktop tool" look for diagnostics panels: dashed border + grid background.

Diagnostics
Power-user configuration panel for admin/support workflows.
Show code
Program section (JSX)
import { FormSection, FormRow, FormField, FormLabel, FormControl } from "@/design-system/components/form";
import { Input } from "@/design-system/components/Input";

export function Example() {
  return (
    <FormSection
      variant="program"
      tone="neutral"
      title="Diagnostics"
      description="Power-user configuration panel for admin/support workflows."
    >
      <FormRow columns={2}>
        <FormField name="traceId" framed>
          <FormLabel>Trace ID</FormLabel>
          <FormControl asChild>
            <Input placeholder="Paste a trace id" />
          </FormControl>
        </FormField>

        <FormField name="sessionKey" framed>
          <FormLabel>Session key</FormLabel>
          <FormControl asChild>
            <Input placeholder="Paste a session key" />
          </FormControl>
        </FormField>
      </FormRow>
    </FormSection>
  );
}