This page covers the is prop for Vue and Nuxt (@daisyuikit/vue and @daisyuikit/nuxt). Other frameworks handle routing through their own link components — see your framework's documentation.
Many DaisyUI Kit components support the is prop, which allows you to change the underlying HTML element or Vue component that gets rendered. This is particularly useful for client-side navigation with Vue Router's RouterLink or Nuxt's NuxtLink.
The following components support the is prop for link rendering:
In Nuxt projects, pass is="NuxtLink" along with the to prop.
In Vue Router projects (without Nuxt), use is="RouterLink":
<Button is="RouterLink" to="/dashboard" primary>
Dashboard
</Button>
<Card is="RouterLink" to="/products/123">
<CardBody>
<CardTitle>Product Name</CardTitle>
</CardBody>
</Card>
Using the is prop instead of wrapping components:
You can also use is to render as other HTML elements:
<!-- Render as an anchor tag for external links -->
<Button is="a" href="https://example.com" target="_blank">
External Link
</Button>
<!-- Render as a span -->
<Badge is="span">
Status
</Badge>
<!-- Render as an article element for semantic HTML -->
<Card is="article">
<CardBody>Article content</CardBody>
</Card>