Skip to content

Address Component

A component for structured address information. When you see "kind": "address" in a component, it represents an address field with continent, country, state, and city fields organized hierarchically.

Understanding Address Component Fields

When reading an address component in the schema, you'll see these fields:

FieldTypeRequiredDescription
idstringYesUnique identifier for this address field
kindstringYesAlways "address" for address components
metadataobjectNoComponent-specific metadata (empty object)
rulesobjectNoValidation rules
rules.requiredbooleanNoIf true, the field must be provided

Understanding Address Structure

The address value is an object with four hierarchical fields. Fields are typically selected in order (continent → country → state → city), where selecting a parent field may filter available options for child fields.

FieldTypeDescription
continentstringContinent name (e.g., "Europe")
countrystringCountry name (e.g., "Turkey")
statestringState or province name (e.g., "Istanbul")
citystringCity name (e.g., "Istanbul")

Note: Fields are hierarchical - selecting a continent may filter available countries, selecting a country may filter available states, etc.

Reading Metadata

The address component currently has no specific metadata fields. If metadata is present, it will be an empty object {} and can be ignored.

Understanding Validation Rules

rules.required

  • What it means: If true, the address must be provided. Validation fails if the address object is null or incomplete
  • How to use: Mark the address field as required in your form UI
  • Note: The required rule applies to the entire address object. Individual fields (continent, country, state, city) cannot be independently required

Example: Reading an Address Component

json
{
  "id": "address",
  "kind": "address"
}

What this tells you:

  • Field ID is "address" - use this to reference the field
  • Field is optional (no required rule)
  • Render a hierarchical address selector (continent → country → state → city)

Example: Required Address Component

json
{
  "id": "shippingAddress",
  "kind": "address",
  "rules": {
    "required": true
  }
}

What this tells you:

  • Field ID is "shippingAddress"
  • Field is required

Notes

  • Address fields are typically populated through cascading dropdowns or search interfaces
  • The component does not include street address, postal code, or other detailed address fields - these should be handled by separate text components if needed
  • Address validation (format, existence) should be handled at the application level, not in the schema