Skip to content

Declare a component the scanner can't resolve

The scanner traces your custom components down to the HTML element they render, so a rule like image-alt fires on your wrappers too. Some components it can’t reach: a component from a third-party package with no source on disk, one that renders more than one element, or one whose host is chosen at runtime. It lists these under UNCHECKED.

If you want the scanner to treat such a component as a specific host element, map it in the components map in binclusive.json. This is the path for your own components, imported from @/, ./, ~, #, or one of your tsconfig path aliases, and for composites such as Table, Form, Card, or Dialog.

Open binclusive.json and add the component name and the host element it renders to the top-level components map:

{
"version": 1,
"components": {
"Avatar": "img",
"FancyButton": "button"
}
}

The host must be a single lowercase intrinsic tag (img, button, a, …). To map a compound member such as <Dialog.Close>, use its dotted name as the key: "Dialog.Close": "button".

Now a <Avatar src="/me.png" /> with no alt text is checked as an <img> and flagged, and a <FancyButton> is checked as a <button>.

Your declaration wins outright — it overrides both the built-in design-system registry and the scanner’s own source-trace. Use it when you know the host and the scanner does not.

Declare a wrapper on SwiftUI, Compose, Android XML, Astro or Liquid

Section titled “Declare a wrapper on SwiftUI, Compose, Android XML, Astro or Liquid”

These scanners don’t map a wrapper to an HTML tag. Give the wrapper a role instead: an object with a kind (control, image, text or container) and suppliesName, which says whether the wrapper gives the control around it an accessible name.

One example per platform. React keeps the host tag:

{
"version": 1,
"components": {
"FancyButton": "button",
"AvatarView": { "kind": "image", "suppliesName": false },
"AppIcon": { "kind": "image", "suppliesName": true },
"RoundButton": { "kind": "control", "suppliesName": true },
"BrandLogo": { "kind": "image", "suppliesName": true },
"icon-cart": { "kind": "image", "suppliesName": true }
}
}
  • React: FancyButton is checked as a <button>.
  • SwiftUI: a Button { AvatarView() } is flagged as a control with no name, because the view only shows an image.
  • Compose: an IconButton { AppIcon() } counts as named instead of being reported as out of view.
  • Android XML: a <com.app.RoundButton android:clickable="true" /> counts as a named control. The key is the class name without its package.
  • Astro: an <a href="/"><BrandLogo /></a> counts as named. The key is the name the component is imported under.
  • Liquid: a <button>{% render 'icon-cart' %}</button> counts as named. The key is the snippet name.

A role applies only where the scanner can’t read the wrapper itself. If the wrapper’s source is in the scan, what the scanner proves from it wins over your declaration. A host tag such as "img" counts as a role that supplies no name, so a host tag you wrote for React also reaches these scanners.

Re-scan and check the finding you expected now appears (or the false gap is gone):

Terminal window
b8e scan .

The components map also feeds the generated BINCLUSIVE.md. After editing the block, regenerate so the two stay in sync:

Terminal window
b8e gen

Pre-fill declarations for library primitives

Section titled “Pre-fill declarations for library primitives”

For external design-system primitives, such as a Button or TextField from a package, run b8e init --suggest to pre-fill declarations from the scanner’s best guesses, and review the result before committing. It covers those primitives only: it skips own-project modules (@/, ./, ~, #, and your tsconfig path aliases) and composite names, so for those you write the declaration yourself. For the full contract shape, see the init reference.