Components
Blocks
- Gift Certificate
- Event Agenda
- Event Ticket
- Invoice Classic
- Invoice Consultant
- Invoice Corporate
- Invoice Creative
- Invoice Minimal
- Invoice Modern
- Lesson Plan
- Medical Intake Form
- Meeting Minutes
- Packing Slip
- Press Release
- Report Financial
- Report Marketing
- Report Operations
- Report Security
- Shipping Label
- Work Order
Rendering PDF…
Installation
$ pnpm dlx shadcn@latest add @angular-pdfcn/takumi/badgeUsage
import { Component } from "@angular/core";
import { PdfBadge } from "@/components/pdf/badge/badge";
import { PdfcnThemeProvider } from "@/components/pdf/theme-provider";
import {
TakumiDocument,
TakumiPage,
TakumiView,
} from "@/lib/pdf-primitives";
@Component({
imports: [
TakumiDocument,
TakumiPage,
PdfcnThemeProvider,
PdfBadge,
TakumiView,
],
template: `
<takumi-document>
<takumi-page [size]="{ height: 200, width: 595 }">
<pdf-theme-provider>
<takumi-view
[style]="{
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',
gap: 6,
marginBottom: 12,
}"
>
<pdf-badge label="Small" variant="default" size="sm" />
<pdf-badge label="Medium" variant="default" size="md" />
<pdf-badge label="Large" variant="default" size="lg" />
</takumi-view>
</pdf-theme-provider>
</takumi-page>
</takumi-document>
`,
})
export class BadgeDemo {}API Reference
PdfBadge
| Input | Type | Default |
|---|---|---|
label |
string |
- |
variant |
'default' | 'primary' | 'success' | 'warning' | 'destructive' | 'info' | 'outline' |
'default' |
size |
'sm' | 'md' | 'lg' |
'md' |
background |
string |
- |
color |
string |
- |
The badge text is the label input or projected content.