Skip to main content

Angular

Primus UI for Angular

Primus UI Angular package usage.

[!NOTE] New to Primus UI with Angular? Check out the Angular Integration Guide for step-by-step setup instructions including installation, requirements, module configuration, and standalone setup.

Angular Component Usage​

This page provides usage examples for all Primus UI components in Angular. For initial project setup, see the Angular Integration Guide.

Angular component usage (one by one)​

Notification Center​

<primus-notification-center
[apiUrl]="'https://api.yourdomain.com'"
theme="dark"
[pollInterval]="3000"
></primus-notification-center>

Notification Feed​

<primus-notification-feed
[apiUrl]="'https://api.yourdomain.com'"
[pollInterval]="3000"
[userId]="'user-123'"
></primus-notification-feed>

Checkout Form​

<primus-checkout-form
[amount]="499"
currency="USD"
[apiUrl]="'https://api.yourdomain.com'"
(onSuccess)="handlePayment($event)"
(onError)="handlePaymentError($event)"
></primus-checkout-form>

Security Dashboard​

<primus-security-dashboard
[apiUrl]="'https://api.yourdomain.com'"
></primus-security-dashboard>

RBAC Admin​

<primus-rbac-admin
[apiUrl]="'https://api.yourdomain.com'"
[withCredentials]="true"
title="RBAC Admin"
subtitle="Roles, permissions, teams, and access checks">
</primus-rbac-admin>

Provide auth tokens via PRIMUS_CONFIG so the admin UI can call secured RBAC endpoints:

import { PRIMUS_CONFIG } from "primus-angular-ui";

providers: [
{
provide: PRIMUS_CONFIG,
useValue: {
apiBaseUrl: "https://api.yourdomain.com",
authToken: () => localStorage.getItem("access_token")
}
}
]

The RBAC Admin UI expects the RBAC endpoints described in the backend integration guide: /docs/modules/rbac/integration-guide.

Document Viewer (Document Mode)​

<primus-document-viewer
[document]="doc"
(onClose)="closeViewer()"
(onDownload)="downloadDoc()"
></primus-document-viewer>

File Uploader​

<primus-file-uploader
[apiUrl]="'https://api.yourdomain.com'"
(onUploadComplete)="onFileUploaded($event)"
></primus-file-uploader>

AI Copilot​

<primus-ai-copilot
title="AI Copilot"
placeholder="Ask me anything..."
mode="complete"
[apiUrl]="'https://api.yourdomain.com'"
(responded)="handleAi($event)"
></primus-ai-copilot>

Login​

<primus-login
title="Welcome Back"
subtitle="Enter your credentials"
[showEmailLogin]="true"
[socialProviders]="['google','github']"
authEndpoint="/api/auth"
theme="light"
[useService]="true"
(onLogin)="onLogin($event)"
(onSocialLogin)="onSocial($event)"
></primus-login>

User Profile​

<primus-user-profile
[user]="currentUser"
[showLogout]="true"
[useService]="true"
(loggedOut)="onLoggedOut()"
></primus-user-profile>

Data Table​

<primus-data-table
[columns]="columns"
[data]="rows"
[selectable]="true"
(onRowClick)="onRowClick($event)"
(onSelectionChange)="onSelection($event)"
></primus-data-table>
<primus-search
placeholder="Search users"
[debounce]="300"
(search)="onSearch($event)"
></primus-search>
<primus-modal
[open]="isOpen"
title="Confirm Action"
size="md"
(onClose)="isOpen = false"
>
Modal content goes here.
<div modal-footer>
<button>Confirm</button>
</div>
</primus-modal>

Dashboard​

<primus-dashboard
title="Overview"
subtitle="Key metrics"
></primus-dashboard>

Dashboard Grid​

<primus-dashboard-grid [columns]="3">
<!-- dashboard cards here -->
</primus-dashboard-grid>

Activity Feed​

<primus-activity-feed
[items]="activityItems"
[maxItems]="8"
[showTimestamps]="true"
[groupByDate]="true"
></primus-activity-feed>

Filter Bar​

<primus-filter-bar
[filters]="filters"
[activeFilters]="activeFilters"
(filterChange)="onFilterChange($event)"
></primus-filter-bar>

Export Menu​

<primus-export-menu
[formats]="['CSV', 'PDF']"
(export)="onExport($event)"
></primus-export-menu>

Charts​

<primus-line-chart [labels]="labels" [series]="series" [height]="320"></primus-line-chart>
<primus-header
[title]="'Primus Admin'"
[breadcrumbs]="breadcrumbs"
[user]="currentUser"
(onUserClick)="onUserClick()"
></primus-header>
<primus-sidebar
[items]="navItems"
[activeId]="activeNavId"
(onItemClick)="onNavClick($event)"
></primus-sidebar>

Layout​

<primus-layout [sidebar]="true" [header]="true" [darkMode]="false">
<!-- app content -->
</primus-layout>

Transaction History​

<primus-transaction-history
[transactions]="transactions"
(onTransactionClick)="onTransactionClick($event)"
></primus-transaction-history>

Feature Flag Toggle​

<primus-feature-flag-toggle
flagKey="beta-dashboard"
[apiUrl]="'https://api.yourdomain.com'"
(toggled)="onFlagToggled($event)"
></primus-feature-flag-toggle>

KYC Verification​

<primus-kyc-verification
userId="user-123"
[apiUrl]="'https://api.yourdomain.com'"
></primus-kyc-verification>

Credit Card​

<primus-credit-card
cardHolder="Jane Doe"
last4="4242"
expiry="12/26"
brand="visa"
variant="platinum"
></primus-credit-card>

Account Dashboard​

<primus-account-dashboard
[apiUrl]="'https://api.yourdomain.com'"
></primus-account-dashboard>

Credit Score Card​

<primus-credit-score-card
userId="user-123"
[apiUrl]="'https://api.yourdomain.com'"
></primus-credit-score-card>

Loan Calculator​

<primus-loan-calculator
[apiUrl]="'https://api.yourdomain.com'"
></primus-loan-calculator>

Log Viewer​

<primus-log-viewer></primus-log-viewer>

Fraud Detection Dashboard​

<primus-fraud-detection-dashboard
[riskScore]="32"
[alerts]="fraudAlerts"
></primus-fraud-detection-dashboard>

Claim Status Tracker​

<primus-claim-status-tracker
claimId="CLM-1024"
status="In Review"
[steps]="claimSteps"
></primus-claim-status-tracker>

Claim Tracker​

<primus-claim-tracker
claimId="CLM-2048"
status="Submitted"
[steps]="claimSteps"
></primus-claim-tracker>

Policy Card​

<primus-policy-card></primus-policy-card>

Premium Calculator​

<primus-premium-calculator title="Premium Calculator"></primus-premium-calculator>

Quote Comparison​

<primus-quote-comparison
[quotes]="quotes"
></primus-quote-comparison>

Agent Directory​

<primus-agent-directory
[agents]="agents"
></primus-agent-directory>

Button​

<primus-button>Primary</primus-button>

Input​

<primus-input label="Email" placeholder="name@example.com"></primus-input>

Form Field​

<primus-form-field label="Company">
<input type="text" />
</primus-form-field>

Textarea​

<primus-textarea label="Notes" placeholder="Enter notes"></primus-textarea>

Select​

<primus-select label="Plan" [options]="planOptions"></primus-select>

Radio Group​

<primus-radio-group label="Billing" [options]="billingOptions"></primus-radio-group>

Toggle​

<primus-toggle label="Enable alerts" [checked]="true"></primus-toggle>

Date Picker​

<primus-date-picker label="Start date"></primus-date-picker>

Date Range Picker​

<primus-date-range-picker
[ranges]="['Today', 'Last 7 days']"
(rangeChange)="onRangeChange($event)"
></primus-date-range-picker>

Stats Card​

<primus-stats-card label="Monthly Revenue" [value]="'$142k'" delta="+12%" trend="up"></primus-stats-card>

Theme Toggle​

<primus-theme-toggle></primus-theme-toggle>

Stepper​

<primus-stepper
[steps]="steps"
[activeStep]="1"
[completedSteps]="[0]"
(stepSelected)="onStepSelected($event)"
></primus-stepper>

Wizard​

<primus-wizard title="Leave Request" subtitle="Step 1 of 3">
<div wizard-steps>
<primus-stepper
[steps]="steps"
[activeStep]="1"
[completedSteps]="[0]"
></primus-stepper>
</div>
<div wizard-content>
<!-- step content -->
</div>
<div wizard-actions>
<primus-wizard-nav
(back)="onBack()"
(next)="onNext()"
></primus-wizard-nav>
</div>
</primus-wizard>

Wizard Nav​

<primus-wizard-nav
backLabel="Back"
nextLabel="Next"
(back)="onBack()"
(next)="onNext()"
></primus-wizard-nav>

Summary Card​

<primus-summary-card title="Total Users" subtitle="Last 30 days">
<div>24,910</div>
</primus-summary-card>

Section​

<primus-section title="Settings">
Section content here.
</primus-section>

Props reference (all components)​

Angular props reference​

<primus-account-card>​

Inputs

InputDescription
accountNameAccount display name.
accountNumberMasked account number.
balanceAccount balance.
currencyCurrency code.
statusStatus value.

Outputs: none

<primus-account-dashboard>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
titlePrimary heading text.

Outputs: none

<primus-agent-directory>​

Inputs

InputDescription
agentsAgent list.
titlePrimary heading text.

Outputs: none

<primus-ai-copilot>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
endpointOverride endpoint for requests.
modeAI mode (complete or code-review).
placeholderInput placeholder text.
titlePrimary heading text.

Outputs

OutputDescription
stepSelectedEmits selected step index.
respondedEmits AI response.

<primus-button>​

Inputs

InputDescription
disabledDisable the control.
labelLabel text.
sizeSize variant.
typeType or category.
variantStyle variant.

Outputs

OutputDescription
clickedEmits click event.

<primus-checkout-form>​

Inputs

InputDescription
amountAmount value.
apiUrlBase API URL for network calls.
currencyCurrency code.
endpointOverride endpoint for requests.

Outputs

OutputDescription
failedEmits operation error.
onErrorEmits error string.
onSuccessEmits success response.
sessionCreatedEmits payment response.
submittedEmits form payload.

<primus-claim-status-tracker>​

Inputs

InputDescription
claimIdClaim identifier.
statusStatus value.
stepsStep definitions.

Outputs: none

<primus-claim-tracker>​

Inputs

InputDescription
claimIdClaim identifier.
statusStatus value.
stepsStep definitions.

Outputs: none

<primus-credit-card>​

Inputs

InputDescription
brandBrand name.
cardHolderCardholder name.
expiryExpiry date.
last4Last four digits.
variantStyle variant.

Outputs: none

<primus-credit-score-card>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
userIdUser identifier.

Outputs: none

<primus-dashboard>​

Inputs

InputDescription
titlePrimary heading text.
subtitleSecondary heading text.
statsDashboard stats data.
layoutLayout mode: default, sidebar-content, split, centered, full-width.
showHeaderToggle header block.
showFooterToggle footer block.
stickyHeaderSticky header.
stickyFooterSticky footer.
sidebarPositionSidebar position.
sidebarWidthSidebar width in px.
fullHeightStretch to full height.
maxWidthMax width for centered layout.
paddingInner padding in px.
headerHeightMinimum header height.

Outputs: none

<primus-dashboard-grid>​

Inputs

InputDescription
columnsColumn count.
gapGrid gap.
responsiveEnable responsive breakpoints.
breakpointsOverride responsive columns at breakpoints.

Outputs: none

<primus-data-table>​

Inputs

InputDescription
actionsAction renderer (string output).
columnsColumn configuration.
dataData payload.
emptyMessageEmpty state text.
loadingLoading state.
paginatedEnable client-side pagination.
pageSizePage size when paginated.
pageIndexCurrent page index.
rowKeyUnique key field for rows.
searchPlaceholderSearch input placeholder.
searchableEnable search box.
selectableEnable row selection.
selectedKeysSelected row keys.

Outputs

OutputDescription
onRowClickEmits row data on click.
onSelectionChangeEmits selected keys.
onPageChangeEmits page changes.
rowClickEmits row data on click.
pageChangeEmits page changes.
selectionChangeEmits selected keys.

<primus-activity-feed>​

Inputs

InputDescription
itemsActivity items.
maxItemsMaximum items to display.
showTimestampsToggle timestamp labels.
groupByDateGroup by date.
loadingLoading state.

Outputs: none

<primus-filter-bar>​

Inputs

InputDescription
filtersFilter configuration list.
activeFiltersCurrent filter values.

Outputs

OutputDescription
filterChangeEmits updated filters.

<primus-export-menu>​

Inputs

InputDescription
formatsExport format list.
includeChartsInclude charts toggle.
includeStatsInclude stats toggle.
includeTablesInclude tables toggle.

Outputs

OutputDescription
exportEmits export payload.

Inputs

InputDescription
placeholderPlaceholder text.
debounceDebounce delay in ms.
valueControlled value.
showSuggestionsToggle suggestions list.
suggestionsSuggestion list.

Outputs

OutputDescription
searchEmits search query.

<primus-date-range-picker>​

Inputs

InputDescription
startDateStart date value.
endDateEnd date value.
rangesPreset ranges.
minMinimum date.
maxMaximum date.
disabledDisable inputs.

Outputs

OutputDescription
rangeChangeEmits range changes.

<primus-line-chart> / <primus-area-chart> / <primus-bar-chart> / <primus-pie-chart> / <primus-sparkline>​

Inputs

InputDescription
labelsX-axis labels.
seriesSeries list.
dataChart.js data object override.
optionsChart.js options override.
heightChart height in px.
widthChart width in px.
legendToggle legend.
responsiveResponsive sizing.
maintainAspectRatioKeep aspect ratio.
ariaLabelAccessible label.

Outputs: none

<primus-date-picker>​

Inputs

InputDescription
disabledDisable the control.
errorError message.
hintHelper hint text.
idForm control id.
labelLabel text.
maxMaximum value.
minMinimum value.
nameForm field name.
placeholderInput placeholder text.
requiredMark field required.
valueSelected value (single date only).

Outputs

OutputDescription
valueChangeEmits when value changes.

<primus-document-viewer>​

Inputs

InputDescription
autoRenderAuto-render on init.
dataData payload.
documentDocument payload to preview.
formatRender format ("html" or "pdf").
pdfEndpointEndpoint for PDF render.
renderEndpointEndpoint for HTML render.
templateIdDocument template identifier.
titlePrimary heading text.

Outputs

OutputDescription
onCloseEmits when closed.
onDownloadEmits when download requested.
renderFailedEmits render error.
renderedEmits render response.

<primus-feature-flag-toggle>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
autoLoadAuto-load on init.
enabledCustom property.
flagKeyCustom property.
labelLabel text.

Outputs

OutputDescription
toggleFailedEmits toggle error.
toggledEmits flag state.

<primus-file-uploader>​

Inputs

InputDescription
acceptCustom property.
apiUrlBase API URL for network calls.
endpointOverride endpoint for requests.
inputIdCustom property.
multipleCustom property.
titlePrimary heading text.

Outputs

OutputDescription
failedEmits operation error.
onUploadCompleteEmits upload response.
uploadedEmits upload response.

<primus-form-field>​

Inputs

InputDescription
errorError message.
forIdLabel "for" id.
hintHelper hint text.
labelLabel text.
requiredMark field required.

Outputs: none

<primus-fraud-detection-dashboard>​

Inputs

InputDescription
alertsAlert list.
riskScoreRisk score value.
titlePrimary heading text.

Outputs: none

<primus-header>​

Inputs

InputDescription
breadcrumbsBreadcrumb items.
titlePrimary heading text.
userUser info.

Outputs

OutputDescription
onUserClickCustom property.

<primus-input>​

Inputs

InputDescription
disabledDisable the control.
errorError message.
hintHelper hint text.
idForm control id.
labelLabel text.
nameForm field name.
placeholderInput placeholder text.
requiredMark field required.
typeType or category.
valueDisplay value.

Outputs

OutputDescription
valueChangeEmits when value changes.

<primus-kyc-verification>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
userIdUser identifier.

Outputs: none

<primus-layout>​

Inputs

InputDescription
darkModeEnable dark mode (optional; follows PrimusThemeService when unset).
headerHeader content or toggle.
sidebarSidebar content or toggle.

Outputs: none

<primus-loan-calculator>​

Inputs

InputDescription
apiUrlBase API URL for network calls.

Outputs: none

<primus-log-viewer>​

Inputs

InputDescription
autoLoadAuto-load on init.
endpointOverride endpoint for requests.
entriesLog entries array.
queryLog query string.
titlePrimary heading text.

Outputs

OutputDescription
loadFailedCustom property.
loadedCustom property.

<primus-login>​

Inputs

InputDescription
authEndpointAuth base endpoint.
endpointOverride endpoint for requests.
logoLogo URL.
showEmailLoginShow email/password form.
socialProvidersEnabled social providers.
subtitleSecondary heading text.
themeTheme override.
titlePrimary heading text.
useServiceUse SDK service for API calls.

Outputs

OutputDescription
loggedInEmits auth response.
loginEmits login payload.
loginFailedEmits login error.
onLoginEmits login payload.
onSocialLoginEmits provider selection.

<primus-modal>​

Inputs

InputDescription
ariaLabelCustom property.
openOpen state.
sizeSize variant.
titlePrimary heading text.

Outputs

OutputDescription
closedEmits when closed.
onCloseEmits when closed.

<primus-notification-center>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
pollIntervalPolling interval in ms.
themeTheme override.
mockDataMock notification list.
useMockToggle mock mode.

Outputs: none

<primus-notification-feed>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
pollIntervalPolling interval in ms.
userIdUser identifier.

Outputs: none

<primus-rbac-admin>​

Inputs

InputDescription
apiUrlBase API URL (origin only).
titlePrimary heading text.
subtitleSecondary heading text.
defaultScopePre-fill scope fields (applicationId, tenantId, environment).
defaultPrincipalTypeDefault principal type (e.g., user).
defaultGroupTypeDefault group type (e.g., team).
showScopeFieldsToggle scope inputs.
withCredentialsInclude cookies + CSRF header for BFF auth.
showHeroShow the left hero panel (default: true).
heroBadgeHero badge label.
heroTitleHero headline text.
heroSubtitleHero supporting text.
heroItemsHero bullet list items.

Outputs: none

<primus-policy-card>​

Inputs

InputDescription
coverageCoverage value.
holderPolicy holder name.
policyNumberPolicy number.
premiumPremium amount.
statusStatus value.

Outputs: none

<primus-premium-calculator>​

Inputs

InputDescription
titlePrimary heading text.

Outputs: none

<primus-quote-comparison>​

Inputs

InputDescription
quotesQuote list.
titlePrimary heading text.

Outputs: none

<primus-radio-group>​

Inputs

InputDescription
disabledDisable the control.
errorError message.
hintHelper hint text.
inlineInline layout.
labelLabel text.
nameForm field name.
optionsOptions list.
requiredMark field required.
valueDisplay value.

Outputs

OutputDescription
valueChangeEmits when value changes.

<primus-section>​

Inputs

InputDescription
subtitleSecondary heading text.
titlePrimary heading text.

Outputs: none

<primus-security-dashboard>​

Inputs

InputDescription
apiUrlBase API URL for network calls.
autoLoadAuto-load on init.
listEndpointEndpoint override for list fetching.
scansCustom property.
titlePrimary heading text.
vulnerabilitiesCustom property.

Outputs: none

<primus-security-scan-panel>​

Inputs

InputDescription
autoLoadAuto-load on init.
listEndpointEndpoint override for list fetching.
scanEndpointEndpoint override for scan action.
scansCustom property.
targetCustom property.
titlePrimary heading text.

Outputs

OutputDescription
scanCompletedEmits scan result.
scanFailedEmits scan error.

<primus-select>​

Inputs

InputDescription
allowEmptyAllow empty selection.
disabledDisable the control.
errorError message.
hintHelper hint text.
idForm control id.
labelLabel text.
nameForm field name.
optionsOptions list.
placeholderInput placeholder text.
requiredMark field required.
valueDisplay value.
valueTypeCoerce emitted values (auto, string, number).

Outputs

OutputDescription
valueChangeEmits when value changes.
valueChangeStringEmits string-coerced changes.
valueChangeNumberEmits number-coerced changes.

<primus-sidebar>​

Inputs

InputDescription
activeIdActive navigation id.
itemsNavigation items (supports href, route, queryParams).
titlePrimary heading text.

Outputs

OutputDescription
onItemClickCustom property.

<primus-stats-card>​

Inputs

InputDescription
changeChange indicator object.
deltaDelta text for stats.
descriptionShort descriptive text.
helperHelper text below value.
labelLabel text.
titlePrimary heading text.
trendTrend direction.
trendDataTrend chart data points.
valueDisplay value.

Outputs: none

<primus-step>​

Inputs

InputDescription
descriptionShort descriptive text.
labelLabel text.
stateCustom property.

Outputs: none

<primus-stepper>​

Inputs

InputDescription
activeStepActive step index.
clickableAllow step clicks.
completedStepsCompleted step indices.
disabledStepsDisabled step indices.
errorStepsError step indices.
linearLinear progression mode.
orientationOrientation (horizontal/vertical).
stepsStep definitions.

Outputs

OutputDescription
stepSelectedCustom property.

<primus-summary-card>​

Inputs

InputDescription
actionLabelAction button label.
subtitleSecondary heading text.
titlePrimary heading text.

Outputs

OutputDescription
actionEmits when the action button is clicked.

<primus-textarea>​

Inputs

InputDescription
disabledDisable the control.
errorError message.
hintHelper hint text.
idForm control id.
labelLabel text.
maxLengthMaximum length.
nameForm field name.
placeholderInput placeholder text.
requiredMark field required.
rowsTextarea rows.
valueDisplay value.

Outputs

OutputDescription
backEmits when back is clicked.
nextEmits when next is clicked.
valueChangeEmits when value changes.

<primus-theme-toggle>​

Inputs

InputDescription
themeOptional controlled theme (light or dark).

Outputs

OutputDescription
themeChangeEmits theme changes.
toggledEmits after toggle.

<primus-toggle>​

Inputs

InputDescription
checkedChecked state.
descriptionShort descriptive text.
disabledDisable the control.
errorError message.
hintHelper hint text.
labelLabel text.

Outputs

OutputDescription
checkedChangeEmits when checked changes.

<primus-transaction-history>​

Inputs

InputDescription
transactionsTransaction list.

Outputs

OutputDescription
onTransactionClickEmits selected transaction id.
transactionClickEmits selected transaction id.

<primus-user-profile>​

Inputs

InputDescription
logoutEndpointLogout endpoint override.
showLogoutCustom property.
useServiceUse SDK service for API calls.
userUser info.

Outputs

OutputDescription
loggedOutEmits after logout.

<primus-wizard>​

Inputs

InputDescription
subtitleSecondary heading text.
titlePrimary heading text.

Outputs: none

<primus-wizard-nav>​

Inputs

InputDescription
alignAlignment.
backDisabledDisable back button.
backLabelBack button label.
backVariantBack button variant.
nextDisabledDisable next button.
nextLabelNext button label.
nextVariantNext button variant.
showBackShow back button.
showNextShow next button.

Outputs

OutputDescription
backCustom property.
nextCustom property.
Primus SaaS UI Components

@primus/ui-core is the zero-dependency base layer that powers all component styling. It provides design tokens, semantic HTML element styles, and Web Components (<primus-tabs>, <primus-dropdown>, toast API) that work in React, Angular, and plain HTML.

Add it once and all your HTML elements inherit the Primus purple brand palette automatically:

npm install @primus/ui-core

Full reference →