Installation
copied = false, 2000)
"
:aria-label="copied ? 'Copied' : 'Copy code'"
class="absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
>
uvx django_shadcn@latest add a
Usage
copied = false, 2000)
"
:aria-label="copied ? 'Copied' : 'Copy code'"
class="absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
>
<c-a href='/docs'>Link</c-a>
The tag is <c-a>, after the element it renders. It takes the button sizes and
nothing else — upstream this is the link variant of the button applied to an
anchor, so there is no variant to pass. For a link that looks like a solid
button, use <c-button> with an href.
Every attribute you set reaches the <a>, so target, rel and download
work as usual, and href takes Django's url tag like any other template.
Examples
Sizes
copied = false, 2000)
"
:aria-label="copied ? 'Copied' : 'Copy code'"
class="absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
>
<c-a href='#' size='xs'>Extra small</c-a>
<c-a href='#' size='sm'>Small</c-a>
<c-a href='#'>Default</c-a>
<c-a href='#' size='lg'>Large</c-a>
With an icon
copied = false, 2000)
"
:aria-label="copied ? 'Copied' : 'Copy code'"
class="absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
>
<c-a href='#'>
Documentation
<c-icon name='chevron-right' />
</c-a>
External
copied = false, 2000)
"
:aria-label="copied ? 'Copied' : 'Copy code'"
class="absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
>
<c-a href='https://ui.shadcn.com' target='_blank' rel='noopener noreferrer'>
shadcn/ui
</c-a>