Artboards
ViewModel
Represents a view model used for data binding.
A ViewModel provides structured data that can be read and modified at
runtime, allowing Rive files to react to application state.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
type ViewModelExample = {
character: Input<Artboard<Data.Character>>,
instance: Artboard<Data.Character>?,
}
function init(self: ViewModelExample, context: Context): boolean
local vm = Data.Character.new()
self.instance = self.character:instance(vm)
return true
end
return function(): Node<ViewModelExample>
return {
character = late(),
instance = nil,
init = init,
}
end
Was this page helpful?