Choosing an Artboard
When a Rive object is instantiated or when a Rive file is rendered, you can specify the artboard to use. If no artboard is given, the default artboard, as set in the Rive editor, is used. If no default artboard is set, the first artboard is used. Only one artboard can be rendered at a time.- Compose
- Legacy
By default, the
Rive composable will select and create the default artboard specified in the Rive editor. To specify a different artboard, you must first create an Artboard object from a loaded RiveFile.Compose
Artboard objects can be created in Compose using therememberArtboard function, which takes a Rive file and name of the artboard.Outside of Compose
Alternatively, you can create an artboard outside of Compose contexts. Note that with this approach you are responsible for managing the artboard’s lifecycle and must eventually close it withArtboard::close() when no longer needed, or leveraging its AutoClosable interface with a use block.Using the Artboard
Once you have an artboard, you can pass it to theRive composable via the artboard parameter.