Skip to content

feat: add properties enumeration to ViewModel and ViewModelInstance#98

Draft
mfazekas wants to merge 1 commit into
mainfrom
features/vmi-properties
Draft

feat: add properties enumeration to ViewModel and ViewModelInstance#98
mfazekas wants to merge 1 commit into
mainfrom
features/vmi-properties

Conversation

@mfazekas
Copy link
Copy Markdown
Collaborator

Summary

  • Adds properties array to ViewModel and ViewModelInstance for runtime introspection
  • New types: ViewModelPropertyType and ViewModelPropertyInfo
  • Includes PropertyInspector example for debugging

Android Limitation

  • ViewModel.properties works on both platforms
  • ViewModelInstance.properties returns empty array on Android (SDK doesn't expose this publicly)

Adds `properties` array to both ViewModel and ViewModelInstance for runtime introspection of available properties with their names and types.

New types:
- ViewModelPropertyType: union of all property types
- ViewModelPropertyInfo: { name, type } metadata

Includes PropertyInspector example for debugging.
mfazekas added a commit that referenced this pull request May 12, 2026
…248)

Adds \`getPropertiesAsync()\` to \`ViewModel\` and \`ViewModelInstance\`
for the experimental backend (iOS + Android).

```ts
const vm = file.viewModelByName('Person');
const props = await vm.getPropertiesAsync();
// => [{ name: 'age', type: 'number' }, { name: 'name', type: 'string' }, ...]
```

New types: \`ViewModelPropertyType\` and \`ViewModelPropertyInfo\`.
Both platforms use the async rive SDK APIs (\`File.getProperties(of:)\`
/ \`RiveFile.getViewModelProperties(name)\`).

Mirrors the legacy backend PR #98.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant