Skip to main content
NVDA Objects are the fundamental building blocks that represent controls and GUI elements in NVDA. Every widget, regardless of its underlying API, is represented as an NVDAObject instance.

What is an NVDA Object?

An NVDA Object provides:
  • Standardized properties: name, role, value, states, description
  • Navigation: parent, children, next, previous relationships
  • Event handling: Response to focus, value changes, etc.
  • Scripting: Custom commands and gesture bindings
  • Text access: Through TextInfo objects

Base Class: NVDAObject

The NVDAObject class is defined in source/NVDAObjects/__init__.py:
NVDAObject base class

API Classes

NVDA supports multiple accessibility APIs through specialized classes:

IAccessible Objects

For MSAA/IAccessible controls:
IAccessible Example

UI Automation Objects

For modern Windows UIA controls:
UIA Example

Window Objects

For direct Win32 window access:
Window Example

Dynamic Class Creation

One of NVDAโ€™s most powerful features is dynamic class creation. When an object is instantiated:
Dynamic class creation flow
This allows NVDA to combine generic API support with application-specific behaviors without modifying core code.

Creating Custom NVDA Objects

Step 1: Define the Class

Inherit from the appropriate base class:
Custom NVDA Object

Step 2: Choose When to Use It

In your app module or global plugin:
Choosing overlay classes
Insert custom classes at index 0 so they are resolved first in the method resolution order (MRO).

Common Properties

Essential Properties

Essential properties

Location and Visibility

Location properties
Navigation properties

Working with States

States indicate the current condition of a control:
Using states

Text Access

NVDA Objects can provide text access:
Text access

Custom TextInfo

Custom TextInfo

Focus Redirect

Redirect focus to a different object:
Focus redirect

Tree Interceptors

Complex documents can have tree interceptors (like browse mode):
Tree interceptor

Practical Example: Custom Button

Complete example of a custom button with enhanced features:
Complete custom button example

Best Practices

Properties are cached by default for performance. To disable caching for a specific property:
Classes in clsList should be ordered from most specific to most general:
NVDA uses weak references for object relationships. Donโ€™t store strong references unnecessarily:
Only access API-specific properties when you know the object type:

See Also

Events

Learn about event handling

Scripts & Gestures

Add commands to objects

Writing Plugins

Create app modules and overlays

Architecture Overview

Understand the big picture