---
title: "pdx-material-button-toggle JSON API (Canonical)"
slug: "pdx-material-button-toggle-json-api"
doc_type: "api-reference"
component: "pdx-material-button-toggle"
document_kind: "json-api-canonical"
reference_mode: "canonical"
contract_format: "json"
contract_source: "runtime-and-code"
description: "Referencia canonica do contrato JSON do componente pdx-material-button-toggle."
category: "components"
sub_category: "dynamic-fields"
audience:
  - "frontend"
  - "architect"
  - "platform-team"
level: "advanced"
status: "active"
owner: "praxis-ui"
source_of_truth:
  - "projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.metadata.ts"
  - "projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.component.ts"
  - "projects/praxis-dynamic-fields/src/lib/base/simple-base-select.component.ts"
  - "projects/praxis-core/src/lib/models/material-field-metadata.interface.ts"
source_of_truth_last_verified: "2026-04-27"
last_updated: "2026-04-27"
toc: true
sidebar: true
tags:
  - "json-api"
  - "canonical-contract"
  - "pdx-material-button-toggle"
api_stability: "canonical"
schema_verified: true
runtime_verified: true
editor_coverage_verified: false
runtime_scope: "public"
legacy_paths_present: true
has_known_mismatches: false
related_components:
  - "praxis-table"
  - "pdx-base-select-runtime-contract"
  - "pdx-base-input-runtime-contract"
  - "pdx-material-radio-group"
  - "pdx-material-selection-list"
---

# pdx-material-button-toggle

Este documento e a referencia canonica da API JSON de pdx-material-button-toggle.

## Summary

- Tipo documental: API reference canonica de contrato JSON.
- Source of truth: runtime e codigo declarados no frontmatter.
- Objetivo operacional: consulta rapida, auditavel e deterministica sob pressao.
- Resumo funcional: Contrato JSON metadata-driven com comportamento definido por runtime e schema associado.

## Purpose and scope

- O componente consome payload JSON metadata-driven e expoe comportamento runtime configuravel por contrato.
- Esta referencia cobre contrato publico, classificacao de paths e semantica de cobertura (runtime/schema/editor).
- Fora de escopo: quickstart, tutorial narrativo e notas arquiteturais que nao alteram contrato publico.

## Consulta rapida (obrigatorio)

| Regra/tema | Observado | Canonico desejado | Status | Evidencia |
| --- | --- | --- | --- | --- |
| Component id | `pdx-material-button-toggle` | Manter ID canonico estavel e versionado por contrato | Active | frontmatter.component |
| Primary contract source | `runtime-and-code` | Runtime, schema e docs devem permanecer rastreaveis | Partial | frontmatter.contract_source + source_of_truth |
| Runtime coverage | `true` | Comportamentos runtime criticos devem ficar explicitamente verificados | Active | `projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.component.ts`, focused component specs on 2026-04-27 |
| Schema/type coverage | `true` | Tipos e schema devem refletir paths publicos do contrato | Active | source_of_truth + Detailed API reference |
| Editor/tooling coverage | `false` | Editor/tooling deve espelhar somente contrato publico suportado | Partial | `projects/praxis-core/src/lib/metadata/field-selector-control-type.constants.ts`, `projects/praxis-dynamic-fields/src/lib/services/component-registry/component-registry.service.ts` |
| Legacy paths | `true` | Segregar legado de caminhos canonicos com janela de migracao | Partial | frontmatter.legacy_paths_present |
| Known mismatches | `false` | Registrar observed vs desired de forma auditavel | Active | frontmatter.has_known_mismatches |

## Source of truth

| Source | Kind | Notes |
| --- | --- | --- |
| projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.metadata.ts | schema-metadata | Arquivo presente no repositorio e usado como evidencia de contrato. |
| projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.component.ts | runtime-code | Arquivo presente no repositorio e usado como evidencia de contrato. |
| projects/praxis-dynamic-fields/src/lib/base/simple-base-select.component.ts | runtime-code | Arquivo presente no repositorio e usado como evidencia de contrato. |
| projects/praxis-core/src/lib/models/material-field-metadata.interface.ts | schema-types | Arquivo presente no repositorio e usado como evidencia de contrato. |

## Support legend

- **Active**: suportado em runtime e liberado para uso externo.
- **Partial**: suporte parcial, com restricoes, lacunas ou validacao incompleta.
- **Declared-only**: declarado em tipos/schema sem evidencia operacional completa.
- **Schema-only**: presente em schema/tipos sem cobertura runtime confirmada.
- **Deprecated**: legado suportado por janela de migracao definida.

## Contract status snapshot

| Item | Value | Notes |
| --- | --- | --- |
| Reference mode | `canonical` | Deve permanecer canonico |
| Contract format | `json` | Contrato metadata-driven |
| Contract source | `runtime-and-code` | Alinhar com source_of_truth |
| Runtime scope | `public` | Escopo publicado para consumidores |
| Runtime verified | `true` | Revisar sempre com evidencia de runtime |
| Schema verified | `true` | Revisar sempre com evidencia de tipos/schema |
| Editor coverage verified | `false` | Revisar sempre com evidencia de editor/tooling |
| Legacy paths present | `true` | Segregar legado de contrato canonico |
| Has known mismatches | `false` | Divergencias devem aparecer em secao dedicada |

## Contract classification (obrigatorio)

### Canonical paths (public contract)

| Path | Type | Required | Default | Status | Notes |
| --- | --- | --- | --- | --- | --- |
| `metadata` | object | true | n/a | Active | See Detailed API reference for runtime semantics. |
| `readonlyMode` | boolean | false | `false` | Active | Blocks interaction and exposes `aria-readonly`. |
| `disabledMode` | boolean | false | `false` | Active | Blocks interaction and exposes disabled styling/ARIA. |
| `visible` | boolean | false | `true` | Active | Hides the host and marks it `aria-hidden`. |
| `presentationMode` | boolean | false | `false` | Active | Blocks interaction as readonly presentation output. |
| `metadata.controlType` | string | false | n/a | Active | See Detailed API reference for runtime semantics. |
| `metadata.toggleOptions` | array | false | n/a | Active | Canonical inline option list. |
| `metadata.options` | array | false | n/a | Deprecated | Backward-compatible alias when `toggleOptions` is not provided. |
| `metadata.multiple` | boolean | false | `false` | Active | Enables multiple selected toggle buttons. |
| `metadata.maxSelections` | number | false | n/a | Active | Enforced when `multiple=true`. |
| `metadata.appearance` | string | false | `legacy` | Active | Material button-toggle appearance. |
| `metadata.resourcePath` | string | false | n/a | Active | Remote option loading through base select. |
| `metadata.optionSource` | object | false | n/a | Active | Canonical metadata-driven option source. |

### Supported legacy paths

| Legacy path | Canonical replacement | Support window | Runtime behavior | Notes |
| --- | --- | --- | --- | --- |
| `metadata.options` | `metadata.toggleOptions` | beta cleanup | accepted for backward compatibility when `toggleOptions` is absent | Prefer `toggleOptions` for new payloads; no new aliases should be introduced. |

### Internal-only paths

Nao ha paths internal-only confirmados no contrato publico desta revisao.

### Experimental paths

Nao ha paths experimentais confirmados no contrato publico desta revisao.

## Public contract surface (obrigatorio)

### Top-level configuration blocks

| Block | Purpose | Required | Merge strategy | Notes |
| --- | --- | --- | --- | --- |
| `metadata` | Payload declarativo principal do componente | true | deep-merge | runtime linkage verified for core flows (component specs, 2026-04-27). |
| `readonlyMode` | Override de readonly no host/runtime | false | override | disables group interaction and exposes readonly semantics. |
| `disabledMode` | Override de disabled no host/runtime | false | override | disables group interaction and exposes disabled semantics. |
| `visible` | Override de visibilidade no host/runtime | false | override | host visibility binding remains active. |
| `presentationMode` | Renderizacao de apresentacao sem interacao | false | override | disables group interaction as readonly output. |

### Nested configuration blocks

| Path | Type | Required | Default | Constraints | Notes |
| --- | --- | --- | --- | --- | --- |
| `metadata.controlType` | string | false | n/a | component-defined | Active; selects the button-toggle renderer. |
| `metadata.toggleOptions` | array | false | n/a | component-defined | Active; items accept `value`, `text`, `label`, and `disabled`. |
| `metadata.options` | array | false | n/a | component-defined | Deprecated alias accepted for backward compatibility. |
| `metadata.multiple` | boolean | false | `false` | component-defined | Active; controls single vs multiple selection. |
| `metadata.maxSelections` | number | false | n/a | component-defined | Active; truncates extra values on group change. |
| `metadata.appearance` | string | false | `legacy` | `legacy` or `standard` | Active; passed to Material group. |
| `metadata.resourcePath` | string | false | n/a | component-defined | Active; remote option loading through base select. |
| `metadata.optionSource` | object | false | n/a | component-defined | Active; canonical metadata-driven option source. |
| `metadata.filterCriteria` | object | false | `{}` | component-defined | Active; passed to remote option loading. |
| `metadata.optionLabelKey` | string | false | `label` | component-defined | Active; maps remote labels. |
| `metadata.optionValueKey` | string | false | `value` | component-defined | Active; maps remote values. |

### Input bindings (inbound data)

| Binding/Path | Type | Required | Source | Runtime normalization | Notes |
| --- | --- | --- | --- | --- | --- |
| `metadata` | object | true | host-json | component-defined | Primary inbound contract payload. |
| `readonlyMode` | boolean | false | host-runtime | effective boolean | Blocks interaction and exposes readonly semantics. |
| `disabledMode` | boolean | false | host-runtime | effective boolean | Blocks interaction and exposes disabled semantics. |
| `visible` | boolean | false | host-runtime | effective boolean | Host-level visibility override. |
| `presentationMode` | boolean | false | host-runtime | effective boolean | Presentation override that blocks interaction as readonly output. |

### Output events

| Event | Payload | Trigger | Stability | Notes |
| --- | --- | --- | --- | --- |
| `searchTermChange` | unknown | runtime-event | Experimental | Validate payload shape against source_of_truth. |
| `selectionChange` | unknown | runtime-event | Experimental | Validate payload shape against source_of_truth. |
| `openedChange` | unknown | runtime-event | Experimental | Validate payload shape against source_of_truth. |
| `valueChange` | unknown | runtime-event | Experimental | Validate payload shape against source_of_truth. |
| `focusChange` | unknown | runtime-event | Experimental | Validate payload shape against source_of_truth. |
| `nativeBlur` | unknown | runtime-event | Experimental | Validate payload shape against source_of_truth. |
| `nativeChange` | unknown | runtime-event | Experimental | Validate payload shape against source_of_truth. |

### External side channels

| Channel | Direction | Contract | Failure mode | Notes |
| --- | --- | --- | --- | --- |
| `host/services/storage` | bidirectional | component-defined | component-defined | Side channels variam por componente e host; verificar em source_of_truth. |

### Host/runtime dependencies

| Dependency | Required | Environment | Purpose | Notes |
| --- | --- | --- | --- | --- |
| `material-button-toggle.metadata.ts` | true | browser/dev/prod/ssr | contract resolution | Refer to `projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.metadata.ts`. |
| `material-button-toggle.component.ts` | true | browser/dev/prod/ssr | contract resolution | Refer to `projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.component.ts`. |
| `simple-base-select.component.ts` | true | browser/dev/prod/ssr | contract resolution | Refer to `projects/praxis-dynamic-fields/src/lib/base/simple-base-select.component.ts`. |
| `material-field-metadata.interface.ts` | true | browser/dev/prod/ssr | contract resolution | Refer to `projects/praxis-core/src/lib/models/material-field-metadata.interface.ts`. |

## Coverage by surface (obrigatorio)

### Coverage matrix (runtime, schema/type, editor/tooling)

| Surface | Verified | Coverage status | Evidence | Notes |
| --- | --- | --- | --- | --- |
| Runtime | `true` | Active | `projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.component.ts`, focused component specs | Core runtime flows verified via focused component specs on 2026-04-27; editor/tooling coverage remains independent. |
| Schema/Types | `true` | Active | source_of_truth + Detailed API reference | Reconcile schema/types with canonical paths during follow-up when needed. |
| Editor/Tooling | `false` | Partial | `projects/praxis-core/src/lib/metadata/field-selector-control-type.constants.ts`, `projects/praxis-dynamic-fields/src/lib/services/component-registry/component-registry.service.ts` | Selector/control-type tooling linkage verified via default selector map and registry seeding; visual editor end-to-end coverage remains not-yet-verified. |

### Runtime coverage boundaries

- Ambientes suportados: browser/dev/prod; SSR/hydration appears to be component-dependent unless explicitly verified.
- Pre-condicoes: payload JSON valido, bindings de host consistentes e dependencias descritas no source_of_truth.
- Fora de cobertura confirmada: caminhos internos, experimentais ou aliases nao enumerados formalmente.

### Editor and tooling notes

- Evidencia de tooling: selector `pdx-*` mapeado em `DEFAULT_FIELD_SELECTOR_CONTROL_TYPE_MAP` e semeado no `ComponentRegistryService`; editor visual E2E permanece not-yet-verified.
- O que esta exposto no editor visual depende da cobertura real do workspace e nao deve ser inferido como suporte runtime total.
- Campos disponiveis apenas via JSON/manual devem continuar no contrato, com rotulo explicito de cobertura parcial.
- Quando houver divergencia entre editor e runtime, manter mismatch rastreavel em secao dedicada.

## Resolution and precedence model (obrigatorio)

### Merge order

1. defaults do componente
2. contrato JSON recebido
3. overrides de host/runtime
4. normalizacoes internas

### Fallback order

contrato explicito -> aliases legados (quando suportados) -> defaults internos -> comportamento seguro

### Override points

- inputs publicos do componente
- configuracao JSON de runtime
- integracoes de host (servicos/tokens/adapters)

### Runtime normalization

Alias e defaults devem convergir para paths canonicos; onde nao houver evidencia, manter not-yet-verified de forma explicita.

### Precedence rules

Em conflito entre alias legado e path canonico, priorizar path canonico e registrar janela de migracao do legado.

## Validation and error semantics (obrigatorio)

### Validation model

| Path/Rule | Validation phase | Behavior on fail | Error code / warning | Notes |
| --- | --- | --- | --- | --- |
| canonical-paths | parse/runtime | component-defined (warn/reject/default) | not-yet-standardized | Semantica detalhada preservada na referencia tecnica por componente. |

### Invalid and unknown field handling

- Campos desconhecidos: comportamento component-defined (ignore, warn ou reject).
- Tipos invalidos: pode haver fallback, warning ou falha, conforme runtime especifico.
- Valores fora de dominio: registrar observed vs desired em Known limitations and mismatches.

### Fail-open / fail-closed behavior

| Condition | Mode | Runtime behavior | Consumer impact |
| --- | --- | --- | --- |
| invalid-or-unknown-field | component-defined | not-yet-verified | Pode gerar warning, fallback silencioso ou rejeicao; validar por componente. |

### Runtime warnings vs hard failures

| Condition | Severity | Observability | Consumer action |
| --- | --- | --- | --- |
| partial-or-declared-only-coverage | warning | logs/eventos do componente | Confirmar ligacao runtime antes de uso critico. |
| mismatch-confirmed | error-or-warning | componente/host observability | Planejar migracao e corrigir contrato/runtime. |

## Detailed API reference
### Preserved technical reference (normalized from previous revision)

### 1. Visao Geral e Quando Usar
`pdx-material-button-toggle` usa `mat-button-toggle-group` para selecao single ou multipla via JSON.

Use quando precisar:
- opcoes curtas com alta visibilidade de estado selecionado;
- UX mais compacta que radio/checkbox;
- alternar entre single e multiple no mesmo tipo de componente.

### 2. API do Componente (Inputs/Outputs)
| Propriedade | Tipo | Padrao | Obrigatorio | Comportamento |
| --- | --- | --- | --- | --- |
| `metadata` | `MaterialButtonToggleMetadata` | - | Sim | Contrato principal dos toggles. |
| `selectionChange` | `T \| T[]` | - | Output herdado | Mudanca da selecao atual. |
| `optionSelected` | `SelectOption` | - | Output herdado | Opcao clicada pelo usuario. |
| `optionsLoaded` | `SelectOption[]` | - | Output herdado | Carga remota de opcoes. |
| `openedChange` | `boolean` | - | Output herdado | Output herdado do base select. |

### 3. Matriz de Cobertura JSON (Completa)
#### 3.1 Campos especificos do componente
| Caminho JSON | Tipo | Status | Comportamento em runtime |
| --- | --- | --- | --- |
| `metadata.controlType` | `'buttonToggle'` | Ativo | Define renderer de toggle buttons. |
| `metadata.toggleOptions` | `Array<{ value; text?; label?; disabled? }>` | Ativo | Fonte principal de opcoes dos toggles. |
| `metadata.options` | `Array<any>` | Deprecated | Alias legado quando `toggleOptions` nao vem. |
| `metadata.multiple` | `boolean` | Ativo | Alterna entre single e multiplo no grupo. |
| `metadata.maxSelections` | `number` | Ativo | Enforcado em `onGroupChange` quando multiplo. |
| `metadata.appearance` | `'legacy' \| 'standard'` | Ativo | Aparencia visual do `mat-button-toggle-group`. |
| `metadata.resourcePath` | `string` | Ativo | Carga remota de opcoes via base select. |
| `metadata.filterCriteria` | `Record<string, any>` | Ativo | Filtro base de backend. |
| `metadata.optionLabelKey` | `string` | Ativo | Chave de label em resposta remota. |
| `metadata.optionValueKey` | `string` | Ativo | Chave de value em resposta remota. |
| `metadata.optionSource` | `OptionSourceMetadata` | Ativo | Fonte canonica metadata-driven para opcoes derivadas. |
| `metadata.readonly` | `boolean` | Ativo | Bloqueia interacao e expoe `aria-readonly`. |
| `metadata.selectAll` | `boolean` | Declared-only | Sem UI dedicada de selecionar todos neste componente. |
| `metadata.searchable` | `boolean` | Declared-only | Sem input de busca no template. |

#### 3.2 Campos herdados compartilhados (exaustivo)
Contrato completo compartilhado para selects:
- [pdx-base-select-runtime-contract.json-api.md](projects/praxis-dynamic-fields/src/lib/base/pdx-base-select-runtime-contract.json-api.md)

Contrato compartilhado de input base:
- [pdx-base-input-runtime-contract.json-api.md](projects/praxis-dynamic-fields/src/lib/base/pdx-base-input-runtime-contract.json-api.md)

Resumo de composicao deste componente:
- `Ativo`: toggleOptions, multiple, maxSelections, appearance, estados governados, remote source e optionSource.
- `Declared-only`: selectAll/searchable sem binding visual.
- `Deprecated`: alias `options` aceito apenas para compatibilidade de payloads antigos.

### 4. Mapeamento de Comportamento
- Selecao: valor unico ou array conforme `multiple`.
- Limite: ao exceder `maxSelections`, valores extras sao truncados.
- Eventos: `optionSelected` identifica a opcao clicada; `selectionChange` publica valor final.
- Acessibilidade: label associado por `aria-labelledby`, `aria-required`, `aria-invalid`, `aria-disabled` e `aria-readonly`.
- Estados governados: `disabledMode`, `readonlyMode`, `presentationMode` e `metadata.readonly` bloqueiam interacao do grupo.
- Renderizacao: grupo de botao toggle com erro/hint fora do grupo.

### 5. Exemplo Minimo (JSON + Uso)
```json
{
  "componentId": "pdx-material-button-toggle",
  "metadata": {
    "name": "viewMode",
    "label": "Modo",
    "controlType": "buttonToggle",
    "multiple": false,
    "toggleOptions": [
      { "value": "list", "text": "Lista" },
      { "value": "cards", "text": "Cards" }
    ]
  }
}
```
Uso: alternancia rapida de modo de visualizacao.

### 6. Exemplo Corporativo (JSON + Uso)
```json
{
  "componentId": "pdx-material-button-toggle",
  "metadata": {
    "name": "exportChannels",
    "label": "Canais de Exportacao",
    "controlType": "buttonToggle",
    "multiple": true,
    "maxSelections": 2,
    "appearance": "standard",
    "resourcePath": "exports/channels/options",
    "filterCriteria": { "tenant": "corp", "enabled": true },
    "optionLabelKey": "label",
    "optionValueKey": "code",
    "hint": "Escolha ate 2 canais."
  }
}
```
Uso: habilita multiplos canais com limite e dados remotos.

### 7. Troubleshooting e Armadilhas Comuns
1. Mais de `maxSelections` continua selecionado.
Correcao: verificar se `multiple=true`; limite so e aplicado em modo multiplo.

2. Esperar botao de limpar ou select all padrao.
Correcao: esse template nao implementa `selectAll` nem clear dedicado.

3. Valores remotos aparecem vazios.
Correcao: revisar `optionLabelKey` e `optionValueKey`.

4. Evento retorna valor inesperado.
Correcao: em modo multiplo, payload e array; em single, payload escalar.

5. Aparencia nao muda.
Correcao: usar `appearance: "legacy"` ou `"standard"`.

### 8. Cross-links
- `projects/praxis-dynamic-fields/src/lib/base/pdx-base-select-runtime-contract.json-api.md`
- `projects/praxis-dynamic-fields/src/lib/components/material-radio-group/pdx-material-radio-group.json-api.md`
- `projects/praxis-dynamic-fields/src/lib/components/material-selection-list/pdx-material-selection-list.json-api.md`

### 9. Relatorio de Validacao Estrutural
- Visao geral: PASS
- API (inputs/outputs): PASS
- Cobertura JSON completa (especifico + herdado): PASS
- Mapeamento de comportamento: PASS
- Exemplo minimo: PASS
- Exemplo corporativo: PASS
- Troubleshooting: PASS

## JSON path index (obrigatorio)

| Path | Type | Required | Default | Status | Notes |
| --- | --- | --- | --- | --- | --- |
| `metadata` | object | true | n/a | Active | See Detailed API reference. |
| `readonlyMode` | boolean | false | `false` | Active | See Detailed API reference. |
| `disabledMode` | boolean | false | `false` | Active | See Detailed API reference. |
| `visible` | boolean | false | `true` | Active | See Detailed API reference. |
| `presentationMode` | boolean | false | `false` | Active | See Detailed API reference. |
| `metadata.controlType` | string | false | n/a | Active | See Detailed API reference. |
| `metadata.toggleOptions` | array | false | n/a | Active | See Detailed API reference. |
| `metadata.options` | array | false | n/a | Deprecated | See Detailed API reference. |
| `metadata.multiple` | boolean | false | `false` | Active | See Detailed API reference. |
| `metadata.maxSelections` | number | false | n/a | Active | See Detailed API reference. |
| `metadata.appearance` | string | false | `legacy` | Active | See Detailed API reference. |
| `metadata.resourcePath` | string | false | n/a | Active | See Detailed API reference. |
| `metadata.optionSource` | object | false | n/a | Active | See Detailed API reference. |
| `metadata.filterCriteria` | object | false | `{}` | Active | See Detailed API reference. |
| `metadata.optionLabelKey` | string | false | `label` | Active | See Detailed API reference. |
| `metadata.optionValueKey` | string | false | `value` | Active | See Detailed API reference. |
| `metadata.selectAll` | boolean | false | n/a | Partial | See Detailed API reference. |
| `metadata.searchable` | boolean | false | n/a | Partial | See Detailed API reference. |

## Events reference (obrigatorio)

| Event | Payload | Trigger | Stability | Notes |
| --- | --- | --- | --- | --- |
| `searchTermChange` | unknown | runtime-event | Experimental | Check component/runtime implementation. |
| `selectionChange` | unknown | runtime-event | Experimental | Check component/runtime implementation. |
| `openedChange` | unknown | runtime-event | Experimental | Check component/runtime implementation. |
| `valueChange` | unknown | runtime-event | Experimental | Check component/runtime implementation. |
| `focusChange` | unknown | runtime-event | Experimental | Check component/runtime implementation. |
| `nativeBlur` | unknown | runtime-event | Experimental | Check component/runtime implementation. |
| `nativeChange` | unknown | runtime-event | Experimental | Check component/runtime implementation. |

## Styling API (obrigatorio quando aplicavel)

| Token/Class | Scope | Purpose | Notes |
| --- | --- | --- | --- |
| `metadata.appearance` | component | Styling-related JSON path | Validate against runtime implementation. |

## Examples (obrigatorio)

| Example | Scenario | Validates | Notes |
| --- | --- | --- | --- |
| `Minimal valid` | baseline payload | required contract blocks | Extracted from preserved technical reference when available. |
| `Common setup` | common component usage | standard runtime behavior | Validate against host integration path. |
| `Advanced setup` | richer config with overrides | precedence and normalization | Requires runtime confirmation for edge cases. |
| `Enterprise scenario` | governance/legacy/migration context | auditability and compatibility boundaries | Include tenant-specific constraints when applicable. |

### Minimal valid

```json
{
  "componentId": "pdx-material-button-toggle",
  "metadata": {
    "name": "viewMode",
    "label": "Modo",
    "controlType": "buttonToggle",
    "multiple": false,
    "toggleOptions": [
      {
        "value": "list",
        "text": "Lista"
      },
      {
        "value": "cards",
        "text": "Cards"
      }
    ]
  }
}
```

### Common setup

```json
{
  "componentId": "pdx-material-button-toggle",
  "metadata": {
    "name": "exportChannels",
    "label": "Canais de Exportacao",
    "controlType": "pdx-material-button-toggle-common",
    "multiple": true,
    "maxSelections": 2,
    "appearance": "standard",
    "resourcePath": "exports/channels/options",
    "filterCriteria": {
      "tenant": "corp",
      "enabled": true
    },
    "optionLabelKey": "label",
    "optionValueKey": "code",
    "hint": "Escolha ate 2 canais."
  }
}
```

### Advanced setup

```json
{
  "componentId": "pdx-material-button-toggle",
  "metadata": {
    "name": "exportChannels",
    "label": "Canais de Exportacao",
    "controlType": "buttonToggle",
    "multiple": true,
    "maxSelections": 5,
    "appearance": "standard",
    "resourcePath": "exports/channels/options",
    "filterCriteria": {
      "tenant": "corp",
      "enabled": true
    },
    "optionLabelKey": "label",
    "optionValueKey": "code",
    "hint": "Escolha ate 2 canais."
  }
}
```

### Enterprise scenario

```json
{
  "componentId": "pdx-material-button-toggle",
  "metadata": {
    "name": "exportChannels",
    "label": "Canais de Exportacao",
    "controlType": "pdx-material-button-toggle-enterprise",
    "multiple": true,
    "maxSelections": 2,
    "appearance": "standard",
    "resourcePath": "exports/channels/options",
    "filterCriteria": {
      "tenant": "corp",
      "enabled": true
    },
    "optionLabelKey": "label",
    "optionValueKey": "code",
    "hint": "Escolha ate 2 canais."
  }
}
```

## Compatibility and migration notes (recomendado)

| Concern | Affected versions | Migration action | Deadline | Notes |
| --- | --- | --- | --- | --- |
| Legacy aliases coexist with canonical paths | Active consumers using legacy JSON keys | Keep canonical paths for new usage and map aliases in migration backlog | not-yet-defined | Track via component-level migration issue |

## Known limitations and mismatches (recomendado)

| Path/Behavior | Observed behavior (runtime) | Desired behavior | Impact | Tracking issue | Target fix |
| --- | --- | --- | --- | --- | --- |
| Canonical contract parity | No confirmed mismatch in this revision; runtime linkage verified for core flows (2026-04-27), with editor/tooling coverage pending | Keep runtime/schema/editor alignment evidence updated | Low | n/a | Monitor in periodic audit |

## Source references (obrigatorio)

| Source type | Path/URL | Why it is source of truth | Last verified (YYYY-MM-DD) | Notes |
| --- | --- | --- | --- | --- |
| schema-metadata | projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.metadata.ts | Primary source of truth for contract and behavior. | 2026-04-27 | verified-path |
| runtime-code | projects/praxis-dynamic-fields/src/lib/components/material-button-toggle/material-button-toggle.component.ts | Primary source of truth for contract and behavior. | 2026-04-27 | verified-path |
| runtime-code | projects/praxis-dynamic-fields/src/lib/base/simple-base-select.component.ts | Primary source of truth for contract and behavior. | 2026-04-27 | verified-path |
| schema-types | projects/praxis-core/src/lib/models/material-field-metadata.interface.ts | Primary source of truth for contract and behavior. | 2026-04-27 | verified-path |
