A control in a custom is a UI element you define and draw yourself, so nothing in the platform enforces that it exists, is unique, or is exposed to assistive technology. To determine whether it is real rather than a painted illusion, check five things in order: it can be found and identified by role, name, and state; it can be operated by keyboard alone; it reports state changes back to the platform; it is still reachable and sized correctly after layout and scaling; and it survives a rerun of the same checks on every build. Miss any one and you have a picture of a control, not a control.
The reference date is November 13, 2026, and the guidance below is written to stay valid across framework versions by separating stable principles from version-specific steps. Where an exact API or setting matters, treat it as something you must confirm in your own toolchain's documentation rather than a universal constant.
First, separate "control-like" from "an actual control"
A custom control usually begins as a rectangle or text region that the framework treats as anonymous. An actual control is a node in the platform's control tree that carries four pieces of information: a type or role, a name, a current state, and a connection to the input pipeline. The distinction matters because almost every downstream requirement — keyboard navigation, screen reader output, automation, automated testing, focus order — depends on that tree existing.
The practical test is to ask a platform-level tool what it sees at the control's screen coordinates. If an inspection tool reports a generic container with no name and no role, the element is decorative. If it reports "button, name 'Save draft', disabled," it is on its way to being a control.
There is a second category worth naming because it trips up teams: a control that is technically exposed but mislabeled. It has a role and a name, but the name is a placeholder ("button1"), the role is wrong ("image" for a checkbox), or the state is stale (still says "enabled" after you disabled it). That is not a passing control either. The checks below are ordered so you catch the cheap failures first.
Step 1 — Confirm the prerequisites before you test anything
You need three things on hand before a measurement means anything: a build you can run outside production with instrumentation enabled, at least two platform inspection routes (one for the control tree and one for the raw element or rendering layer), and a written definition of what the control is supposed to do. That last item is the one people skip, and it's the one that makes the result meaningful — "does this control work" is unanswerable without a stated contract.
Write a four-line spec before you look at the screen:
Role: what kind of control is this (button, toggle, slider, text field, menu item)? Name: what phrase identifies it, and is that phrase visible text or an accessible label? State: which values must be reported (checked, selected, expanded, disabled, invalid, value)? Action: what single operation should it perform, and by which input methods (pointer, keyboard, assistive tech)?
A success check for this step is simple: someone who did not write the control can read the four lines and predict what a passing result looks like. If they can't, the spec is too vague to test.
Step 2 — Inspect the accessibility tree, not just the visual tree
Run the platform inspection tool and locate the control by its on-screen position, then read what the tree reports for role, name, and state. This is the fastest discriminating check because it fails loudly and early.
Three outcomes are possible, and each has a different cause:
The tree reports nothing at that position. The control is drawn but not registered. The likely cause is that you painted it inside a canvas or a container marked as presentational, so the framework has no reason to expose it. This is reversible: add an explicit role or, better, build on a native control and restyle it.
The tree reports a node but with the wrong role. Common mismatches are a toggle exposed as a plain button, a set of tabs exposed as a list, or a composite widget exposed as a group with no children. The cause is usually a default that you never overrode. Fix the role at the source, not with an after-the-fact patch.
The tree reports a node with the correct role but an empty or generic name. The name is computed from several ordered sources — visible text, an associated label, an accessible-name property — and the first non-empty one wins. An empty name usually means the visible text is inside a child node that is itself hidden from the tree, so the parent has nothing to borrow.
The success check is concrete: an inspection readout that someone unfamiliar with your code could read out loud and have it match your four-line spec. The failure check is equally concrete: any attribute you can only find by reading source code rather than the tree is not exposed.
One caution about names specifically. A name that changes with every render — a timestamp, a row index, a randomly generated identifier — will pass a casual inspection and fail a real one, because the name no longer identifies the control. Names should be stable across renders and unique within their scope.
Step 3 — Operate it with the keyboard only, in order
Put the pointer away. Tab through the interface from the top and note where focus lands. A control that cannot receive focus cannot be operated by keyboard, and a control that can receive focus but cannot be operated by keyboard is worse than useless because it announces itself as interactive and then refuses.
Test the basic loop: focus it, activate it with the standard activation keys for your platform, and confirm the action fires exactly once. Then test the escape hatches — can you move focus away without triggering the action, and does focus return sensibly after a modal or menu closes?
Composite controls need more. A list, grid, or set of tabs is a single focus stop with internal navigation: arrow keys move within, home and end jump to the bounds, and typing may jump to a matching item. If each item in your custom list is its own tab stop, the control is technically reachable and practically exhausting — that's a failure of the composite pattern, not a stylistic choice.
Disabled states are a separate branch. A disabled control should not be focusable in most platform conventions, and if it remains focusable it must report its disabled state so assistive technology can explain why nothing happens. Decide which convention your platform follows and apply it consistently; inconsistency here is a reliable source of bug reports.
The stop condition for this step: if keyboard operation requires a code change to the input routing layer rather than the control itself, stop and fix the routing first. Layering key handling inside individual controls to work around a broken global focus order produces a system that fails in new ways with every added control.
Step 4 — Verify that state changes are announced, not just rendered
Here the mechanism matters. Rendering a change and reporting a change are two different pipelines. A checkbox that fills with a checkmark is rendering; a checkbox that flips its checked state in the control tree is reporting. The first is invisible to assistive technology, the second is not.
For each state in your spec, trigger the change and re-inspect. Then confirm the announcement path: for a state change on the currently focused control, the platform typically announces it automatically. For a change elsewhere on the page — a status message, an error summary, a count that updates — you generally need a live region or an explicit notification call.
Two failure modes are worth naming because both look fine on screen:
A prop that is tracked in your component's internal state but never written to the platform's state. The visual updates, the tree doesn't. This happens most often when a custom control maintains a shadow copy of its state for animation or optimistic UI, and the copy drifts from the source of truth.
A state that is written once at mount and never updated. Toggling works the first time and silently stops reporting afterward. Re-inspecting after a second toggle catches this.
Success check: perform each state transition twice, re-inspecting after each, and confirm the reported state matches the visible state both times. Failure check: any state you can only confirm by reading a screenshot.
Step 5 — Check name, description, and error association end to end
The name check from Step 2 deserves its own pass because names interact with context. A control inside a repeated row needs a name that distinguishes the row; a control next to a visible label must be associated with that label rather than duplicating its text; a control with a tooltip must expose the tooltip content as a description, not as a second name.
Errors are the most commonly broken association. An invalid field should report invalid state, and its error text should be programmatically tied to the field so that focusing the field surfaces the message. A red outline alone communicates nothing to a user who cannot see it.
Required and read-only are the other two states that get lost, because they have no obvious visual signature. If your spec says a field is required, the tree must report required. If it says read-only, the tree must report read-only rather than disabled — they are not the same thing, and users experience them differently.
Success check: for each control, read out the name, description, and error association from the inspection tool and confirm all three are correct and non-duplicated. Failure check: an error message that exists in the document but is not referenced by the field.
Step 6 — Stress layout, scaling, and input modes
A control can pass every check above and still fail in production because custom drawing is sensitive to conditions that native controls absorb. Test four conditions, each cheap to reproduce:
Zoom or text scaling at the upper end of your platform's supported range. Custom controls that size themselves in fixed pixels tend to clip labels and overlap neighbors. The check is whether the control grows with text and whether its hit area still covers the visible control.
Window resizing and reflow. Confirm focus is not lost when the control moves, and that the control tree updates rather than pointing at stale coordinates.
Pointer alternatives. If your product supports touch, confirm the hit target meets your platform's minimum size guidance rather than the visual size of the drawn shape. A 16-pixel icon with a 44-pixel invisible hit area is a deliberate pattern; a 16-pixel hit area is a defect.
High-contrast or forced-colors modes. Custom-drawn controls frequently lose their borders entirely in these modes because the drawn colors are overridden while the shape geometry isn't. The check is whether the control remains distinguishable from its background, not whether it looks the same.
The stop condition here: if fixing scaling requires rewriting the control's layout engine, it is usually cheaper to replace the custom control with a native one and theme it. That trade-off is worth stating explicitly rather than discovering after three sprints.
Step 7 — Prove it with automation instead of memory
Manual inspection confirms the current build. Automation confirms every future build, which is the actual requirement, since custom controls regress quietly.
There are two complementary layers, and using only one is a common mistake:
A role-and-name query layer. Your test harness should locate the control by role and accessible name rather than by CSS class or internal identifier. If the test can only find the control by selector, the tree is not carrying enough information. This layer catches missing roles, renamed controls, and controls that dropped out of the tree.
A keyboard-and-state layer. Drive the control with keyboard events and assert on the reported state. This catches the stale-state failures from Step 4 and the focus-order regressions from Step 3 that visual snapshot tests never see.
Run both against your four-line spec. The success check is a test that fails when you deliberately break the role, the name, or the state reporting — verify that by making the break once and confirming the test goes red. A test that passes after you remove the role attribute is not testing anything.
Scale the layer sensibly. You do not need automation for every control on every screen. Automate the controls in your shared component library once, at the component level, and let consumers inherit the coverage. That is the highest-leverage place to spend the effort, and it keeps the spec and the test in the same repository.
A quick tooling survey, without versions
Because no live verification is available here, treat tool names as categories and confirm current behavior in your own environment:
Platform accessibility inspectors read the control tree directly and are the primary evidence for Steps 2, 4, and 5. Browser-based inspectors typically show an accessibility pane alongside the element tree, which is useful because seeing both at once makes the "painted but not exposed" failure obvious.
Screen readers are the end-to-end check, and they are the only way to confirm that announcements actually reach a user in the order you expect. Use one that matches your platform's primary convention rather than testing against all of them; cross-reader differences are real but secondary to a control that fails the tree check entirely.
Automation harnesses with role-and-name queries are the durable layer. Some ecosystems expose a dedicated accessibility-tree query; others require a testing-library-style API. Either satisfies Step 7 as long as the query is role and name, not selector.
Static analysis and lint rules can catch a subset — missing labels, invalid role combinations — but they cannot catch stale state or broken focus order. Treat them as a cheap first filter, not the verdict.
Where these checks mislead you
Four limits are worth stating plainly, because each produces a false pass:
A correct role with a wrong interaction model. A div given a button role will report as a button and still fail to activate on the space bar. The tree check passes, the keyboard check in Step 3 fails. This is why the steps are ordered as they are.
A name that is technically present but contextually wrong. "Delete" repeated twelve times in a table passes Step 2 and fails a real user, who cannot tell which row each belongs to. Read names in context, not in isolation.
State reported but not announced. Writing state to the tree and wiring a live region are separate tasks; a control can be correct and silent at the same time. Step 4's second toggle catches reporting drift, but announcement ordering needs a screen reader pass.
Framework-level fixes that mask per-control defects. If your design system automatically supplies roles and labels, individual controls can appear correct while their specific behavior is broken. Test the control against its spec, not against the base component's defaults.
The decision rule
After running all seven steps, you have one of three outcomes, and each has a clear next action:
If every check passes and the automation layer fails when you break it, the custom control is a control. Keep it, and keep the spec next to the test.
If the tree checks pass but keyboard or state reporting fails, the control is exposed but not operable. Fix the interaction model in the control; do not route around it in global key handling.
If the tree checks fail — no role, no name, or no state — the element is decorative regardless of how it looks. Either promote it to a real control with the four pieces of information, or replace it with a native control and apply your styling to that. In most codebases, the second option is cheaper, and the inspection tools will tell you so the moment you look.