For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any docs URL. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0Sponsor

Alert

Alert box with info, success, warning, and error variants.

Takumi Forme
Rendering PDF…

Installation

$ pnpm dlx shadcn@latest add @angular-pdfcn/forme/alert

Usage

import { Component } from "@angular/core";

import { PdfAlert } from "@/components/pdf/alert/alert";
import { PdfHeading } from "@/components/pdf/heading/heading";
import { PdfSection } from "@/components/pdf/section/section";
import { PdfText } from "@/components/pdf/text/text";
import {
  FormeDocument,
  FormePage,
} from "@/lib/pdf-primitives";

@Component({
  imports: [
    FormeDocument,
    FormePage,
    PdfAlert,
    PdfHeading,
    PdfSection,
    PdfText,
  ],
  template: `
    <forme-document>
      <forme-page size="A4" [margin]="40">
        <pdf-section spacing="none">
          <pdf-heading [level]="1">Document Alerts</pdf-heading>
          <pdf-text
            >The PdfAlert component displays callout boxes with different
            severity levels.</pdf-text
          >
          <pdf-section>
            <pdf-alert variant="info" title="Information"
              >This document contains important information about your
              account.</pdf-alert
            >
            <pdf-alert variant="success" title="Success"
              >Your payment has been processed successfully.</pdf-alert
            >
            <pdf-alert variant="warning" title="Warning"
              >Please review the terms and conditions before
              proceeding.</pdf-alert
            >
            <pdf-alert variant="error" title="Error"
              >Missing required fields. Please complete all sections.</pdf-alert
            >
          </pdf-section>
        </pdf-section>
      </forme-page>
    </forme-document>
  `,
})
export class AlertDemo {}

API Reference

PdfAlert

Input Type Default
variant 'info' | 'success' | 'warning' | 'error' 'info'
title string -
showIcon boolean true
showBorder boolean true

The alert body is projected content.