Respond to interactions, property changes, and events in your Rive file.
Listeners let you respond to interactions, property changes, and other events in your Rive file. When a listener is triggered, it can perform actions such as updating property values, firing Rive events, or running other logic.A listener has three main parts:
The Target determines what the listener watches. The target can be an element in your scene, an artboard, or a nested component.Use an element as the target when you want to listen for interactions on that element, such as clicks or drags. Use an artboard or nested component as the target when you want to listen for view model property changes, Rive events, or other events that belong to that artboard or component.
Opaque Target controls whether pointer events stop at this listener’s hit area or continue through to elements behind it.When Opaque Target is enabled, pointer events stop at the target. When it’s disabled, pointer events can pass through the target and trigger other listeners underneath.
This Listen to option is only available when the listener target is an artboard or nested component.View Model Change listeners fire whenever the selected property changes. You can’t specify an expected value or direction of change. For example, a Boolean listener fires when the value changes from true to false or from false to true.
This Listen to option is only available when the listener target is an artboard or nested component.We strongly recommend using Data Binding to communicate between artboards instead of relying on nested Rive events.
Pointer Exit only fires while Rive can read the pointer position. If the target touches the edge of the canvas or container, moving the pointer out of the container may not trigger Pointer Exit because the pointer has left the area Rive is tracking.
Pointer Down, Pointer Up, Click, and Pointer Drag listeners have a second dropdown to choose which mouse button triggers them: Primary Button, Secondary Button, or Middle Button. Use Secondary Button for right-click interactions, such as custom context menus.When a state machine is playing in the editor, right-click still pans the canvas and opens menus, except over a listener set to Secondary Button.
Runtimes that don’t support this feature ignore Secondary Button and Middle Button listeners. They don’t fire them on a left click instead.
Turn on Focusable for an element to add it to the focus order. Use Focus listeners to react when the element gains focus and Blur listeners to react when it loses focus.The Focus Target action moves focus to a specific element, and Focus Traversal steps through the focus order. See Focus for focus order, scopes, and more.
To react to keys, add a Keyboard listener and choose On Key Down or On Key Up. Keys go to the element that has focus.To try keyboard input in the editor, press Option+Space to play with keyboard capture on, or click Toggle Keyboard Capture in the playback header. This lets keys reach your file instead of triggering editor shortcuts.
Add a Gamepad listener to drive a state machine from a controller’s buttons and sticks. Scripts can listen to gamepad events too.The gamepad icon at the bottom of an open file turns green when Rive can see your controller.
Pick the Text Input tool in the toolbar and draw an editable text field. Draw it over a layout to add it to that layout.Use the Text Input section of the Inspector to set the field’s font, colors, placeholder, selection color, background, and single line or multiline mode. Add a Text Input listener to react when text is entered while the field has focus. See Text Input for details.
The Semantic section of the Inspector gives an element a role, such as button, checkbox, slider, or text, plus its traits and state. This helps screen readers read and navigate your file.Use Semantic Tap, Semantic Increase, and Semantic Decrease listeners to respond to screen reader actions. See Semantics for details on configuring semantic actions.
The Align Target action positions an object so it follows the pointer when the listener is triggered within the listener area.Use the Target Picker to select the object you want to align.Enable Preserve Offset to maintain the original distance between the object and the pointer when the action is triggered. When Preserve Offset is disabled, the object aligns directly to the pointer.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Rive","colors":{"primary":"#ffa41c","light":"#ffa41c","dark":"#ffa41c"},"logo":{"light":"https://mintcdn.com/rive/tBktbqSaEr9ZwywZ/logo/rive_top_logo_black.svg?fit=max\u0026auto=format\u0026n=tBktbqSaEr9ZwywZ\u0026q=85\u0026s=e09b8659935986a837947ae7c3b104e0","dark":"https://mintcdn.com/rive/tBktbqSaEr9ZwywZ/logo/rive_top_logo_white.svg?fit=max\u0026auto=format\u0026n=tBktbqSaEr9ZwywZ\u0026q=85\u0026s=d2ccc2c4dec459d584f578475de89248","href":"https://rive.app?utm_source=docs\u0026utm_medium=header_nav"},"favicon":"https://mintcdn.com/rive/IGEy4oJSivuQmjey/favicon_black.png?fit=max\u0026auto=format\u0026n=IGEy4oJSivuQmjey\u0026q=85\u0026s=986c81e5b82e1138420d773296030a3a","appearance":{"default":"dark"},"background":{"decoration":"grid"},"navbar":{"links":[{"href":"/tutorials/learn-rive","label":"Learn"},{"href":"/community/support","label":"Support"}],"primary":{"type":"button","label":"Get Rive","href":"https://rive.app/downloads?utm_source=docs\u0026utm_medium=header_nav"}},"footer":{"socials":{"youtube":"https://www.youtube.com/channel/UCPal2R1FxwRTPylhP_7ofEg","x":"https://twitter.com/rive_app","instagram":"https://www.instagram.com/rive.app","github":"https://github.com/rive-app","discord":"https://discord.gg/rive-app"},"links":[{"header":"Resources","items":[{"label":"Community","href":"https://community.rive.app?utm_source=docs\u0026utm_medium=footer_nav"},{"label":"Blog","href":"https://rive.app/blog?utm_source=docs\u0026utm_medium=footer_nav"},{"label":"Case Studies","href":"https://rive.app/blog/case-studies?utm_source=docs\u0026utm_medium=footer_nav"},{"label":"Marketplace","href":"https://rive.app/marketplace?utm_source=docs\u0026utm_medium=footer_nav"},{"label":"Feature Requests","href":"https://community.rive.app/c/feature-requests"}]},{"header":"Company","items":[{"label":"Careers","href":"https://rive.app/careers?utm_source=docs\u0026utm_medium=footer_nav"},{"label":"Terms of Service","href":"/docs/legal/terms-of-service"},{"label":"Acceptable Use Policy","href":"/docs/legal/acceptable-use-policy"},{"label":"Privacy Policy","href":"/docs/legal/privacy-policy"},{"label":"Your Privacy Choices","href":"https://rive.app/?cookie-settings"}]}]},"fonts":{"heading":{"family":"Tomorrow Placeholder","weight":500,"source":"https://framerusercontent.com/assets/nCpxWS6DaPlPe0lHzStXAPCo3lw.woff2","format":"woff2"}},"integrations":{"amplitude":{"apiKey":"38803036884a752b104ee4bf501e0945"},"cookies":{"key":"rive_analytics","value":"granted"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"variables":{"runtimeCurrentNameApple":"New Runtime","runtimeLegacyNameApple":"Legacy Runtime","monthlyCreditsVoyager":"$20","monthlyCreditsEnterprise":"$40","pricingCadetMonthly":"$17","pricingCadetYearly":"$108","pricingVoyagerMonthly":"$49","pricingVoyagerYearly":"$384","pricingEnterpriseYearly":"$1,440","cliAllowanceFree":"50","cliAllowanceCadet":"500","cliAllowanceVoyager":"5,000","versionWeb":"2.40.1","versionReact":"4.33.0","versionApple":"6.24.0","versionAndroid":"11.9.2","versionReactNative":"0.5.5","versionFlutter":"0.14.11","versionDevFlutter":"0.15.0-dev.4","versionUnity":"0.4.5","versionUnreal":"0.4.25","supportForm":"https://forms.rive.app/support?utm_medium=support_page","supportFormEducational":"https://forms.rive.app/education?utm_medium=support_page"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"rive","hasAudioNarration":false,"actualSubdomain":"rive","customDomains":["rive.app"],"gitSource":{"type":"github","owner":"rive-app","repo":"rive-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aecc69dc6ee43bd9a030ee4","collectionId":"9fe0a221-f3e5-455d-8b17-45fd5abbfbb1","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aecc69dc6ee43bd9a030ee4"},"feedback":{"edits":true,"issues":true,"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aee68270b65ceb1ec8d6262","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"Runtimes","count":279},{"language":"default","tag":"Scripting","count":188},{"language":"default","tag":"Scripting API","count":167},{"language":"default","tag":"Editor","count":100},{"language":"default","tag":"Fundamentals","count":64},{"language":"default","tag":"GPU","count":45},{"language":"default","tag":"Design","count":32},{"language":"default","tag":"Artboards","count":25},{"language":"default","tag":"Interfaces","count":24},{"language":"default","tag":"Advanced Topics","count":22}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":"p{font-size:14px}ul li{font-size:14px}ol li{font-size:14px}.signature .code-block{border:none}.signature .code-block [data-floating-buttons=\"true\"]{display:none}.signature .code-block [data-component-part=\"code-block-root\"]{background:none;padding:0}.dark .card{background-color:var(--background-dark)!important;border-color:rgb(255 255 255 / 0.1)!important}.dark .card:hover{border-color:var(--primary-light)!important}"}],"page":{"pagePath":"editor/state-machine/listeners","slug":"/editor/state-machine/listeners","pageMetadata":{"title":"Listeners","description":"Respond to interactions, property changes, and events in your Rive file.","href":"/editor/state-machine/listeners"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Respond to interactions, property changes, and events in your Rive file.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const Demos=({examples,runtime,columns=2,children,childrenIndex=0,learnByExample=false})=>{const _components={a:`a`,..._provideComponents()};const examplesData={accessibilityReducedMotion:{title:`Reduced Motion Example`,description:`Strategies for respecting a user's reduced motion preferences.`,riv:`https://static.rive.app/rivs/accessibility_reduced_motion.riv`,stateMachines:`State Machine 1`,links:{editor:`https://rive.app/community/files/28077-accessibility-reduced-motion`}},randomizeExit:{title:`Randomize Exit`,description:`Randomize Exit lets a state choose from its outgoing transition paths at random.`,riv:`https://static.rive.app/rivs/randomize_exit.riv`,stateMachines:`State Machine 1`,links:{editor:`https://rive.app/community/files/28147-randomize-exit/`}},gamepadListeners:{title:`Gamepad Listeners`,description:`Minimal demo that controls shapes with a gamepad's joystick and buttons.`,image:`https://static.rive.app/docs/gamepad.png`,links:{editor:`https://rive.app/community/files/28995-54925-gamepad-listeners`}},gamepadRadialMenu:{title:`Gamepad Radial Menu`,description:`Pick items from a 3D radial menu with a gamepad's joystick and buttons.`,image:`https://static.rive.app/docs/gamepad-radial-menu.png`,links:{editor:`https://rive.app/community/files/29015-gamepad-radial-demo/`}},gamepadGame:{title:`Gamepad Game`,description:`A playable game you control entirely with a gamepad.`,image:`https://static.rive.app/docs/gamepad-game-demo.png`,links:{editor:`https://rive.app/community/files/29016-gamepad-game/`}},ikConstraint:{title:`IK Constraints`,description:`Check out this example to see IK constraints in action.`,image:`https://static.rive.app/docs/ik-constraint.gif`,stateMachines:`State Machine 1`,links:{editor:`https://rive.app/community/files/28080-ik-constraint/`}},textFollowPath:{title:`Text Follow Path`,description:`Use the Follow Path text modifier to make text follow a vector path.`,riv:`https://static.rive.app/rivs/text_follow_path.riv`,stateMachines:`State Machine 1`,links:{editor:`https://rive.app/community/files/29023-text-follow-path`}},accessibilityReducedMotion:{title:`Reduced Motion Example`,description:`Strategies for respecting a user's reduced motion preferences.`,riv:`https://static.rive.app/rivs/accessibility_reduced_motion.riv`,stateMachines:`State Machine 1`,links:{editor:`https://rive.app/community/files/28077-accessibility-reduced-motion`}},nSlicing:{title:`N-Slicing `,description:`N-Slice a group that includes vector and raster artwork to build a panel that resizes without distorting.`,riv:`https://static.rive.app/rivs/n-slicing.riv`,stateMachines:`State Machine 1`,links:{editor:`https://rive.app/community/files/29038-tutorial-n-slicing/`}},meshAndBones:{title:`Mesh and Bones`,description:`Deform raster images with meshes controlled by bones.`,video:`https://static.rive.app/docs/mesh.mp4`,links:{editor:`https://rive.app/community/files/28327-mesh-and-bones/`}},componentMesh:{title:`Component Mesh`,description:`Add a mesh deformation to a nested component.`,riv:`https://static.rive.app/rivs/component_mesh.riv`,stateMachines:`State Machine 1`,links:{editor:`https://rive.app/community/files/29045-component-mesh/`}},listenerExamples:{title:`Listener Pointer Events`,description:`See each Listen To condition in action.`,riv:`https://static.rive.app/rivs/listen_to.riv `,stateMachines:`State Machine 1`,artboard:`Artboard 1`,layout:true,layoutScaleFactor:.8,links:{},source:[`https://rive.app/community/files/28817-listener-pointer-events/`]},cachingARiveFile:{title:`Caching a Rive File`,description:`Load the .riv into memory once, use it multiple times.`,riv:`https://static.rive.app/rivs/rives_animated_emojis.riv`,stateMachines:`State Machine 1`,artboard:`Emoji_package`,links:{web:`https://codesandbox.io/p/sandbox/rive-js-caching-a-rive-file-g675my?file=%2Fsrc%2Findex.ts%3A9%2C1`,react:`https://codesandbox.io/p/sandbox/rive-react-caching-a-rive-file-53gmdf?file=%2Fsrc%2FApp.tsx`},source:[`https://rive.app/marketplace/24644-caching-a-rive-file-at-runtime/`]},dataBindingFonts:{title:`Data Binding Fonts`,description:`Swap an font at runtime.`,image:`https://static.rive.app/docs/data-binding-fonts.png`,links:{web:`https://codesandbox.io/p/sandbox/cjt2tl?file=%2Findex.ts%3A37%2C41`,react:`https://codesandbox.io/p/sandbox/rive-data-binding-fonts-glpm49?file=%2Fsrc%2FApp.tsx`},source:[`https://rive.app/community/files/28431-data-binding-fonts/`]},dataBindingArtboards:{title:`Data Binding Artboards`,description:`Swap an artboard with another artboard from the same .riv or one loaded at runtime.`,image:`/images/runtimes/rive-data-bind-components.webp`,links:{web:`https://codesandbox.io/p/sandbox/rive-js-data-binding-artboards-jx3pf9?file=%2Fsrc%2Findex.mjs%3A5%2C19`,react:`https://codesandbox.io/p/sandbox/rive-react-data-binding-artboards-kmvzh8?file=%2Fsrc%2FApp.tsx`,flutter:`https://github.com/rive-app/rive-flutter/blob/master/example/lib/examples/databinding_artboards.dart`,reactNative:`https://github.com/rive-app/rive-nitro-react-native/blob/main/example/src/demos/DataBindingArtboardsExample.tsx`,android:`https://github.com/rive-app/rive-android/blob/master/app/src/main/java/app/rive/runtime/example/ComposeArtboardBindingActivity.kt`},source:[`https://rive.app/marketplace/24641-data-binding-artboards/`,`https://rive.app/marketplace/24642-data-binding-artboards/`]},dataBindingImages:{title:`Data Binding Images`,description:`Replace images at runtime using data binding images with javascript.`,image:`/images/runtimes/rive-db-images.webp`,links:{web:`https://codesandbox.io/p/sandbox/objective-cohen-sqwh9q?file=%2Fsrc%2Findex.ts`,flutter:`https://github.com/rive-app/rive-flutter/blob/master/example/lib/examples/databinding_images.dart`,android:`https://github.com/rive-app/rive-android/blob/master/app/src/main/java/app/rive/runtime/example/ComposeImageBindingActivity.kt`},source:[`https://rive.app/marketplace/25472-data-binding-images/`]},dataBindingLists:{title:`Data Binding Lists`,description:`Add, remove, edit, and swap items in your data binding list.`,image:`/images/runtimes/rive-db-lists.webp`,links:{web:`https://codesandbox.io/p/sandbox/suspicious-hertz-2lg4m8?file=%2Fsrc%2Findex.ts`,react:`https://codesandbox.io/p/sandbox/rive-react-data-binding-lists-4msh9z?file=%2Fsrc%2FApp.tsx`,flutter:`https://github.com/rive-app/rive-flutter/blob/master/example/lib/examples/databinding_lists.dart`,android:`https://github.com/rive-app/rive-android/blob/master/app/src/main/java/app/rive/runtime/example/ComposeListActivity.kt`},source:[`https://rive.app/marketplace/25474-data-binding-lists/`]},dataBindingQuickStart:{title:`Data Binding`,description:`Get started with Data Binding at runtime.`,image:`/images/runtimes/rewards.gif`,links:{flutter:`https://github.com/rive-app/rive-flutter/blob/master/example/lib/examples/databinding.dart`,reactNative:`https://github.com/rive-app/rive-react-native/blob/main/example/app/(examples)/DataBinding.tsx`,unity:`https://github.com/rive-app/rive-unity-examples/blob/main/getting-started/Assets/RewardsController.cs`,apple:`https://github.com/rive-app/rive-ios/blob/main/Example-iOS/Source/Examples/SwiftUI/RewardsView.swift`,android:`https://github.com/rive-app/rive-android/blob/master/app/src/main/java/app/rive/runtime/example/ComposeDataBindingActivity.kt`},source:[`https://rive.app/marketplace/25475-data-binding-demo/`]},dataBindingSolos:{title:`Data Binding Solos`,description:`Control solos at runtime using strings, numbers, or enums.`,image:`/images/runtimes/data-binding-solos.gif`,links:{react:`https://codesandbox.io/p/sandbox/rive-react-controlling-solos-at-runtime-ctcnlx?file=%2Fsrc%2FApp.tsx`},source:[`https://rive.app/marketplace/24643-data-binding-solos/`]},googleAppAds:{title:`Google App Ads`,description:`How to make an interactive Google App with Rive.`,image:`/images/runtimes/google-app-ads.png`,links:{mobile:`https://github.com/rive-app/rive-use-cases/tree/main/rive-google-ads`}},layouts:{title:`Responsive Layouts`,description:`Create responsive layouts that adapt to different screen sizes.`,riv:`https://static.rive.app/rivs/layouts_demo.riv`,stateMachines:`State Machine 1`,artboard:`Demo`,links:{web:`https://codesandbox.io/p/devbox/rive-responsive-layout-js-forked-m77nlw`,react:`https://codesandbox.io/p/devbox/rive-responsive-layouts-react-forked-nmpv39?file=%2Fsrc%2FApp.tsx`,flutter:`https://github.com/rive-app/rive-flutter/blob/master/example/lib/examples/responsive_layouts.dart`,reactNative:`https://github.com/rive-app/rive-react-native/blob/main/example/app/(examples)/ResponsiveLayout.tsx`,android:`https://github.com/rive-app/rive-android/blob/master/app/src/main/java/app/rive/runtime/example/ComposeLayoutActivity.kt`},source:[`https://rive.app/marketplace/24638-layouts-demo/`]},fontsHostedCompressed:{title:`Load a Compressed Font for Web`,description:`Dynamically load a font asset from a hosted location with compression.`,image:`/images/runtimes/brotli-compressed-fonts.webp`,links:{react:`https://codesandbox.io/p/sandbox/prod-sound-6yc5xl?file=%2Fsrc%2FApp.tsx%3A19%2C1`},source:[`https://rive.app/marketplace/25473-loading-compressed-fonts-web/`]},quickStart:{title:`Data Binding Quick Start`,image:`/images/runtimes/quick-start.gif`,description:`Load and control your Rive (.riv) file.`,links:{web:`https://codesandbox.io/p/sandbox/rive-quick-start-js-xmwcm6?file=%2Fsrc%2Findex.ts`,react:`https://codesandbox.io/p/sandbox/rive-react-quick-start-4xy76h?file=%2Fsrc%2FApp.tsx%3A77%2C14`,reactJs:`https://codesandbox.io/p/devbox/rive-react-vanilla-js-quick-start-kz66t4?file=%2Fsrc%2FApp.tsx%3A53%2C7`,reactNative:`https://github.com/rive-app/rive-nitro-react-native/blob/main/example/src/demos/QuickStart.tsx`,unity:`/game-runtimes/unity/tutorials/health-bar`},source:[`https://rive.app/marketplace/24637-health-bar-data-binding-quick-start/`]},quickStartReact:{title:`Data Binding Quick Start`,image:`/images/runtimes/quick-start.gif`,description:`Load and control your Rive (.riv) file.`,links:{react:`https://codesandbox.io/p/sandbox/rive-react-quick-start-4xy76h?file=%2Fsrc%2FApp.tsx%3A77%2C14`,reactJs:`https://codesandbox.io/p/devbox/rive-react-vanilla-js-quick-start-kz66t4?file=%2Fsrc%2FApp.tsx%3A53%2C7`},source:[`https://rive.app/marketplace/24637-health-bar-data-binding-quick-start/`]},reactHome:{title:`See a Working Demo`,image:`/images/runtimes/quick-start.gif`,description:`Load your Rive (.riv) file into a React component.`,links:{react:`https://codesandbox.io/p/sandbox/rive-react-quick-start-4xy76h?file=%2Fsrc%2FApp.tsx%3A77%2C14`,reactJs:`https://codesandbox.io/p/devbox/rive-react-vanilla-js-quick-start-kz66t4?file=%2Fsrc%2FApp.tsx%3A53%2C7`,reactComponent:`https://codesandbox.io/p/sandbox/rive-react-component-quick-start-hl87kh?file=%2Fsrc%2FApp.tsx%3A23%2C1`}},scriptingDrawingShapes:{title:`Drawing with Scripting`,image:`https://static.rive.app/docs/drawing-demo.png`,description:`Draw a squirkle, a star, and an animated wave with scripting.`,links:{editor:`https://rive.app/community/files/25751-drawing-shapes-with-scripting`}},scriptingMasonry:{title:`Masonry Layout`,image:`https://static.rive.app/docs/masonry.png`,description:`Create a masonry layout using a Layout script.`,links:{editor:`https://rive.app/community/files/25826-masonry-layout/`}},scriptingParticleEmitter:{title:`Particle Emitter`,riv:`https://static.rive.app/rivs/particle-demo.riv`,artboard:`Demo`,description:`A small, self contained particle system for Rive node and layout scripts.`,links:{editor:`https://rive.app/community/files/28062-particle-librar/`}},scriptingTippingConverter:{title:`Custom Converter`,image:`https://static.rive.app/docs/tipping-scripting-converter.gif`,description:`Calculate the bill total using the converter's input value added to data binding values.`,links:{editor:`https://uat.rive.app/community/files/610-custom-converter-with-scripting`}},scriptingUnitTesting:{title:`Unit Testing`,image:`https://static.rive.app/docs/scripting-default-thumb.png`,description:`This hands-on example demonstrates unit testing rgbToHex and hexToRgb color utilities.`,links:{editor:`https://rive.app/community/files/25752-test-script`}},scriptingSnakeGame:{title:`Snake - Complete Game`,image:`https://static.rive.app/docs/snake-game.png`,description:`Check out this complete game built entirely with Rive using scripting.`,links:{editor:`https://rive.app/community/files/25748-snake-game/`}},scriptingMultiTouch:{title:`Tracking Multi-touch`,image:`https://static.rive.app/docs/scripting-default-thumb.png`,description:`Keep track of every finger.`,links:{editor:`https://rive.app/community/files/25754-multi-touch-with-scripting`}},scriptingNestedPointers:{title:`Nested Pointer Events`,image:`https://static.rive.app/docs/scripting-default-thumb.png`,description:`Pass pointer events from the parent component to the instantiated children.`,links:{editor:`https://rive.app/community/files/25750-scripting-nested-pointer-events/`}},scriptingBoilPathEffect:{title:`Boiling Path Effect`,image:`https://static.rive.app/docs/boiling-effect.gif`,description:`Apply a boiling effect to any path using scripting.`,links:{editor:`https://rive.app/community/files/25767-scripting-path-effect-boil`}},scriptingTextPathEffect:{title:`Text Path Effect`,image:`https://static.rive.app/docs/text-path-effect.gif`,description:`Control a text path using scripting.`,links:{editor:`https://rive.app/community/files/25823-text-path-effects/`}},scriptingDrawImages:{title:`Render an Image with Scripting`,image:`https://static.rive.app/docs/render-image-with-scripting.jpg`,description:`Draw an image, give it transforms, control its mesh, and add clipping all through scripting.`,links:{editor:`https://rive.app/community/files/26406-draw-an-image-with-scripting`}},scriptingSlotMachine:{title:`Slot Machine - Complete Game`,image:`https://static.rive.app/docs/slot-machine.png`,description:`Build a complete casino game using scripting.`,links:{editor:`https://rive.app/community/files/25759-slot-machine-game-with-scripting/`}},scriptingLists:{title:`Scripting Lists`,image:`/images/runtimes/rive-db-lists.webp`,description:`Add, remove, edit, and swap items in your data binding list using Rive scripting.`,links:{editor:`https://rive.app/community/files/27098-scripting-lists`}},scriptingPlinko:{title:`Plinko - Complete Game`,image:`https://static.rive.app/docs/scripting-plinko-game.png`,description:`Build a complete Plinko game using Layout, Node, and Path Effect scripts.`,links:{editor:`https://rive.app/marketplace/25772-blinko-scripted-game/`}},constraints:{title:`Constraints`,image:`https://static.rive.app/docs/constraints.gif`,description:`Transform, Translate, Scale, and Rotation Constraints.`,links:{editor:`https://rive.app/community/files/28081-constraints/`}}};const runtimesInOrder=[`web`,`react`,`reactJs`,`reactComponent`,`reactNative`,`flutter`,`apple`,`android`,`unity`,`unreal`,`mobile`,`editor`];const runtimeTitles={web:`Web`,reactJs:`React (Imperative)`,reactComponent:`React (Component)`,react:`React`,reactNative:`React Native`,flutter:`Flutter`,apple:`Apple`,android:`Android`,unity:`Unity`,unreal:`Unreal`,mobile:`Mobile`,editor:`Try in Rive`};const riveInstances=useRef([]);const initRives=()=>{const rive=window.rive;examples.forEach(example=>{const{riv,stateMachines=`State Machine 1`,artboard,layout,layoutScaleFactor}=examplesData[example];if(riv){const canvasId=`rive-canvas-${example}`;const canvas=document.getElementById(canvasId);if(canvas){const r=new rive.Rive({src:riv,stateMachines,canvas,artboard,autoBind:true,autoplay:true,layout:new rive.Layout({fit:layout?rive.Fit.Layout:rive.Fit.Contain,...layoutScaleFactor!==undefined\u0026\u0026{layoutScaleFactor}}),onLoad:()=>{r.resizeDrawingSurfaceToCanvas();riveInstances.current.push(r)}})}}})};useEffect(()=>{if(window.rive){initRives();return}const checkRive=()=>{if(window.rive){initRives();window.removeEventListener(`rive-loaded`,checkRive)}};const handleResize=()=>{riveInstances.current.forEach(instance=>{instance.resizeDrawingSurfaceToCanvas()})};window.addEventListener(`rive-loaded`,checkRive);window.addEventListener(`resize`,handleResize);return()=>{window.removeEventListener(`rive-loaded`,checkRive);window.removeEventListener(`resize`,handleResize);riveInstances.current.forEach(instance=>{instance.cleanup()})}},[]);const RuntimeLink=({link,runtime})=>{if(!link)return null;if(runtime===`editor`){link=`${link}?utm_source=docs\u0026utm_medium=docs_demo_card`}return _jsx(_components.a,{href:link,target:`_blank`,className:`mint-cursor-pointer mint-border mint-border-neutral-600 hover:mint-border-white mint-rounded-[4px] text-14 mint-py-1 mint-px-5 mint-mr-[10px] mint-mb-[10px]`,children:runtimeTitles[runtime]})};const CardContainer=({children:content})=>{return _jsx(`div`,{className:`mint-flex mint-flex-col card mint-block mint-font-normal group mint-relative mint-my-2 mint-ring-2 mint-ring-transparent mint-rounded-2xl mint-bg-white dark:bg-background-dark mint-border mint-border-gray-950/10 dark:mint-border-white/10 mint-overflow-hidden mint-w-full`,children:content})};const getSrc=imageSrc=>{if(location.hostname===`localhost`\u0026\u0026imageSrc.startsWith(`/images/`)){return imageSrc}else if(imageSrc.startsWith(`https:`)){return imageSrc}return`https://rive.app/docs${imageSrc}`};return _jsx(`div`,{className:`\n card-group not-prose mint-grid mint-gap-x-4 mint-grid-cols-1\n ${columns>=2?`md:mint-grid-cols-2`:``}\n ${columns>=3?`xl:mint-grid-cols-3 xl:mint-w-[67rem] xl:mint-max-w-[calc(100vw-25rem)]`:``}\n `,children:examples.map((example,index)=>{const{title,image,video,links,description,source,riv}=examplesData[example];const canvasId=`rive-canvas-${example}`;return _jsxs(_Fragment,{children:[index===childrenIndex\u0026\u0026children,_jsxs(CardContainer,{children:[_jsx(`div`,{className:`mint-w-full mint-h-0 mint-relative mint-pb-[75%]`,children:_jsxs(`div`,{className:`mint-absolute mint-inset-0`,children:[image\u0026\u0026_jsx(`img`,{alt:title,className:`mint-w-full mint-object-cover mint-object-center`,src:getSrc(image)}),video\u0026\u0026!image\u0026\u0026_jsx(`video`,{src:getSrc(video),autoPlay:true,loop:true,muted:true,playsInline:true,className:`mint-w-full mint-h-full mint-object-cover mint-object-center`}),riv\u0026\u0026!image\u0026\u0026!video\u0026\u0026_jsx(`canvas`,{id:canvasId,style:{width:`100%`,height:`100%`}})]})}),_jsx(`div`,{className:`mint-flex mint-flex-grow mint-flex-col mint-px-6 mint-py-5 mint-relative`,\"data-component-part\":`card-content-container`,children:_jsxs(`div`,{className:`mint-flex mint-flex-col mint-grow`,children:[_jsx(`h2`,{className:`not-prose mint-font-semibold mint-text-base mint-text-gray-800 dark:mint-text-white`,\"data-component-part\":`card-title`,children:learnByExample?`Learn by Example`:title}),_jsxs(`div`,{className:`mint-flex mint-flex-col mint-grow prose mint-mt-1 mint-font-normal mint-text-sm mint-leading-6 mint-text-gray-600 dark:mint-text-gray-400`,\"data-component-part\":`card-content`,children:[_jsxs(`div`,{className:`mint-grow mint-flex mint-flex-col`,children:[description\u0026\u0026!learnByExample\u0026\u0026_jsx(`p`,{children:description}),source\u0026\u0026source.length>0\u0026\u0026_jsx(`p`,{className:`mint-mt-3`,children:source.map((item,index)=>{if(source.length==1){return _jsxs(_Fragment,{children:[`Open the `,_jsx(_components.a,{href:item,children:`Rive file`}),`.`]})}if(index==0){return _jsxs(_Fragment,{children:[`Open `,_jsx(_components.a,{href:item,children:`Rive file 1`})]})}return _jsxs(_Fragment,{children:[`, `,_jsxs(_components.a,{href:item,children:[`file `,index+1]})]})})})]}),_jsx(`div`,{className:`mint-mt-6 mint-flex mint-flex-wrap`,children:runtimesInOrder.map(currentRuntime=>{if(runtime\u0026\u0026currentRuntime!==runtime)return;return _jsx(RuntimeLink,{runtime:currentRuntime,link:links[currentRuntime]},currentRuntime)})})]})]})})]},canvasId)]})})})};const VideoEmbed=({src,maxWidth})=>{return _jsx(`div`,{style:{height:`100%`},children:_jsx(`video`,{src,autoPlay:true,loop:true,muted:true,playsInline:true,style:{width:`100%`,maxWidth:maxWidth||`100%`,height:`100%`,borderRadius:0,margin:0,display:`block`,objectFit:`cover`,backgroundColor:`transparent`}})})};const YouTube=({id,timestamp})=>{const videoSrc=timestamp?`https://www.youtube.com/embed/${id}?start=${timestamp}`:`https://www.youtube.com/embed/${id}`;return _jsx(`iframe`,{width:`100%`,height:`400`,src:videoSrc,title:`YouTube video player`,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,referrerPolicy:`strict-origin-when-cross-origin`,allowFullScreen:true})};function _createMdxContent(props){const _components={a:`a`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Info,Step,Steps,Table,Tip,Warning,_MdxComponentBoundary}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Listeners let you respond to interactions, property changes, and other events in your Rive file. When a listener is triggered, it can perform actions such as updating property values, firing Rive events, or running other logic.`}),`\n`,_jsx(_components.p,{children:`A listener has three main parts:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`#target`,children:`Target`}),`: what the listener watches`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`#listen-to`,children:`Listen to`}),`: what needs to happen to trigger the listener`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`#listener-actions`,children:`Action`}),`: what happens in response`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Use listeners to create dynamic experiences that react to user input and changes in state.`}),`\n`,_jsx(_MdxComponentBoundary,{name:`YouTube`,children:_jsx(YouTube,{id:`RBQdLRXNVbE`})}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-listener`,children:`Creating a listener`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{children:[_jsx(_components.p,{children:`Select the element you want the listener to respond to.`}),_jsx(Info,{children:_jsx(_components.p,{children:`To listen for a view model property change or Rive event, select the artboard or nested component instead.`})})]}),_jsx(Step,{children:_jsxs(_components.p,{children:[`In the `,_jsx(_components.strong,{children:`Animations`}),` panel, click the icon next to the `,_jsx(_components.strong,{children:`State Machine`}),` to show listeners.`]})}),_jsx(Step,{children:_jsxs(_components.p,{children:[`Click the `,_jsx(_components.strong,{children:`+`}),` icon to create a new listener and select the action the listener should perform.`]})}),_jsx(Step,{children:_jsxs(_components.p,{children:[`With the listener selected, set its `,_jsx(_components.strong,{children:`Target`}),`, `,_jsx(_components.strong,{children:`Listen to`}),`, and other options in the right sidebar.`]})})]}),`\n`,_jsx(_MdxComponentBoundary,{name:`VideoEmbed`,children:_jsx(VideoEmbed,{src:`https://static.rive.app/video/docs/create-new-listener-6.mp4`})}),`\n`,_jsx(Heading,{level:`2`,id:`target`,children:`Target`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Target`}),` determines what the listener watches. The target can be an element in your scene, an artboard, or a nested component.`]}),`\n`,_jsx(_components.p,{children:`Use an element as the target when you want to listen for interactions on that element, such as clicks or drags. Use an artboard or nested component as the target when you want to listen for view model property changes, Rive events, or other events that belong to that artboard or component.`}),`\n`,_jsx(Heading,{level:`3`,id:`opaque-target`,children:`Opaque Target`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Opaque Target`}),` controls whether pointer events stop at this listener’s hit area or continue through to elements behind it.`]}),`\n`,_jsxs(_components.p,{children:[`When `,_jsx(_components.strong,{children:`Opaque Target`}),` is enabled, pointer events stop at the target. When it’s disabled, pointer events can pass through the target and trigger other listeners underneath.`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`VideoEmbed`,children:_jsx(VideoEmbed,{src:`https://static.rive.app/video/docs/listener-opaque-target.mp4`})}),`\n`,_jsx(Heading,{level:`2`,id:`listen-to`,children:`Listen to`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Listen to`}),` is the condition the listener watches for. When the condition is met, the listener is triggered.`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`Demos`,children:_jsx(Demos,{examples:[`listenerExamples`]})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Listen to`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#view-model-change`,children:`View Model Change`})}),_jsx(_components.td,{children:`Fires whenever the selected view model property changes.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#rive-event`,children:`Rive Event`})}),_jsx(_components.td,{children:`Fires when the selected Rive event is fired.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Pointer Enter`})}),_jsx(_components.td,{children:`Fires when the pointer enters the target area.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#pointer-exit`,children:`Pointer Exit`})}),_jsx(_components.td,{children:`Fires when the pointer leaves the target area.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Pointer Move`})}),_jsx(_components.td,{children:`Fires repeatedly while the pointer moves over the target area.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Pointer Down`})}),_jsx(_components.td,{children:`Fires when the pointer is pressed down on the target.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Pointer Up`})}),_jsx(_components.td,{children:`Fires when the pointer is released over the target.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Pointer Drag`})}),_jsx(_components.td,{children:`Fires repeatedly as the pointer moves after being pressed down on the target, until the pointer is released.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Click`})}),_jsx(_components.td,{children:`Fires when the target is clicked or tapped.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#focus`,children:`Focus`})}),_jsx(_components.td,{children:`Fires when the target receives focus.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#focus`,children:`Blur`})}),_jsx(_components.td,{children:`Fires when the target loses focus.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#keyboard`,children:`Keyboard`})}),_jsx(_components.td,{children:`Fires when a key is pressed or released while the target has focus.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#gamepad`,children:`Gamepad`})}),_jsx(_components.td,{children:`Fires on gamepad input, such as a button press or stick movement.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#text-input`,children:`Text Input`})}),_jsx(_components.td,{children:`Fires when text is entered while the target has focus.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#semantic-action`,children:`Semantic Action`})}),_jsx(_components.td,{children:`Fires when an assistive technology, such as a screen reader, performs an action on the target, like a tap, increase, or decrease.`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`view-model-change`,children:`View Model Change`}),`\n`,_jsxs(_components.p,{children:[`This `,_jsx(_components.strong,{children:`Listen to`}),` option is only available when the listener target is an artboard or nested component.`]}),`\n`,_jsx(_components.p,{children:`View Model Change listeners fire whenever the selected property changes. You can’t specify an expected value or direction of change. For example, a Boolean listener fires when the value changes from true to false or from false to true.`}),`\n`,_jsx(Heading,{level:`3`,id:`rive-event`,children:`Rive Event`}),`\n`,_jsxs(_components.p,{children:[`This `,_jsx(_components.strong,{children:`Listen to`}),` option is only available when the listener target is an artboard or nested component.`]}),`\n`,_jsxs(_components.p,{children:[`We strongly recommend using `,_jsx(_components.a,{href:`/editor/data-binding/overview`,children:`Data Binding`}),` to communicate between artboards instead of relying on nested Rive events.`]}),`\n`,_jsx(Heading,{level:`3`,id:`pointer-exit`,children:`Pointer Exit`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Pointer Exit`}),` only fires while Rive can read the pointer position. If the target touches the edge of the canvas or container, moving the pointer out of the container may not trigger `,_jsx(_components.strong,{children:`Pointer Exit`}),` because the pointer has left the area Rive is tracking.`]}),`\n`,_jsx(Heading,{level:`3`,id:`mouse-buttons`,children:`Mouse buttons`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Pointer Down`}),`, `,_jsx(_components.strong,{children:`Pointer Up`}),`, `,_jsx(_components.strong,{children:`Click`}),`, and `,_jsx(_components.strong,{children:`Pointer Drag`}),` listeners have a second dropdown to choose which mouse button triggers them: `,_jsx(_components.strong,{children:`Primary Button`}),`, `,_jsx(_components.strong,{children:`Secondary Button`}),`, or `,_jsx(_components.strong,{children:`Middle Button`}),`. Use `,_jsx(_components.strong,{children:`Secondary Button`}),` for right-click interactions, such as custom context menus.`]}),`\n`,_jsxs(_components.p,{children:[`When a state machine is playing in the editor, right-click still pans the canvas and opens menus, except over a listener set to `,_jsx(_components.strong,{children:`Secondary Button`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Runtimes that don’t support this feature ignore `,_jsx(_components.strong,{children:`Secondary Button`}),` and `,_jsx(_components.strong,{children:`Middle Button`}),` listeners. They don’t fire them on a left click instead.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`focus`,children:`Focus`}),`\n`,_jsxs(_components.p,{children:[`Turn on `,_jsx(_components.strong,{children:`Focusable`}),` for an element to add it to the focus order. Use `,_jsx(_components.strong,{children:`Focus`}),` listeners to react when the element gains focus and `,_jsx(_components.strong,{children:`Blur`}),` listeners to react when it loses focus.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Focus Target`}),` action moves focus to a specific element, and `,_jsx(_components.strong,{children:`Focus Traversal`}),` steps through the focus order. See `,_jsx(_components.a,{href:`/editor/accessibility/focus`,children:`Focus`}),` for focus order, scopes, and more.`]}),`\n`,_jsx(Heading,{level:`3`,id:`keyboard`,children:`Keyboard`}),`\n`,_jsxs(_components.p,{children:[`To react to keys, add a `,_jsx(_components.strong,{children:`Keyboard`}),` listener and choose `,_jsx(_components.strong,{children:`On Key Down`}),` or `,_jsx(_components.strong,{children:`On Key Up`}),`. Keys go to the element that has focus.`]}),`\n`,_jsxs(_components.p,{children:[`To try keyboard input in the editor, press `,_jsx(_components.strong,{children:`Option+Space`}),` to play with keyboard capture on, or click `,_jsx(_components.strong,{children:`Toggle Keyboard Capture`}),` in the playback header. This lets keys reach your file instead of triggering editor shortcuts.`]}),`\n`,_jsx(Heading,{level:`3`,id:`gamepad`,children:`Gamepad`}),`\n`,_jsxs(_components.p,{children:[`Add a `,_jsx(_components.strong,{children:`Gamepad`}),` listener to drive a state machine from a controller’s buttons and sticks. Scripts can listen to gamepad events too.`]}),`\n`,_jsx(_components.p,{children:`The gamepad icon at the bottom of an open file turns green when Rive can see your controller.`}),`\n`,_jsx(_MdxComponentBoundary,{name:`Demos`,children:_jsx(Demos,{examples:[`gamepadListeners`,`gamepadRadialMenu`,`gamepadGame`]})}),`\n`,_jsx(Heading,{level:`3`,id:`text-input`,children:`Text Input`}),`\n`,_jsxs(_components.p,{children:[`Pick the `,_jsx(_components.strong,{children:`Text Input`}),` tool in the toolbar and draw an editable text field. Draw it over a layout to add it to that layout.`]}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.strong,{children:`Text Input`}),` section of the Inspector to set the field’s font, colors, placeholder, selection color, background, and single line or multiline mode. Add a `,_jsx(_components.strong,{children:`Text Input`}),` listener to react when text is entered while the field has focus. See `,_jsx(_components.a,{href:`/editor/text/text-input`,children:`Text Input`}),` for details.`]}),`\n`,_jsx(Heading,{level:`3`,id:`semantic-action`,children:`Semantic Action`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Semantic`}),` section of the Inspector gives an element a role, such as button, checkbox, slider, or text, plus its traits and state. This helps screen readers read and navigate your file.`]}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.strong,{children:`Semantic Tap`}),`, `,_jsx(_components.strong,{children:`Semantic Increase`}),`, and `,_jsx(_components.strong,{children:`Semantic Decrease`}),` listeners to respond to screen reader actions. See `,_jsx(_components.a,{href:`/editor/accessibility/semantics#actions`,children:`Semantics`}),` for details on configuring semantic actions.`]}),`\n`,_jsx(Heading,{level:`2`,id:`listener-actions`,children:`Listener actions`}),`\n`,_jsx(_components.p,{children:`A listener action runs when a listener is triggered.`}),`\n`,_jsxs(_components.p,{children:[`To add a listener action, click the `,_jsx(_components.strong,{children:`+`}),` icon in the panel below the `,_jsx(_components.strong,{children:`State Machine Graph`}),`.`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`VideoEmbed`,children:_jsx(VideoEmbed,{src:`https://static.rive.app/video/docs/add-action-to-listener.mp4`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Action`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`View Model Change`})}),_jsxs(_components.td,{children:[`Sets the value of a view model property. See `,_jsx(_components.a,{href:`/editor/data-binding/overview`,children:`Data Binding`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Input Change`}),` (deprecated)`]}),_jsxs(_components.td,{children:[`Sets the value of a state machine `,_jsx(_components.a,{href:`/editor/state-machine/inputs`,children:`input`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`#align-target`,children:`Align Target`})}),_jsx(_components.td,{children:`Positions an object so it follows the pointer.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Focus Target`})}),_jsx(_components.td,{children:`Moves focus to a specific element.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Focus Traversal`})}),_jsx(_components.td,{children:`Steps through the focus order.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Report Event`})}),_jsxs(_components.td,{children:[`Fires a `,_jsx(_components.a,{href:`/editor/events/overview`,children:`Rive event`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Scripted Action`})}),_jsxs(_components.td,{children:[`Runs a `,_jsx(_components.a,{href:`/scripting/protocols/listener-action-scripts`,children:`listener action script`}),`.`]})]})]})]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`You can add multiple actions to a single listener, and you can data bind values in listener actions.`})}),`\n`,_jsx(Heading,{level:`3`,id:`align-target`,children:`Align Target`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Align Target`}),` action positions an object so it follows the pointer when the listener is triggered within the listener area.`]}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.strong,{children:`Target Picker`}),` to select the object you want to align.`]}),`\n`,_jsxs(_components.p,{children:[`Enable `,_jsx(_components.strong,{children:`Preserve Offset`}),` to maintain the original distance between the object and the pointer when the action is triggered. When `,_jsx(_components.strong,{children:`Preserve Offset`}),` is disabled, the object aligns directly to the pointer.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{Demos,VideoEmbed,YouTube,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Listeners","description":"Respond to interactions, property changes, and events in your Rive file.","href":"/editor/state-machine/listeners"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[141,20700,")=>null;const VideoEmbed=()=>null;const YouTube=()=>null;fun"]]},"mdxExtracts":{"tableOfContents":[{"title":"Creating a listener","slug":"creating-a-listener","depth":2,"children":[]},{"title":"Target","slug":"target","depth":2,"children":[{"title":"Opaque Target","slug":"opaque-target","depth":3,"children":[]}]},{"title":"Listen to","slug":"listen-to","depth":2,"children":[{"title":"View Model Change","slug":"view-model-change","depth":3,"children":[]},{"title":"Rive Event","slug":"rive-event","depth":3,"children":[]},{"title":"Pointer Exit","slug":"pointer-exit","depth":3,"children":[]},{"title":"Mouse buttons","slug":"mouse-buttons","depth":3,"children":[]},{"title":"Focus","slug":"focus","depth":3,"children":[]},{"title":"Keyboard","slug":"keyboard","depth":3,"children":[]},{"title":"Gamepad","slug":"gamepad","depth":3,"children":[]},{"title":"Text Input","slug":"text-input","depth":3,"children":[]},{"title":"Semantic Action","slug":"semantic-action","depth":3,"children":[]}]},{"title":"Listener actions","slug":"listener-actions","depth":2,"children":[{"title":"Align Target","slug":"align-target","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/rive/6157a238f0df2356/rive-init.js","/docs/_mintlify/custom/rive/f98a4b1fb6965efa/rive-consent.js"],"dynamicCss":".mint-absolute {\n position: absolute\n}\n.mint-relative {\n position: relative\n}\n.mint-inset-0 {\n inset: 0px\n}\n.mint-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem\n}\n.mint-mb-\\[10px\\] {\n margin-bottom: 10px\n}\n.mint-mr-\\[10px\\] {\n margin-right: 10px\n}\n.mint-mt-1 {\n margin-top: 0.25rem\n}\n.mint-mt-3 {\n margin-top: 0.75rem\n}\n.mint-mt-6 {\n margin-top: 1.5rem\n}\n.mint-block {\n display: block\n}\n.mint-flex {\n display: flex\n}\n.mint-grid {\n display: grid\n}\n.mint-h-0 {\n height: 0px\n}\n.mint-h-full {\n height: 100%\n}\n.mint-w-full {\n width: 100%\n}\n.mint-flex-grow {\n flex-grow: 1\n}\n.mint-grow {\n flex-grow: 1\n}\n.mint-cursor-pointer {\n cursor: pointer\n}\n.mint-grid-cols-1 {\n grid-template-columns: repeat(1, minmax(0, 1fr))\n}\n.mint-flex-col {\n flex-direction: column\n}\n.mint-flex-wrap {\n flex-wrap: wrap\n}\n.mint-gap-x-4 {\n column-gap: 1rem\n}\n.mint-overflow-hidden {\n overflow: hidden\n}\n.mint-rounded-2xl {\n border-radius: 1rem\n}\n.mint-rounded-\\[4px\\] {\n border-radius: 4px\n}\n.mint-border {\n border-width: 1px\n}\n.mint-border-gray-950\\/10 {\n border-color: rgb(3 7 18 / 0.1)\n}\n.mint-border-neutral-600 {\n --tw-border-opacity: 1;\n border-color: rgb(82 82 82 / var(--tw-border-opacity, 1))\n}\n.mint-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1))\n}\n.mint-object-cover {\n object-fit: cover\n}\n.mint-object-center {\n object-position: center\n}\n.mint-px-5 {\n padding-left: 1.25rem;\n padding-right: 1.25rem\n}\n.mint-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem\n}\n.mint-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem\n}\n.mint-py-5 {\n padding-top: 1.25rem;\n padding-bottom: 1.25rem\n}\n.mint-pb-\\[75\\%\\] {\n padding-bottom: 75%\n}\n.mint-text-base {\n font-size: 1rem;\n line-height: 1.5rem\n}\n.mint-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem\n}\n.mint-font-normal {\n font-weight: 400\n}\n.mint-font-semibold {\n font-weight: 600\n}\n.mint-leading-6 {\n line-height: 1.5rem\n}\n.mint-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1))\n}\n.mint-text-gray-800 {\n --tw-text-opacity: 1;\n color: rgb(31 41 55 / var(--tw-text-opacity, 1))\n}\n.mint-ring-2 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)\n}\n.mint-ring-transparent {\n --tw-ring-color: transparent\n}\n.hover\\:mint-border-white:hover {\n --tw-border-opacity: 1;\n border-color: rgb(255 255 255 / var(--tw-border-opacity, 1))\n}\n.dark\\:mint-border-white\\/10:is(.dark *) {\n border-color: rgb(255 255 255 / 0.1)\n}\n.dark\\:mint-text-gray-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1))\n}\n.dark\\:mint-text-white:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1))\n}\n@media (min-width: 768px) {\n .md\\:mint-grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr))\n }\n}\n@media (min-width: 1280px) {\n .xl\\:mint-w-\\[67rem\\] {\n width: 67rem\n }\n .xl\\:mint-max-w-\\[calc\\(100vw-25rem\\)\\] {\n max-width: calc(100vw - 25rem)\n }\n .xl\\:mint-grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr))\n }\n}","subdomain":"rive","siteName":"Rive","title":"Listeners - Rive","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-02T17:59:51.027Z","originalFileLocation":"editor/state-machine/listeners.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Respond to interactions, property changes, and events in your Rive file.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Rive\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Listeners - Rive\">\u003cmeta data-mint-head property=\"og:description\" content=\"Respond to interactions, property changes, and events in your Rive file.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Rive\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://rive.app/docs/editor/state-machine/listeners\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://rive.mintlify.site/docs/_mintlify/api/og/v2?division=Interaction\u0026amp;title=Listeners\u0026amp;description=Respond+to+interactions%2C+property+changes%2C+and+events+in+your+Rive+file.\u0026amp;theme=9d194ea41709afb0505e42e9\u0026amp;signature=0a414e8f6d962df11f9d2024ac9bed683f54eee7dc17c8c68f5d527d54214a90\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Listeners - Rive\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Respond to interactions, property changes, and events in your Rive file.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://rive.mintlify.site/docs/_mintlify/api/og/v2?division=Interaction\u0026amp;title=Listeners\u0026amp;description=Respond+to+interactions%2C+property+changes%2C+and+events+in+your+Rive+file.\u0026amp;theme=9d194ea41709afb0505e42e9\u0026amp;signature=0a414e8f6d962df11f9d2024ac9bed683f54eee7dc17c8c68f5d527d54214a90\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/rive/QOppeg00QlFTw5Bu/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Rive\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ffa41c\">\u003clink data-mint-head rel=\"canonical\" href=\"https://rive.app/docs/editor/state-machine/listeners\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/editor/state-machine/listeners.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://rive.app/#organization\",\"name\":\"Rive\",\"url\":\"https://rive.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/rive/tBktbqSaEr9ZwywZ/logo/rive_top_logo_black.svg?fit=max\u0026auto=format\u0026n=tBktbqSaEr9ZwywZ\u0026q=85\u0026s=e09b8659935986a837947ae7c3b104e0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://rive.app/docs#website\",\"name\":\"Rive\",\"url\":\"https://rive.app/docs\",\"publisher\":{\"@id\":\"https://rive.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://rive.app/docs/editor/state-machine/listeners#webpage\",\"url\":\"https://rive.app/docs/editor/state-machine/listeners\",\"name\":\"Listeners\",\"description\":\"Respond to interactions, property changes, and events in your Rive file.\",\"dateModified\":\"2026-11-02T17:59:51.027Z\",\"isPartOf\":{\"@id\":\"https://rive.app/docs#website\"},\"breadcrumb\":{\"@id\":\"https://rive.app/docs/editor/state-machine/listeners#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://rive.app/docs/editor/state-machine/listeners#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Fundamentals\",\"item\":\"https://rive.app/docs/editor/fundamentals/artboards\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Interaction\",\"item\":\"https://rive.app/docs/editor/state-machine/state-machine\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Listeners\",\"item\":\"https://rive.app/docs/editor/state-machine/listeners\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://rive.app/docs/editor/state-machine/listeners#article\",\"headline\":\"Listeners\",\"name\":\"Listeners\",\"description\":\"Respond to interactions, property changes, and events in your Rive file.\",\"url\":\"https://rive.app/docs/editor/state-machine/listeners\",\"mainEntityOfPage\":{\"@id\":\"https://rive.app/docs/editor/state-machine/listeners#webpage\"},\"dateModified\":\"2026-11-02T17:59:51.027Z\",\"publisher\":{\"@id\":\"https://rive.app/#organization\"},\"isPartOf\":{\"@id\":\"https://rive.app/docs#website\"}}]}\u003c/script>","siteName":"Rive","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/getting-started/introduction"}]},{"tab":"Editor","groups":[{"group":" ","pages":[{"title":"Using the Rive Editor","sidebarTitle":"Get Rive","href":"/editor/get-rive"},{"group":"Editor Interface","pages":[{"title":"Interface Overview","sidebarTitle":"Overview","href":"/editor/interface-overview/overview"},{"title":"File Browser","href":"/editor/interface-overview/file-browser"},{"title":"Viewport","href":"/editor/interface-overview/stage"},{"title":"Toolbar","href":"/editor/interface-overview/toolbar"},{"title":"Sidebar","href":"/editor/interface-overview/sidebar"},{"title":"Inspector","href":"/editor/interface-overview/inspector"},{"title":"Debug Panel","href":"/editor/interface-overview/debug-panel"}]},{"group":"Workflows","pages":[{"title":"Selection and Navigation","href":"/editor/interface-overview/selection-and-navigation"},{"title":"Keyboard Shortcuts","href":"/editor/keyboard-shortcuts"},{"title":"Dependencies Graph","href":"/editor/workflows/dependency-graph"},{"title":"Tagging","href":"/editor/tagging"},{"title":"Revision History","href":"/editor/fundamentals/revision-history"},{"title":"Best Practices","href":"/getting-started/best-practices"}]}]},{"group":"Fundamentals","pages":[{"group":"Design","pages":[{"title":"Artboards","href":"/editor/fundamentals/artboards"},{"title":"Components","href":"/editor/fundamentals/components"},{"group":"Drawing","pages":[{"title":"Shapes and Paths Overview","href":"/editor/fundamentals/shapes-and-paths-overview"},{"title":"Shape Tools","href":"/editor/fundamentals/procedural-shapes"},{"title":"Shape Builder","href":"/editor/design/shape-builder"},{"title":"Pen Tool Overview","href":"/editor/fundamentals/pen-tool-overview"},{"title":"Freehand Drawing with Pencil, Brush, and Eraser","sidebarTitle":"Freehand Drawing","href":"/editor/design/freehand-drawing"},{"title":"Fill and Stroke","href":"/editor/fundamentals/fill-and-stroke"},{"title":"Edit Vertices","href":"/editor/fundamentals/edit-vertices"},{"title":"Bucket Tool","sidebarTitle":"Bucket","href":"/editor/design/bucket-tool"},{"title":"Shape Bend Tool","href":"/editor/design/shape-bend-tool"},{"title":"Trim Path","href":"/editor/manipulating-shapes/trim-path"},{"title":"Clipping","href":"/editor/manipulating-shapes/clipping"}]},{"title":"Align and Distribute","href":"/editor/fundamentals/align-and-distribute"},{"group":"Text","pages":[{"title":"Text","sidebarTitle":"Overview","href":"/editor/text/text-overview"},{"title":"Text Runs","href":"/editor/text/text-runs"},{"title":"Text Styles","href":"/editor/text/text-styles"},{"title":"Text Modifiers","href":"/editor/text/text-modifiers"},{"title":"Text Input","href":"/editor/text/text-input"}]},{"group":"Hierarchical Relationships","pages":[{"title":"Hierarchy","href":"/editor/interface-overview/hierarchy"},{"title":"Groups","href":"/editor/fundamentals/groups"},{"title":"Solos","href":"/editor/manipulating-shapes/solos"},{"title":"Transform Spaces","href":"/editor/fundamentals/transform-spaces"},{"title":"Freeze and Origin","href":"/editor/fundamentals/freeze-and-origin"},{"title":"Animating Draw Order","sidebarTitle":"Custom Draw Order","href":"/editor/animate-mode/animating-draw-order"}]},{"group":"Responsive Design","pages":[{"title":"Overview","sidebarTitle":"Layouts Overview","href":"/editor/layouts/layouts-overview"},{"title":"Tools","sidebarTitle":"Tools","href":"/editor/layouts/layout-tools"},{"title":"Parameters","href":"/editor/layouts/layout-parameters"},{"title":"Component Sizing","href":"/editor/layouts/component-sizing"},{"title":"Layout Animation","href":"/editor/layouts/layout-animation"},{"title":"N-Slicing","href":"/editor/layouts/n-slicing"}]},{"title":"Rulers \u0026 Guides","href":"/editor/design/rulers-and-guides"}]},{"group":"Assets","pages":[{"title":"Assets","sidebarTitle":"Overview","href":"/editor/fundamentals/assets-overview"},{"title":"SVG \u0026 Vector Assets","href":"/editor/assets/svg"},{"title":"Photoshop Files","href":"/editor/assets/psd"},{"title":"Font Assets","href":"/editor/text/fonts"},{"title":"Audio Assets","href":"/editor/assets/audio"},{"title":"Libraries","sidebarTitle":"Libraries","href":"/editor/libraries"}]},{"group":"Animation","pages":[{"title":"Animate Mode Overview","sidebarTitle":"Overview","href":"/editor/animate-mode/animate-mode-overview"},{"title":"Timeline","href":"/editor/animate-mode/timeline"},{"title":"Keys","href":"/editor/animate-mode/keys"},{"title":"Interpolation (Easing)","href":"/editor/animate-mode/interpolation-easing"}]},{"group":"Interaction","pages":[{"group":"State Machines","pages":[{"title":"State Machine Overview","sidebarTitle":"Overview","href":"/editor/state-machine/state-machine"},{"title":"States","href":"/editor/state-machine/states"},{"title":"Transitions","href":"/editor/state-machine/transitions"},{"title":"Layers","description":"Layers let you build more complex logic and animation with the state machine. ","href":"/editor/state-machine/layers"}]},{"title":"Listeners","href":"/editor/state-machine/listeners"},{"group":"Events","pages":[{"title":"Events Overview","sidebarTitle":"Overview","description":"Creating and signaling Rive Events","href":"/editor/events/overview"},{"title":"Open URL Events","href":"/editor/events/open-url-events"},{"title":"Audio Events","href":"/editor/events/audio-events"}]}]},{"group":"Data","pages":[{"title":"Data Binding Overview","href":"/editor/data-binding/overview"},{"title":"View Models \u0026 Instances","href":"/editor/data-binding/view-models"},{"title":"View Model Properties","href":"/editor/data-binding/property-types"},{"title":"Binding Data","href":"/editor/data-binding/binding-data"},{"title":"Controlling Data","href":"/editor/data-binding/controlling-data"},{"group":"Advanced Data Binding","pages":[{"title":"Enums","href":"/editor/data-binding/enums"},{"title":"Lists","href":"/editor/data-binding/lists"},{"title":"Converters","href":"/editor/data-binding/converters"},{"title":"Stateful Components","href":"/editor/data-binding/stateful-components"},{"title":"Property Groups","href":"/editor/data-binding/property-groups"},{"title":"Migration Guide","href":"/editor/data-binding/migration-guide"}]}]},{"group":"Publishing","pages":[{"title":"Exporting for Runtime","href":"/editor/exporting/exporting-for-runtime"},{"title":"Sharing \u0026 Embedding","href":"/editor/embed-urls/overview"},{"title":"Exporting Videos \u0026 Images","href":"/editor/exporting/exporting-for-video-and-static-design"},{"title":"Exporting for Backup","href":"/editor/exporting/exporting-for-backup"}]}]},{"group":"Advanced Topics","pages":[{"group":"AI","pages":[{"title":"AI Agent","href":"/editor/ai-agent/ai-agent"},{"title":"Rive MCP Integration","sidebarTitle":"MCP Integration","href":"/editor/ai/mcp"}]},{"group":"Rigging \u0026 Control","pages":[{"title":"Manipulating Shapes Overview","sidebarTitle":"Overview","href":"/editor/manipulating-shapes/manipulating-shapes"},{"title":"Meshes","href":"/editor/manipulating-shapes/meshes"},{"title":"Bones","href":"/editor/manipulating-shapes/bones"},{"title":"Joysticks","href":"/editor/manipulating-shapes/joysticks"},{"group":"Constraints","pages":[{"title":"Constraints Overview","sidebarTitle":"Overview","href":"/editor/constraints/constraints-overview"},{"title":"IK Constraint","href":"/editor/constraints/ik-constraint"},{"title":"Distance Constraint","href":"/editor/constraints/distance-constraint"},{"title":"Scale Constraint","href":"/editor/constraints/scale-constraint"},{"title":"Rotation Constraint","href":"/editor/constraints/rotation-constraint"},{"title":"Transform Constraint","href":"/editor/constraints/transform-constraint"},{"title":"Translation Constraint","href":"/editor/constraints/translation-constraint"},{"title":"Follow Path Constraint","href":"/editor/constraints/follow-path-constraint"},{"title":"Scroll Constraints","href":"/editor/constraints/scroll-constraint"}]}]},{"group":"Accessibility","pages":[{"title":"Semantics","href":"/editor/accessibility/semantics"},{"title":"Focus","href":"/editor/accessibility/focus"},{"title":"Reduced Motion","href":"/editor/accessibility/reduced-motion"}]},{"group":"Admin \u0026 Workspaces","pages":[{"group":"Workspaces","pages":[{"title":"Workspaces","sidebarTitle":"Overview","href":"/account-admin/workspaces/workspaces-overview"},{"title":"Managing Workspaces","href":"/account-admin/workspaces/managing-workspaces"},{"title":"Managing Workspace Members","sidebarTitle":"Workspace Members","href":"/account-admin/workspaces/managing-workspace-members"}]},{"title":"Bring Your Own S3 Bucket","href":"/account-admin/bring-your-own-bucket"}]},{"group":"Legacy Features","pages":[{"title":"Inputs","href":"/editor/state-machine/inputs"},{"title":"Events at Runtime","href":"/editor/events/general-events"}]}]}]},{"tab":"Scripting","pages":[{"title":"Scripting","href":"/scripting/getting-started"}]},{"tab":"Runtimes","pages":[{"title":"Runtimes","href":"/runtimes/getting-started"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/overview"}]},{"tab":" ","pages":[{"title":" ","href":"/tutorials/learn-rive"}]},{"tab":" ","pages":[{"title":" ","href":"/community/support"}]}]},"basePath":"","title":"Listeners - Rive","buildId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","deploymentId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","dynamics":[],"chunks":[]}