PHPackages                             timeax/ui-config-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. timeax/ui-config-schema

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

timeax/ui-config-schema
=======================

SDK config schema designed to provide a general shape for Input field configurations

v0.0.2(3mo ago)092MITPHP

Since Jan 27Pushed 3mo agoCompare

[ Source](https://github.com/timeax/ui-config-schema)[ Packagist](https://packagist.org/packages/timeax/ui-config-schema)[ RSS](/packages/timeax-ui-config-schema/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (2)

```
# Timeax UI Config Schema

Portable, framework-agnostic primitives for describing **UI configuration forms** (fields, options, rules, secrets) and
returning **structured validation results**.

This package is meant to be shared across SDKs and host apps so they can expose a consistent “config UI schema” without
coupling to any specific UI framework (React/Vue/etc.) or product domain (payments, plugins, etc.).

It supports both:

- **Flat schemas** (classic `ConfigSchema` → `ConfigField[]`)
- **Forti-style nested schemas** (tree: `UiConfigSchema` → `settings: { key: ConfigNode }` with `ConfigGroup` +
  `ConfigField`)

---

## Installation

```bash
composer require timeax/ui-config-schema
```

---

What this package provides
--------------------------

[](#what-this-package-provides)

### Forti-style tree schema

[](#forti-style-tree-schema)

- **`UiConfigSchema`**: root container with `settings: array`
- **`ConfigNode`**: node interface (either a group or a field)
- **`ConfigGroup`**: a group node containing `children: array`
- **`ConfigField`**: a field node (leaf) — also implements `ConfigNode`

### Flat schema (backwards-compatible)

[](#flat-schema-backwards-compatible)

- **`ConfigSchema`**: a list of `ConfigField` objects

### Options

[](#options)

- **`ConfigOption`**: discrete option values for selects/radios/multiselect, etc.

### Config values container

[](#config-values-container)

- **`ConfigBag`**: holds `options` + `secrets`, supports looking up values and filtering by schema (secrets excluded from default serialization)

### Validation results

[](#validation-results)

- **`ConfigValidationResult`**: consistent shape for validation outcomes + field errors
- **`ConfigValidationError`**: a single field-level error record

### Optional contract

[](#optional-contract)

- **`ProvidesConfigSchema`**: a tiny interface for anything that can expose a schema

---

Included JSON Schema
--------------------

[](#included-json-schema)

This repository ships a Draft-07 JSON Schema that mirrors the Forti-style structure:

- `schema/timeax.ui-config-schema.draft-07.json`

It validates objects shaped like:

```
{
  "settings": {
    "gateway": {
      "type": "group",
      "label": "Gateway",
      "children": {
        "public_key": {
          "label": "Public Key",
          "type": "text",
          "required": true
        },
        "secret_key": {
          "label": "Secret Key",
          "type": "password",
          "required": true,
          "secret": true
        }
      }
    }
  }
}
```

---

Quick examples
--------------

[](#quick-examples)

### 1) Define a Forti-style tree schema

[](#1-define-a-forti-style-tree-schema)

```
