---
title: "asChild in a Base UI project (shadcn/base-ui-as-child)"
description: "Base UI components compose through the render prop; asChild is ignored."
url: http://localhost:4173/rules/shadcn/base-ui-as-child
updated: 2026-11-11
---

# asChild in a Base UI project

> `shadcn/base-ui-as-child` is a vetd rule. It flags: asChild in a Base UI project. It runs on every `check`, together with the TypeScript check.

| Fact | Value |
| --- | --- |
| Rule id | `shadcn/base-ui-as-child` |
| Severity | error |
| Group | shadcn/ui and Radix composition |
| Tags | react, correctness |

## Why it matters

Base UI components compose through the render prop; asChild is ignored.

## How to fix it

Use render={<Link href="…" />}.

## Credit

Based on work by:

- [Base UI](https://base-ui.com): Components compose through the render prop rather than asChild.

## References

- [Composition · Base UI](https://base-ui.com/react/handbook/composition), Base 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/base-ui-as-child" }`. CLI: `npx vetd explain shadcn/base-ui-as-child`.

---

[All 92 rules](http://localhost:4173/rules.md) · Previous: [`shadcn/dialog-title`](http://localhost:4173/rules/shadcn/dialog-title.md) · Next: [`tailwind/dynamic-class`](http://localhost:4173/rules/tailwind/dynamic-class.md)
