Skip to content

Commit a20f6c0

Browse files
Copilothotlong
andcommitted
Fix documentation: clarify property placement rules with better examples
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 0a89112 commit a20f6c0

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

docs/architecture/objectstack-spec-integration.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,8 @@ The following components are defined in `@object-ui/types/data-display`:
118118
{
119119
"type": "badge",
120120
"id": "status-badge",
121-
"props": {
122-
"label": "New",
123-
"variant": "default"
124-
}
121+
"label": "New",
122+
"variant": "default"
125123
}
126124
```
127125

@@ -207,6 +205,31 @@ When creating or using components:
207205
7.**SHOULD** support `id` for unique identification
208206
8.**MAY** use ObjectUI extensions (className, visibleOn, etc.)
209207

208+
### Property Placement Guide
209+
210+
**Component-specific properties** → Top level:
211+
```json
212+
{
213+
"type": "alert",
214+
"title": "Welcome", // ✅ Component-specific
215+
"variant": "default", // ✅ Component-specific
216+
"dismissible": true // ✅ Component-specific
217+
}
218+
```
219+
220+
**Standard HTML/ARIA attributes** → props object:
221+
```json
222+
{
223+
"type": "alert",
224+
"title": "Welcome",
225+
"props": {
226+
"role": "alert", // ✅ HTML attribute
227+
"aria-live": "polite", // ✅ ARIA attribute
228+
"data-testid": "alert" // ✅ Data attribute
229+
}
230+
}
231+
```
232+
210233
## Related Packages
211234

212235
- **[@objectstack/spec](../../packages/objectstack-spec)** - Universal UI component specification

0 commit comments

Comments
 (0)