---
title: "Button inside a trigger without asChild (shadcn/nested-trigger)"
description: "Radix triggers render a <button>: a button inside it is invalid HTML, a hydration error and a double tab stop."
url: http://localhost:4173/rules/shadcn/nested-trigger
updated: 2026-11-11
---

# Button inside a trigger without asChild

> `shadcn/nested-trigger` is a vetd rule. It flags: Button inside a trigger without asChild. It runs on every `check`, together with the TypeScript check.

| Fact | Value |
| --- | --- |
| Rule id | `shadcn/nested-trigger` |
| Severity | error |
| Group | shadcn/ui and Radix composition |
| Tags | react, accessibility |

## Why it matters

Radix triggers render a <button>: a button inside it is invalid HTML, a hydration error and a double tab stop.

## How to fix it

Add asChild to the trigger so it merges into the child.

## Credit

Based on work by:

- [Radix UI](https://www.radix-ui.com): The asChild prop merges a primitive's behavior into its single child instead of rendering an extra element.

## References

- [Composition – Radix Primitives](https://www.radix-ui.com/primitives/docs/guides/composition), Radix UI
- [Dialog - shadcn/ui](https://ui.shadcn.com/docs/components/radix/dialog), shadcn/ui

## Related rules

- [`shadcn/as-child-single-element`](http://localhost:4173/rules/shadcn/as-child-single-element.md)

## Get this text from vetd

MCP: call `explain` with `{ "diagnosticId": "shadcn/nested-trigger" }`. CLI: `npx vetd explain shadcn/nested-trigger`.

---

[All 92 rules](http://localhost:4173/rules.md) · Previous: [`ui/reduced-motion`](http://localhost:4173/rules/ui/reduced-motion.md) · Next: [`shadcn/as-child-single-element`](http://localhost:4173/rules/shadcn/as-child-single-element.md)
