# Optimus UI Documentation Generated: 2026-07-28 --- # Guide Pages # Installation Setting up Optimus UI in an Angular CLI project. ## Download- Prefer to wire things up yourself? Install the packages from the npm registry directly. The next section covers the provider setup that ng add would have written for you. ## Examples- Every example in this documentation opens in StackBlitz from the code toolbar above each demo, already wired up with the current version. The source repository is the reference for how the library itself is built and consumed. ## Icons- Optimus UI components accept any icon through templating, so an icon library is optional. That said, every example in this documentation uses the pi pi-{icon} classes from OpenNG Icons , and component defaults such as the DatePicker arrows reference them too. Install it if you want the demos to look the way they do here. Then import the stylesheet, either from your global stylesheet or from the styles array in angular.json . ## Nextsteps- Once you have Optimus UI up and running, we recommend exploring the following resources to gain a deeper understanding of the library. Global configuration Styled mode and unstyled mode Tailwind CSS integration Pass Through for direct access to the underlying elements Philosophy — what this project promises, and what it does not FAQ ## Ngadd- The recommended way to add Optimus UI to an Angular CLI workspace is a single command. The schematic asks which theme preset you want and then does the rest: adds @openng/optimus-ui and @openng/optimus-ui-themes to your dependencies wires provideOptimus into your root providers with the chosen preset, in app.config.ts or your root NgModule installs the packages Pass the preset up front to skip the prompt, or skip the install step if you want to run it yourself: If the schematic cannot find a providers array to update it prints the three manual steps instead of guessing, so nothing in your workspace is rewritten unexpectedly. If it detects an existing primeng dependency it makes no changes at all and points you at the migration guide, which covers the migrate-from-primeng schematic. ## Prerequisites- Optimus UI targets Angular v21 and newer. Any workspace created with the Angular CLI works, standalone or NgModule based. Angular v21 or newer, including @angular/cdk , @angular/forms and @angular/router RxJS v7.8.1 or newer A package manager of your choice — npm, yarn or pnpm Already using PrimeNG? Do not follow this page. The migration guide covers moving an existing PrimeNG v21 workspace across, and the same ng add command detects that case for you. ## Provider- Add provideOptimus to the list of providers in your app.config.ts and use the theme property to configure a theme such as Aura. ```typescript import { ApplicationConfig } from '@angular/core'; import { provideOptimus } from '@openng/optimus-ui/config'; import Aura from '@openng/optimus-ui-themes/aura'; export const appConfig: ApplicationConfig = { providers: [ provideOptimus({ theme: { preset: Aura } }) ] }; ``` ## Verify- Verify your setup by adding a component such as Button. Each component can be imported and registered individually so that you only include what you use for bundle optimization. Import path is available in the documentation of the corresponding component. --- # Configuration Application wide configuration for Optimus UI. ## Csp- The nonce value to use on dynamically generated style elements in core. ```typescript provideOptimus({ csp: { nonce: '...' } }) ``` ## Dynamic- Inject the Optimus to your application to update the initial configuration at runtime. ```typescript import { Component, OnInit } from '@angular/core'; import { Optimus } from '@openng/optimus-ui/config'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent implements OnInit { constructor(private config: Optimus) {} ngOnInit() { this.config.ripple.set(true); } } ``` ## Filtermode- Default filter modes to display on DataTable filter menus. ```typescript import { OptimusConfig } from '@openng/optimus-ui/api'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent implements OnInit { constructor(private optimusConfig: OptimusConfig) {} ngOnInit() { optimusConfig.filterMatchModeOptions = { text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS], numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO], date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER] }; } } ``` ## Inputvariant- Input fields come in two styles, default is outlined with borders around the field whereas filled alternative adds a background color to the field. A theme such as Material may add more additional design changes per each variant. ## Api Locale Options ## Repository Ready to use settings for locales are available as the @openng/optimus-ui-locale package, maintained in the Optimus UI repository. We'd appreciate if you could contribute translations to the repository and share them with the rest of the community. ```typescript import { de } from '@openng/optimus-ui-locale/js/de.js'; provideOptimus({ translation: de }) ``` ## Runtime The translations can be changed dynamically at runtime, here is an example with ngx-translate. ```typescript import { Component, OnInit } from '@angular/core'; import { Optimus } from '@openng/optimus-ui/config'; import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent implements OnInit { constructor(private config: Optimus, private translateService: TranslateService) {} ngOnInit() { this.translateService.setDefaultLang('en'); } translate(lang: string) { this.translateService.use(lang); this.translateService.get('optimus').subscribe(res => this.config.setTranslation(res)); } } ``` ## Translation A translation is specified using the translation property during initialization. ```typescript provideOptimus({ translation: { accept: 'Aceptar', reject: 'Rechazar', //translations } }) ``` ## Overlayappendto- Defines the default location of the overlays; self refers to the host element and body targets the document body. Defaults to self . ## Provider- The initial configuration is defined by the provideOptimus provider during application startup. ```typescript import { ApplicationConfig } from '@angular/core'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideOptimus } from '@openng/optimus-ui/config'; export const appConfig: ApplicationConfig = { providers: [ provideAnimationsAsync(), provideOptimus({ /* options */ }) ] }; ``` ## Ripple- Ripple is an optional animation for the supported components such as buttons. It is disabled by default. ```typescript provideOptimus({ ripple: true }) ``` ## Theme- Optimus UI provides 4 predefined themes out of the box; Aura, Material, Lara and Nora. See the theming documentation for details. ```typescript import { ApplicationConfig } from '@angular/core'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideOptimus } from '@openng/optimus-ui/config'; import Aura from '@openng/optimus-ui-themes/aura'; export const appConfig: ApplicationConfig = { providers: [ provideAnimationsAsync(), provideOptimus({ theme: { preset: Aura, options: { prefix: 'p', darkModeSelector: 'system', cssLayer: false } } }) ] }; ``` ## Zindex- ZIndexes are managed automatically to make sure layering of overlay components work seamlessly when combining multiple components. Still there may be cases where you'd like to configure the configure default values such as a custom layout where header section is fixed. In a case like this, dropdown needs to be displayed below the application header but a modal dialog should be displayed above. Optimus UI configuration offers the zIndex property to customize the default values for components categories. Default values are described below and can be customized when setting up Optimus UI. ```typescript import { OptimusConfig } from '@openng/optimus-ui/api'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent implements OnInit { constructor(private optimusConfig: OptimusConfig) {} ngOnInit() { this.optimusConfig.zIndex = { modal: 1100, // dialog, sidebar overlay: 1000, // dropdown, overlaypanel menu: 1000, // overlay menus tooltip: 1100 // tooltip }; } } ``` --- # Styled Mode Choose from a variety of pre-styled themes or develop your own. ## Architecture- Optimus UI is a design agnostic library so unlike some other UI libraries it does not enforce a certain styling such as material design. Styling is decoupled from the components using the themes instead. A theme consists of two parts; base and preset . The base is the style rules with CSS variables as placeholders whereas the preset is a set of design tokens to feed a base by mapping the tokens to CSS variables. A base may be configured with different presets, currently Aura, Material, Lara and Nora are the available built-in options. The core of the styled mode architecture is based on a concept named design token , a preset defines the token configuration in 3 tiers; primitive , semantic and component . Primitive Tokens Primitive tokens have no context, a color palette is a good example for a primitive token such as blue-50 to blue-900 . A token named blue-500 may be used as the primary color, the background of a message however on its own, the name of the token does not indicate context. Usually they are utilized by the semantic tokens. Semantic Tokens Semantic tokens define content and their names indicate where they are utilized, a well known example of a semantic token is the primary.color . Semantic tokens map to primitive tokens or other semantic tokens. The colorScheme token group is a special variable to define tokens based on the color scheme active in the application, this allows defining different tokens based on the color scheme like dark mode. Component Tokens Component tokens are isolated tokens per component such as inputtext.background or button.color that map to the semantic tokens. As an example, button.background component token maps to the primary.color semantic token which maps to the green.500 primitive token. Best Practices Use primitive tokens when defining the core color palette and semantic tokens to specify the common design elements such as focus ring, primary colors and surfaces. Components tokens should only be used when customizing a specific component. By defining your own design tokens as a custom preset, you'll be able to define your own style without touching CSS. Overriding the Optimus UI components using style classes is not a best practice and should be the last resort, design tokens are the suggested approach. ## Bootstrap- Bootstrap has a reboot utility to reset the CSS of the standard elements. If you are including this utility, you may give it a layer while importing it. ## Colors- Color palette of a preset is defined by the primitive design token group. You can access colors using CSS variables or the $dt utility. @for (color of colors; track color) { {{ color }} @for (shade of shades; track shade) { {{ shade }} } } ## Colorscheme- A token can be defined per color scheme using light and dark properties of the colorScheme property. Each token can have specific values based on the current color scheme. Common Pitfall When customizing an existing preset, your token overrides may be ignored if you don't properly account for color scheme variations. If the original preset defines a token using the colorScheme property, but your customization only provides a direct value, your override will be ignored because the colorScheme property takes precedence over direct values and the system will continue using the preset's scheme-specific values. When customizing tokens that are not defined with colorScheme in the original preset, your customizations will be applied successfully regardless of how you structure them; whether direct or under colorScheme. Best Practices Check how tokens are defined in the preset before customizing from the source . Always maintain the same structure (direct value or colorScheme) as the original preset. Consider both light and dark mode values when overriding scheme-dependent tokens. This approach ensures your customizations will be applied correctly regardless of the user's selected color scheme. ## Component- The design tokens of a specific component is defined at components layer. Overriding components tokens is not the recommended approach if you are building your own style, building your own preset should be preferred instead. This configuration is global and applies to all card components, in case you need to customize a particular component on a page locally, view the Scoped CSS section for an example. ## Darkmode- Optimus UI uses the system as the default darkModeSelector in theme configuration. If you have a dark mode switch in your application, set the darkModeSelector to the selector you utilize such as .my-app-dark so that Optimus UI can fit in seamlessly with your color scheme. Following is a very basic example implementation of a dark mode switch, you may extend it further by involving prefers-color-scheme to retrieve it from the system initially and use localStorage to make it stateful. See this article for more information. In case you prefer to use dark mode all the time, apply the darkModeSelector initially and never change it. It is also possible to disable dark mode completely using false or none as the value of the selector. ## Definepreset- The definePreset utility is used to customize an existing preset during the Optimus UI setup. The first parameter is the preset to customize and the second is the design tokens to override. ## Dt- The $dt function returns the information about a token like the full path and value. This would be useful if you need to access tokens programmatically. ## Extend- The theming system can be extended by adding custom design tokens and additional styles. This feature provides a high degree of customization, allowing you to adjust styles according to your needs, as you are not limited to the default tokens. The example preset configuration adds a new accent button with custom button.accent.color and button.accent.inverse.color tokens. It is also possible to add tokens globally to share them within the components. ## Focusring- Focus ring defines the outline width, style, color and offset. Let's use a thicker ring with the primary color for the outline. ## Font- There is no design for fonts as UI components inherit their font settings from the application. ## Forms- The design tokens of the form input components are derived from the form.field token group. This customization example changes border color to primary on hover. Any component that depends on this semantic token such as dropdown.hover.border.color and textarea.hover.border.color would receive the change. ## Libraries- Example layer configuration for the popular CSS libraries. ## Noir- The noir mode is the nickname of a variant that uses surface tones as the primary and requires and additional colorScheme configuration to implement. A sample preset configuration with black and white variants as the primary color; ## Options- The options property defines the how the CSS would be generated from the design tokens of the preset. prefix The prefix of the CSS variables, defaults to p . For instance, the primary.color design token would be var(--p-primary-color) . darkModeSelector The CSS rule to encapsulate the CSS variables of the dark mode, the default is the system to generate {{ '@' }}media (prefers-color-scheme: dark) . If you need to make the dark mode toggleable based on the user selection define a class selector such as .app-dark and toggle this class at the document root. See the dark mode toggle section for an example. cssLayer Defines whether the styles should be defined inside a CSS layer by default or not. A CSS layer would be handy to declare a custom cascade layer for easier customization if necessary. The default is false . ## Palette- Returns shades and tints of a given color from 50 to 950 as an array. ## Presets- Aura, Material, Lara and Nora are the available built-in options, created to demonstrate the power of the design-agnostic theming. Aura is PrimeTek's own vision, Material follows Google Material Design v2, Lara is based on Bootstrap and Nora is inspired by enterprise applications. Visit the source code to learn more about the structure of presets. You may use them out of the box with modifications or utilize them as reference in case you need to build your own presets from scratch. ## Primary- The primary defines the main color palette, default value maps to the emerald primitive token. Let's setup to use indigo instead. ## Reset- In case Optimus UI components have visual issues in your application, a Reset CSS may be the culprit. CSS layers would be an efficient solution that involves enabling the Optimus UI layer, wrapping the Reset CSS in another layer and defining the layer order. This way, your Reset CSS does not get in the way of Optimus UI components. ## Scale- Optimus UI UI component use rem units, 1rem equals to the font size of the html element which is 16px by default. Use the root font-size to adjust the size of the components globally. This website uses 14px as the base so it may differ from your application if your base font size is different. ## Scopedtokens- Design tokens can be scoped to a certain component using the dt property. In this example, first switch uses the global tokens whereas second one overrides the global with its own tokens. This approach is recommended over the ::ng-deep as it offers a cleaner API while avoiding the hassle of CSS rule overrides. ## Specificity- The @layer is a standard CSS feature to define cascade layers for a customizable order of precedence. If you need to become more familiar with layers, visit the documentation at MDN to begin with. The cssLayer is disabled by default, when it is enabled at theme configuration, Optimus UI wraps the built-in style classes under the optimus cascade layer to make the library styles easy to override. CSS in your app without a layer has the highest CSS specificity, so you'll be able to override styles regardless of the location or how strong a class is written. ## Surface- The color scheme palette that varies between light and dark modes is specified with the surface tokens. Example below uses zinc for light mode and slategray for dark mode. With this setting, light mode, would have a grayscale tone and dark mode would include bluish tone. ## Theme- The theme property is used to customize the initial theme. ```typescript import { ApplicationConfig } from '@angular/core'; import { provideOptimus } from '@openng/optimus-ui/config'; import Aura from '@openng/optimus-ui-themes/aura'; export const appConfig: ApplicationConfig = { providers: [ provideOptimus({ theme: { preset: Aura } }) ] }; ``` ## Updatepreset- Merges the provided tokens to the current preset, an example would be changing the primary color palette dynamically. ## Updateprimarypalette- Updates the primary colors, this is a shorthand to do the same update using updatePreset . ## Updatesurfacepalette- Updates the surface colors, this is a shorthand to do the same update using updatePreset . ## Usepreset- Replaces the current presets entirely, common use case is changing the preset dynamically at runtime. --- # Unstyled Mode Theming Optimus UI with alternative styling approaches. ## Architecture- The term unstyled is used to define an alternative styling approach instead of the default theming with design tokens. In unstyled mode the css variables of the design tokens and the css rule sets that utilize them are not included. Here is an example of an Unstyled Select, the core functionality and accessibility is provided whereas styling is not included. ## Example- Unstyled components require styling using your preferred approach. We recommend using Tailwind CSS with PassThrough attributes, a combination that works seamlessly together. The @openng/optimus-ui-tailwindcss even provides special variants such as p-outlined: , p-vertical for the Optimus UI components. The example below demonstrates how to style a button component with Tailwind CSS using PassThrough attributes. Before you begin, refer to the pass through section in the button documentation to familiarize yourself with the component's internal structure and PassThrough attributes. In this example, we'll target the root , label and icon elements to apply custom styles. ## Global- A global configuration can be created at application level to avoid repetition via the global pt option so that the styles can be shared from a single location. A particular component can still override a global configuration with its own pt property. ```typescript import { ApplicationConfig } from '@angular/core'; export const appConfig: ApplicationConfig = { providers: [ provideOptimus({ unstyled: true, pt: { button: { root: 'bg-teal-500 hover:bg-teal-700 active:bg-teal-900 cursor-pointer py-2 px-4 rounded-full border-0 flex gap-2', label: 'text-white font-bold text-lg', icon: 'text-white !text-xl' } } }) ] }; ``` ## Setup- Unstyled mode is enabled for the whole suite by enabling unstyled option during Optimus UI installation. Alternatively even in the default styled mode, a particular component can still be used as unstyled by adding the unstyled prop of the component. --- # Icons OpenNG Icons is the default icon library of Optimus UI with over 250 open source icons. ## Basic- OpenNG Icons use the pi pi-{icon} syntax such as pi pi-check . A standalone icon can be displayed using an element such as i or span ## Color- Icon color is defined with the color property which is inherited from parent by default. ## Constants- Constants API is available to reference icons easily when used programmatically. ```typescript import { Component } from '@angular/core'; import { OpenngIcons, MenuItem } from '@openng/optimus-ui/api'; @Component({ selector: 'openng-icons-constants-demo', templateUrl: './openng-icons-constants-demo.html' }) export class OpenngIconsConstantsDemo { items: MenuItem[]; ngOnInit() { this.items = [ { label: 'New', icon: OpenngIcons.PLUS, }, { label: 'Delete', icon: OpenngIcons.TRASH } ]; } } ``` ## Download- The icon library is available at npm, run the following command to download it to your project. ## Import- CSS file of the icon library needs to be imported in styles.scss of your application. ## List- Here is the full list of icons. More icons will be added periodically and you may also request new icons at the issue tracker. ## Size- Size of an icon is controlled with the font-size property of the element. ## Spin- Special pi-spin class applies infinite rotation to an icon. --- # Custom Icons Use custom icons with Optimus UI components. ## Fontawesome- Font Awesome is a popular icon library with a wide range of icons. ## Image- Any type of image can be used as an icon. ## Material- Material icons is the official icon library based on Google Material Design. ## Svg- Inline SVGs are embedded inside the dom. --- # Pass Through Pass Through Props allow direct access to the underlying elements for complete customization. ## Basic- Each component has a special pt property to define an object with keys corresponding to the available DOM elements. Each value can either be a string, an object or a function that returns a string or an object to define the arbitrary properties to apply to the element such as styling, aria, data-* or custom attributes. If the value is a string or a function that returns a string, it is considered as a class definition and added to the class attribute of the element. Every component documentation has a dedicated section to document the available section names exposed via PT. ## Global- PassThrough object can also be defined at a global level to apply all components in an application using the provideOptimus provider. For example, with the configuration here all panel headers have the bg-primary style class and all autocomplete components have a fixed width. These settings can be overridden by a particular component as components pt property has higher precedence over global pt by default. ## Instance- In cases where you need to access the UI Component instance, define a component passthrough type that exposes the component instance or a function that receives a PassThroughContext as parameter. ## Introduction- In traditional 3rd party UI libraries, users are limited to the API provided by component author. This API commonly consists of inputs, outputs, and content projection. Whenever a requirement emerges for a new customization option in the API, the component author needs to develop and publish it with a new release. The pass through feature is a key element to implement this vision by exposing the component internals in order to apply arbitrary attributes and listeners to the DOM elements. The primary advantage of this approach is that it frees you from being restricted by the main component API. We recommend considering the pass-through feature whenever you need to tailor a component that lacks a built-in feature for your specific requirement. Each component has a special pt property to define an object with keys corresponding to the available DOM elements. A value of a key can either be a string, an object or a function to define the arbitrary properties such as styling, aria, data-* or custom attributes for the element. If the value is a string or a function that returns a string, it serves as a shorthand for a style class definition. Every component documentation has a dedicated segment to document the available section names in the interactive PT Viewer. Panel Example In this example, a Panel is customized with various options through pt . The styling is overriden with Tailwind CSS and header receives custom attributes along with a click event. The attributes passed to the header are not available in the component API, thanks to PassThrough feature, this is no longer an issue as you are not limited to the component api. Note that, you may avoid the ! based overrides in Tailwind classes if you setup CSS Layers with Optimus UI. Visit the Override section at Tailwind integration for examples. ## Lifecycle- Lifecycle hooks of components are exposed as pass through using the hooks property so that callback functions can be registered. Available callbacks are onBeforeInit , onInit , onChanges , onDoCheck , onAfterContentInit , onAfterContentChecked , onAfterViewInit , onAfterViewChecked and onDestroy . Refer to the Angular documentation for detailed information about lifecycle hooks. ## Pcprefix- A UI component may also use other UI components, in this case section names are prefixed with pc (Prime Component) to denote the Optimus UI component begin used. This distinguishes components from standard DOM elements and indicating the necessity for a nested structure. For example, the badge section is identified as pcBadge because the button component incorporates the badge component internally. ## Ptoptions- The ⁠ptOptions property determines how a component's local PassThrough configuration merges with the global PT configuration, as demonstrated in the following examples using both global and component-level settings. The mergeSections defines whether the sections from the main configuration gets added and the mergeProps controls whether to override or merge the defined props. Defaults are true for mergeSections and false for mergeProps . Global Configuration mergeSections: true, mergeProps: false (default) mergeSections: true, mergeProps: true mergeSections: false, mergeProps: true mergeSections: false, mergeProps: false --- # Tailwind CSS Integration between Optimus UI and Tailwind CSS. ## Animations- The plugin also adds extended animation utilities that can be used with the styleclass and animateonscroll directives. ## Colorpalette- Optimus UI color palette as utility classes. ## Darkmode- In styled mode, Optimus UI uses the system as the default darkModeSelector in theme configuration. If you have a dark mode switch in your application, ensure that darkModeSelector is aligned with the Tailwind dark variant for seamless integration. Note that, this particular configuration isn't required if you're utilizing the default system color scheme. Suppose that, the darkModeSelector is set as my-app-dark in Optimus UI. Tailwind v4 Add a custom variant for dark with a custom selector. Tailwind v3 Use the plugins option in your Tailwind config file to configure the plugin. ## Extensions- The plugin extends the default configuration with a new set of utilities. All variants and breakpoints are supported e.g. dark:sm:hover:bg-primary . Color Palette Class Property primary-[50-950] Primary color palette. surface-[0-950] Surface color palette. primary Default primary color. primary-contrast Default primary contrast color. primary-emphasis Default primary emphasis color. border-surface Default primary emphasis color. bg-emphasis Emphasis background e.g. hovered element. bg-highlight Highlight background. bg-highlight-emphasis Highlight background with emphasis. rounded-border Border radius. text-color Text color with emphasis. text-color-emphasis Default primary emphasis color. text-muted-color Secondary text color. text-muted-color-emphasis Secondary text color with emphasis. ## Form- Using Tailwind utilities for the responsive layout of a form with Optimus UI components. ## Headless- A headless Optimus UI dialog with a custom UI. ## Override- Tailwind utilities may not be able to override the default styling of components due to css specificity, there are two possible solutions; Import and CSS Layer. Important Use the ! as a prefix to enforce the styling. This is not the recommend approach, and should be used as last resort to avoid adding unnecessary style classes to your bundle. Tailwind v4 Tailwind v3 CSS Layer CSS Layer provides control over the css specificity so that Tailwind utilities can safely override components. Tailwind v4 Ensure optimus layer is after theme and base , but before the other Tailwind layers such as utilities . No change in the CSS configuration is required. Tailwind v3 The optimus layer should be between base and utilities. Tailwind v3 does not use native layer so needs to be defined with CSS. ## Overview- Tailwind CSS is a popular CSS framework based on a utility-first design. The core provides flexible CSS classes with predefined CSS rules to build your own UI elements. For example, instead of an opinionated btn class as in Bootstrap, Tailwind offers primitive classes like bg-blue-500 , rounded and p-4 to apply a button. A set of reusable classes can also be grouped as a Tailwind CSS component and there are even a couple of libraries that take this approach to build components specifically for Tailwind. Tailwind is an outstanding CSS library, however it lacks a true comprehensive UI suite when combined with Angular, this is where Optimus UI comes in by providing a wide range of highly accessible and feature rich UI component library. The core of Optimus UI does not depend on Tailwind CSS. ## Plugin- The @openng/optimus-ui-tailwindcss is a plugin to provide first class integration between Optimus UI and Tailwind CSS. It is designed to work both in styled and unstyled modes. In styled mode, for instance the semantic colors such as primary and surfaces are provided as Tailwind utilities e.g. bg-primary , text-surface-500 , text-muted-color . If you haven't already done so, start by integrating Tailwind into your project. Detailed steps for this process can be found in the Tailwind documentation . After successfully installing Tailwind, proceed with the installation of the OptimusUiTailwind plugin. This single npm package comes with two libraries: the CSS version is compatible with Tailwind v4, while the JS version is designed for Tailwind v3. Tailwind v4 In the CSS file that contains the tailwindcss import, add the @openng/optimus-ui-tailwindcss import as well. For a comprehensive starter guide, review the Optimus UI repository which demonstrates the integration. Tailwind v3 Use the plugins option in your Tailwind config file to configure the plugin. --- # LLMs.txt LLM-optimized documentation endpoints for Optimus UI components. ## Llmsfulltxt- The llms-full.txt file is a complete list of all the pages in the Optimus UI documentation. It is used to help AI models understand the entire documentation set. ## Llmstxt- The llms.txt file is an industry standard that helps AI models better understand and navigate the Optimus UI documentation. It lists key pages in a structured format, making it easier for LLMs to retrieve relevant information. ## Markdownextension- Add a .md to a page's URL to display a Markdown version of that page. --- # Accessibility Optimus UI has WCAG 2.1 AA level compliance. ## Colors- Colors on a web page should aim a contrast ratio of at least 4.5:1 and consider a selection of colors that do not cause vibration. Good Contrast Color contrast between the background and the foreground content should be sufficient enough to ensure readability. Example below displays two cases with good and bad samples. GOOD BAD Vibration Color vibration is leads to an illusion of motion due to choosing colors that have low visibility against each other. Color combinations need to be picked with caution to avoid vibration. VIBRATE Dark Mode Highly saturated colors should be avoided when used within a dark design scheme as they cause eye strain. Instead desaturated colors should be preferred. Indigo 500 Indigo 200 ## Formcontrols- Native form elements should be preferred instead of elements that are meant for other purposes like presentation. As an example, button below is rendered as a form control by the browser, can receive focus via tabbing and can be used with space key as well to trigger. On the other hand, a fancy css based button using a div has no keyboard or screen reader support. tabindex is required to make a div element accessible in addition to use a keydown to bring the keyboard support back. To avoid the overload and implementing functionality that is already provided by the browser, native form controls should be preferred. Relations Form components must be related to another element that describes what the form element is used for. This is usually achieved with the label element. ## Introduction- According to the World Health Organization, 15% of the world population has a disability to some degree. As a result, accessibility features in any context such as a ramp for wheelchair users or a multimedia with captions are crucial to ensure content can be consumed by anyone. Disabilities Types of disabilities are diverse so you need to know your audience well and how they interact with the content created. There four main categories; Visual Impairments Blindness, low-level vision or color blindness are the common types of visual impairments. Screen magnifiers and the color blind mode are usually built-in features of the browsers whereas for people who rely on screen readers, page developers are required to make sure content is readable by the readers. Popular readers are NVDA , JAWS and ChromeVox . Hearing Impairments Deafness or hearing loss refers to the inability to hear sounds totally or partially. People with hearing impairments use assistive devices however it may not be enough when interacting with a web page. Common implementation is providing textual alternatives, transcripts and captions for content with audio. Mobility Impairments People with mobility impairments have disabilities related to movement due to loss of a limb, paralysis or other varying reasons. Assistive technologies like a head pointer is a device to interact with a screen whereas keyboard or a trackpad remain as solutions for people who are not able to utilize a mouse. Cognitive Impairments Cognitive impairments have a wider range that includes people with learning disabilities, depression and dyslexia. A well designed content also leads to better user experience for people without disabilities so designing for cognitive impairments result in better design for any user. ## Semantichtml- HTML offers various element to organize content on a web page that screen readers are aware of. Preferring Semantic HTML for good semantics provide out of the box support for reader which is not possible when regular div elements with classes are used. Consider the following example that do not mean too much for readers. Same layout can be achieved using the semantic elements with screen reader support built-in. ## Waiaria- ARIA refers to "Accessible Rich Internet Applications" is a suite to fill the gap where semantic HTML is inadequate. These cases are mainly related to rich UI components/widgets. Although browser support for rich UI components such as a datepicker or colorpicker has been improved over the past years many web developers still utilize UI components derived from standard HTML elements created by them or by other projects like Optimus UI. These types of components must provide keyboard and screen reader support, the latter case is where the WAI-ARIA is utilized. ARIA consists of roles, properties and attributes. Roles define what the element is mainly used for e.g. checkbox , dialog , tablist whereas States and Properties define the metadata of the element like aria-checked , aria-disabled . Consider the following case of a native checkbox. It has built-in keyboard and screen reader support. A fancy checkbox with css animations might look more appealing but accessibility might be lacking. Checkbox below may display a checked font icon with animations however it is not tabbable, cannot be checked with space key and cannot be read by a reader. One alternative is using ARIA roles for readers and use javascript for keyboard support. Notice the usage of aria-labelledby as a replacement of the label tag with for. However the best practice is combining semantic HTML for accessibility while keeping the design for UX. This approach involves hiding a native checkbox for accessibility and using javascript events to update its state. Notice the usage of p-sr-only that hides the elements from the user but not from the screen reader. A working sample is the Optimus UI checkbox that is tabbable, keyboard accessible and is compliant with a screen reader. Instead of ARIA roles it relies on a hidden native checkbox. Remember Me ## Wcag- WCAG refers to Web Content Accessibility Guideline , a standard managed by the WAI (Web Accessibility Initiative) of W3C (World Wide Web Consortium). WCAG consists of recommendations for making the web content more accessible. Optimus UI components aim high level of WCAG compliancy in the near future. Various countries around the globe have governmental policies regarding web accessibility as well. Most well known of these are Section 508 in the US and Web Accessibility Directive of the European Union. --- # Animations Built-in CSS animations for Optimus UI components. ## Anchoredoverlays- Anchored overlays are the components that have a floating ui positioned relatively to another element such as Select, Popover. The enter and leave animations are defined with the .p-anchored-overlay-enter-active and .p-anchored-overlay-leave-active classes. ## Collapsibles- Collapsible components have a content that is toggleable including Accordion, Panel, Fieldset, Stepper and PanelMenu. The enter and leave animations are defined with the .p-collapsible-enter-active and .p-collapsible-leave-active classes. Header I Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Header II Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi. Header III Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi. ## Dialog- Overlays such as Dialog and Drawer are positioned relative to the viewport and have their own animations. Update your information. Username Email ## Disable- Individual animations can be reduced and even disabled completely using the animation duration. ## Introduction- Various Optimus UI Components utilize native CSS animations to provide an enhanced user experience. The default animations are based on the best practices recommended by the usability experts. In case you need to customize the default animations, this documentation covers the entire set of built-in animations. Animations are defined using a combination of style classes and keyframes. The ⁠ .{classname}-enter-active and ⁠ .{classname}-leave-active classes specify the animation name, duration, and easing function. You can customize animations globally by overriding the default animation classes, affecting all components. Alternatively, you can apply scoped classes to individual components to modify their animations independently. For demo purposes, this second approach is used throughout the next sections. ## Reference- List of class names of the CSS animations used by the components. Component Enter Class Leave Class Accordion .p-collapsible-enter-active .p-collapsible-leave-active AutoComplete .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active CascadeSelect .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active ColorPicker .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active ConfirmPopup .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active ContextMenu .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active DatePicker .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active Dialog .p-dialog-enter-active .p-dialog-leave-active Drawer .p-drawer-enter-active .p-drawer-leave-active Fieldset .p-collapsible-enter-active .p-collapsible-leave-active Galleria .p-galleria-enter-active .p-galleria-leave-active Image .p-image-original-enter-active .p-image-original-leave-active Menu .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active Message .p-message-enter-active .p-message-leave-active Modal Masks .p-overlay-mask-enter-active .p-overlay-mask-leave-active MultiSelect .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active Panel .p-collapsible-enter-active .p-collapsible-leave-active PanelMenu .p-collapsible-enter-active .p-collapsible-leave-active Password .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active Select .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active Stepper .p-collapsible-enter-active .p-collapsible-leave-active TieredMenu .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active Toast .p-toast-message-enter-active .p-toast-message-leave-active TreeSelect .p-anchored-overlay-enter-active .p-anchored-overlay-leave-active --- # RTL Right-to-left support for Optimus UI components. ## Configuration- The Optimus UI components natively support Right-to-Left (RTL) text direction through a modern CSS implementation utilizing FlexBox and classes like *-inline-start and *-block-end . Consequently, no JavaScript configuration is necessary; setting the document's text direction to RTL is sufficient to enable this feature. The RTL setting can either be set using the dir attribute or with the direction style property. ## Limitations- RTL is widely supported by the UI suite except the Galleria and Carousel components. These components will be enhanced with a modern implementation in upcoming versions with built-in support for RTL. --- # PrimeFlex Moving from PrimeFlex to Tailwind CSS. ## Compatibility- If you are staying on PrimeFlex for now, Optimus UI v1 pairs with PrimeFlex v4 — the same combination that worked with PrimeNG v18 and newer, since the styling architecture is unchanged. PrimeFlex v3 targeted the older PrimeNG releases and is not a supported pairing here. Neither version is tested against Optimus UI releases, so treat this as "should work", not as a supported configuration. The migration below is the path we actually maintain. ## Migration- PrimeFlex class names map closely onto Tailwind's, so most of the work is mechanical. PrimeTek's primeclt ships a pf2tw command that does the conversion, and it works on any codebase — it rewrites class names and does not care which component library you use. Run pf2tw in a directory containing the files to convert. A handful of PrimeFlex classes have no Tailwind counterpart and are left alone. Replace them with flexbox or grid utilities by hand: formgrid formgroup formgroup-inline col col-fixed field field-checkbox field-radiobutton reset ## Overview- PrimeFlex was PrimeTek's lightweight CSS utility library, designed to accompany PrimeNG. PrimeTek stopped maintaining it before the relicensing, on the grounds that most applications already bring their own utility layer — Tailwind, Bootstrap or something in-house — and a second one only overlaps with it. Optimus UI does not maintain PrimeFlex either, and for the same reason. Nothing in this library depends on it, and no component requires it. If your application already uses PrimeFlex it will keep working, but it will not receive updates from us, and we suggest moving to Tailwind CSS. ## Tailwindcss- Tailwind CSS is the replacement we suggest. This documentation site is itself built with it, and we publish @openng/optimus-ui-tailwindcss for first-class integration — a plugin that teaches Tailwind about the theme's design tokens and puts the component styles in a cascade layer you can override cleanly. See the Tailwind CSS guide for setup with either Tailwind v3 or v4, and the next section for converting existing PrimeFlex classes. --- # Philosophy Why Optimus UI exists, what it commits to, and where it stops. ## Governance- Everything happens in the open, in the repository . There is no private roadmap and no internal issue tracker. What you see in the issues, the discussions and the roadmap is the whole plan. Contributors earn commit access by contributing — the contribution guide describes the Contributor and Committer roles and roughly what it takes to reach them. We would rather grow the number of people who can merge a fix than route everything through one person. Breaking changes are avoided within a major and documented when a major requires them. Where we inherited a name that no longer fits — the CSS cascade layer, the package scope, the icon library — we changed it once, at v1, with a migration schematic, rather than dripping renames across releases. ## Limits- Naming the limits is what makes the commitments above worth anything. Here is what Optimus UI is not. There is no commercial support No SLA, no support contract, no guaranteed response time. Issues and discussions are answered by volunteers when they have time. If your organisation needs contractual guarantees, this project cannot provide them and you should plan accordingly. There are no premium templates, blocks or design tooling PrimeTek's application templates, block library and visual theme designer are their commercial products. They are not part of what was MIT licensed, so they are not part of this fork and will not be reimplemented. Theming here means editing preset objects in code, which is documented in full. We are not chasing feature parity with PrimeNG v22 and beyond PrimeNG continues under its own license and its own roadmap. Optimus UI diverges from v21 forward. Some things they add, we will not have. Some things we fix, they will not. Treat the two as separate libraries that share an ancestor, not as a free copy of a paid product. The bus factor is real This is maintained by a small group of people in their own time. We would rather say that plainly than imply a larger organisation stands behind it. The best way to change that number is to contribute . ## Origin- In June 2026 PrimeTek archived the PrimeNG repository and moved future major versions, starting with v22, to a commercial license. They explained their reasoning in their own announcement , and it is worth reading. Maintaining a component library of this size for a decade, largely for free, is genuinely hard, and we do not think the decision was made lightly. It did, however, leave a lot of applications on a library with no further open source releases. Optimus UI exists for those applications. It is a community fork of the last MIT licensed version of PrimeNG, v21, and it stays MIT. This is not an official fork and it is not endorsed by PrimeTek. It is a separate repository, seeded with PrimeNG's code and history, maintained by people who depend on it. ## Promises- Four commitments, in the order we would want to read them if we were choosing a dependency: MIT, with no second tier Every package we publish is MIT licensed. There is no paid edition, no enterprise build, no feature held back behind a subscription, and no plan to introduce one. If that ever changed, it would be a fork of this project rather than a relicensing of it, because the code we inherited is MIT and so is everything we add to it. We track Angular Our release cadence follows Angular's. When a new Angular major lands, the priority is a compatible Optimus UI major — before new features, before refactors. Staying upgradeable is the single most valuable thing a component library can do for the applications built on it. Bugs before features We inherited a large backlog along with the code. Fixing what is broken ranks above adding what is missing. Feature requests are triaged and welcome, but they generally ship when someone in the community implements them. No surprises in your bundle The library sends no telemetry, phones no home, and requires no account or key to use. What you install is what runs. ## Sustainability- The honest answer to "how is this funded" is: it mostly is not. OpenNG covers the hosting and the domain; the work is volunteered. That is a fragile arrangement, and it is the main risk to this project — larger than any technical risk we can see today. The things that actually help, roughly in order of impact: Reproducing and triaging issues. A bug with a minimal reproduction is several times more likely to get fixed. Sending pull requests, especially for issues labelled help-needed . Answering questions in discussions, so the same answer is not written five times. Improving this documentation. Every page has a source file and every fix is welcome. Telling your employer you depend on it. Sponsored maintenance time is worth more than any one-off donation. The contribution guide covers how to get started. ## Trademark- Optimus UI is not affiliated with, endorsed by, or sponsored by PrimeTek. PrimeNG, PrimeFaces, PrimeReact, PrimeVue and PrimeFlex are their trademarks. The rename from the inherited names — the packages, the CSS layer, the icon library — is a trademark matter, not a technical one, and it is why ng add ships a migration schematic rather than asking you to rewrite imports by hand. References to PrimeNG remain throughout this documentation and the source, and they are deliberate. Attribution is the point: this library is PrimeTek's decade of work plus whatever the community adds on top. Pretending otherwise would be both dishonest and useless to anyone trying to find their way around a familiar API. The code we forked was published under the MIT license, and we distribute it under those same terms, with the original copyright notices intact. --- # FAQ Licensing, migration from PrimeNG, the ecosystem, and how support works. ## Ecosystem- Do the PrimeNG themes work? The built-in presets do — Aura, Material, Lara and Nora ship in @openng/optimus-ui-themes and are configured the same way. A preset you wrote yourself against PrimeNG v21 will work after the import paths are updated, which the migration schematic handles. What about the Theme Designer, templates and blocks? Those are PrimeTek's commercial products. They were never MIT licensed, so they are not part of this fork and we will not be reimplementing them. Theming in Optimus UI means editing preset objects in code, which is documented in full under styled mode . What replaced PrimeIcons? OpenNG Icons , installed as @openng/icons . The pi pi-{icon} class names are unchanged, so templates do not need editing — only the package name and the stylesheet import, both of which the migration schematic rewrites. What about PrimeFlex? PrimeFlex is not maintained here. We suggest Tailwind CSS instead, and ship @openng/optimus-ui-tailwindcss for first-class integration — see the Tailwind guide . The PrimeFlex guide covers moving across. Does Optimus UI work with SSR? This documentation site is itself an Angular SSR application built on Optimus UI, prerendered at build time. So yes, and any regression there tends to be noticed quickly. ## Migration- Which Angular versions are supported? Angular v21 and newer. Our majors follow Angular's — when a new Angular major ships, a compatible Optimus UI major is the first thing we work on. How do I migrate from PrimeNG? Is it automatic? Mostly. Run ng add @openng/optimus-ui in a PrimeNG v21 workspace and it detects the existing dependency and runs the full migration: packages swapped, imports rewritten, dependencies installed. It then prints a report of anything it could not rewrite, with file and line numbers. The migration guide covers the details and the manual cases. I am on PrimeNG v20 or older. Can I migrate directly? No. Upgrade to PrimeNG v21 first, using PrimeNG's own migration guides, then run the schematic. The schematic checks the version and refuses rather than producing a half-migrated workspace. What happens to my PrimeNG license? Nothing — it is unrelated. A PrimeNG v22 commercial license covers PrimeNG. Optimus UI needs no license at all. If you hold a PrimeTek subscription for their templates or theme designer, those remain their products and do not carry over here. I had an open PR on primefaces/primeng. Can I bring it here? Yes, and we would like you to. Append .patch to your original pull request URL and apply it with git am — the contributing guide in the repository walks through it, including what to do when the patch no longer applies cleanly. Can I run PrimeNG and Optimus UI side by side? Technically yes, since the package names and the CSS cascade layer differ, but you will ship two copies of the same components and two theme runtimes. Treat it as a temporary state during migration rather than a supported configuration. ## Project- Is Optimus UI free? Will it stay free? Yes, and yes. Every package is MIT licensed, and the code we forked was MIT too, so relicensing it is not something we could do even if we wanted to. There is no paid tier and none is planned. The philosophy page goes into what that does and does not buy you. Is this an official PrimeNG fork? Are you affiliated with PrimeTek? No. Optimus UI is an independent community fork, not affiliated with, endorsed by, or sponsored by PrimeTek. It is a separate repository seeded with PrimeNG's MIT licensed code and history, not a fork of the archived primefaces/primeng repository. Which PrimeNG version is this forked from? PrimeNG v21, the last version published under the MIT license. Optimus UI v1 is that codebase, rebranded, with the fixes that have landed since. Who maintains it, and how is it funded? A small group of volunteers, with OpenNG covering hosting and the domain. We are deliberate about not implying more than that — see sustainability for the honest version and the ways that can change. Why did the name change? Trademark. PrimeNG, PrimeFaces and PrimeFlex are PrimeTek's marks, so the packages, the CSS cascade layer and the icon library all needed new names. That is also why the rename is handled by a schematic rather than by asking you to rewrite imports by hand. ## Support- Is there commercial support? No. There is no SLA, no support contract and no guaranteed response time. Issues and discussions are answered by volunteers when they have time. If your organisation needs contractual guarantees, this project cannot offer them. How do I report a bug? Open an issue on GitHub with a minimal reproduction — a StackBlitz from any demo on this site is ideal — plus your Optimus UI, Angular and browser versions. A reproduction is the difference between a bug that gets fixed and one that sits in the backlog. How do I request a feature? Open a discussion . Requests are triaged and welcome, but in practice they ship when someone implements them. If it matters to you, the contribution guide is the fastest route. Where do I ask questions? GitHub Discussions is the primary place. There is also an Ask AI button in the header, which answers from this documentation. Optimus UI does not run its own Discord — the Discord links here point to the general Angular community server. How does versioning work? Semantic versioning, with majors tracking Angular majors. Breaking changes are confined to majors and documented in the changelog. --- # Migrate from PrimeNG Moving a PrimeNG v21 application to Optimus UI. ## Automated- The recommended way to migrate is the migrate-from-primeng schematic. Install @openng/optimus-ui first so the Angular CLI can resolve it, then run the schematic: packages are swapped, imports are rewritten and dependencies are installed. Note that ng add does not run the migration. It only sets up Optimus UI in a fresh project and makes no changes when primeng is detected. The schematic can be re-run at any time, for example after pulling in unmigrated code, and accepts a couple of flags. --skip-install skips the package install task and --force bypasses the PrimeNG v21 version check. After rewriting, the schematic scans the workspace and prints a report of any remaining primeng , primeicons or @primeuix references it could not migrate automatically, with file and line numbers. Review these manually using the tables in the manual migration section below. Files your .gitignore excludes are left alone, so coverage reports and build output are neither rewritten nor reported. The report itself is printed before the CLI lists the files it created and updated — that list only covers what the migration changed for you, so scroll back up to the warnings before you build. ## Manual- If you prefer to migrate by hand, or need to finish references the schematic reported as leftovers, apply the renames below. Start by replacing the packages. Packages Replace the packages in package.json and in every import path. Subpath imports keep their suffix, for example primeng/button becomes @openng/optimus-ui/button . Identifiers Rename the following exported identifiers. The PrimeIcons constants class still compiles through a deprecated alias, however OpenngIcons is the current API. Assets The PrimeIcons stylesheet moved along with the package rename. Update references in global stylesheets and in the styles arrays of angular.json or project.json from primeicons/primeicons.css to @openng/icons/openng-icons.css . Example A typical app.config.ts and component before the migration. The same code after the migration. ## Overview- Optimus UI is the open-source MIT licensed continuation of PrimeNG (now closed-source), rebranded due to trademark restrictions. Optimus UI v1 targets Angular 21 and is fully API-compatible with PrimeNG v21, so migrating is a rename rather than a rewrite. From v1 onward, Optimus UI evolves independently and future versions will diverge from PrimeNG, so v1 is the smoothest point to switch. Component selectors keep the p- prefix and icon classes keep the pi- prefix, so your templates are not affected by the migration. ## Prerequisites- Your project must be on PrimeNG v21 before migrating, as Optimus UI v1 mirrors the PrimeNG v21 API. If you are on an older version, update PrimeNG first by following its v21 migration guide . The migration schematic verifies this requirement and aborts when PrimeNG is missing or older than v21. The check can be bypassed with the --force flag, for example in workspaces where the dependency is declared in a non-standard location. ## Schematic-details- The schematic performs the following steps across the whole workspace, skipping build output and dependency folders. Swaps the PrimeNG package family for the Optimus UI equivalents in every package.json . Rewrites import specifiers and renamed identifiers, such as providePrimeNG , in all .ts and .mts source files. Updates asset references, such as the PrimeIcons stylesheet, in stylesheets and in angular.json / project.json . Prints a report of leftover references that require manual review. Schedules a package install, unless --skip-install is set. ## Verify- Build the application and run your test suite to confirm the migration. Searching the project for the old package names is a quick way to find anything left behind. The schematic scans for the same pattern when it prints its leftover report. --- # Contribution Guide How to contribute to Optimus UI. ## Benefits- Contributing to Optimus UI comes with several benefits. Being part of an open-source project will enhance your career and open up exciting opportunities. You'll gain significant visibility in the developer community while improving yourself as a professional. ## Helpneeded- Optimus UI is a community-driven project stewarded by OpenNG, and we appreciate any help you can provide. Here are some areas where you can contribute: Issue Triage Help us manage issues by; Reproducing reported bugs Clarifying issue descriptions Tagging issues with appropriate labels Sending Pull Requests We encourage you to send pull requests, especially for issues tagged with the help-needed label. Community Support Assist other users by participating in the issue tracker, GitHub discussions , and the Angular community Discord . Your expertise can help others solve problems and improve their experience with Optimus UI. ## Introduction- Optimus UI is a community-maintained Angular UI library, stewarded by OpenNG and dedicated to providing high-quality, versatile and accessible UI components that help developers build better applications faster. Development Setup To begin with, clone the Optimus UI repository from GitHub: Then run the documentation app in your local environment at http://localhost:4200/ . Project Structure Optimus UI's project structure is organized as follows: ## Pathway- Optimus UI offers an organization structure involving contributors and the core team: Contributor Role After a certain period of frequent contributions, a community member is offered the Contributor role. On average, it may take about three months, but the exact duration can vary depending on the individual commitment. Committer Role If a contributor actively participates in the codebase and PRs, their role may be upgraded to a Committer level, providing direct commit access to the Optimus UI codebase. --- # Components # Angular Image Component Displays an image with preview and tranformation options. ## Accessibility Screen Reader The preview button is a native button element with an aria-label that refers to the aria.zoomImage property of the locale API by default. When preview is active, dialog role with aria-modal is applied to the overlay image container. Button controls use aria.rotateRight , aria.rotateLeft , aria.zoomIn , aria.zoomOut and aria.close from the locale API as aria-label . ButtonBar Keyboard Support When preview is activated, close button receives the initial focus. Key Function tab Moves focus through button bar. enter Activates the button. space Activates the button. esc Closes the image preview. ## Basic Image is used as the native img element and supports all properties that the native element has. For multiple image, see Galleria. **Example:** ```typescript import { Component } from '@angular/core'; import { ImageModule } from '@openng/optimus-ui/image'; @Component({ template: `
`, standalone: true, imports: [ImageModule] }) export class ImageBasicDemo {} ``` ## Preview Preview mode displays a modal layer when the image is clicked that provides transformation options such as rotating and zooming. **Example:** ```typescript import { Component } from '@angular/core'; import { ImageModule } from '@openng/optimus-ui/image'; @Component({ template: `
`, standalone: true, imports: [ImageModule] }) export class ImagePreviewDemo {} ``` ## previewimagesource-doc In case that you want to show different image on preview, you can set previewImageSrc attribute. It could come handy when wanted to use smaller image version at first and bigger one on preview. **Example:** ```typescript import { Component } from '@angular/core'; import { ImageModule } from '@openng/optimus-ui/image'; @Component({ template: `
`, standalone: true, imports: [ImageModule] }) export class ImagePreviewimagesourceDemo {} ``` ## Template An eye icon is displayed by default when the image is hovered in preview mode. Use the indicator template for custom content. **Example:** ```typescript import { Component } from '@angular/core'; import { ImageModule } from '@openng/optimus-ui/image'; @Component({ template: `
image image
`, standalone: true, imports: [ImageModule] }) export class ImageTemplateDemo {} ``` ## Image Displays an image with preview and tranformation options. For multiple image, see Galleria. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | | imageClass | string | - | Style class of the image element. | | imageStyle | { [klass: string]: any } | - | Inline style of the image element. | | styleClass | string | - | Class of the element. **(Deprecated)** | | src | string \| SafeUrl | - | The source path for the main image. | | srcSet | string \| SafeUrl | - | The srcset definition for the main image. | | sizes | string | - | The sizes definition for the main image. | | previewImageSrc | string \| SafeUrl | - | The source path for the preview image. | | previewImageSrcSet | string \| SafeUrl | - | The srcset definition for the preview image. | | previewImageSizes | string | - | The sizes definition for the preview image. | | alt | string | - | Attribute of the preview image element. | | width | string | - | Attribute of the image element. | | height | string | - | Attribute of the image element. | | loading | "eager" \| "lazy" | - | Attribute of the image element. | | preview | boolean | false | Controls the preview functionality. | | showTransitionOptions | string | 150ms cubic-bezier(0, 0, 0.2, 1) | Transition options of the show animation **(Deprecated)** | | hideTransitionOptions | string | 150ms cubic-bezier(0, 0, 0.2, 1) | Transition options of the hide animation **(Deprecated)** | | modalEnterAnimation | InputSignal | 'p-modal-enter' | Enter animation class name of modal. | | modalLeaveAnimation | InputSignal | 'p-modal-leave' | Leave animation class name of modal. | | appendTo | InputSignal | 'self' | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). | | maskMotionOptions | InputSignal | ... | The motion options for the mask. | | motionOptions | InputSignal | ... | The motion options. | ### Emits | Name | Parameters | Description | |------|------------|-------------| | onShow | value: any | Triggered when the preview overlay is shown. | | onHide | value: any | Triggered when the preview overlay is hidden. | | onImageError | event: Event | This event is triggered if an error occurs while loading an image file. | ### Templates | Name | Type | Description | |------|------|-------------| | indicator | TemplateRef | Custom indicator template. | | rotaterighticon | TemplateRef | Custom rotate right icon template. | | rotatelefticon | TemplateRef | Custom rotate left icon template. | | zoomouticon | TemplateRef | Custom zoom out icon template. | | zoominicon | TemplateRef | Custom zoom in icon template. | | closeicon | TemplateRef | Custom close icon template. | | preview | TemplateRef | Custom preview template. | | image | TemplateRef | Custom image template. | ## Pass Through Options | Name | Type | Description | |------|------|-------------| | root | PassThroughOption | Used to pass attributes to the root's DOM element. | | image | PassThroughOption | Used to pass attributes to the image's DOM element. | | previewMask | PassThroughOption | Used to pass attributes to the preview mask button's DOM element. | | previewIcon | PassThroughOption | Used to pass attributes to the preview icon's DOM element. | | mask | PassThroughOption | Used to pass attributes to the mask's DOM element. | | toolbar | PassThroughOption | Used to pass attributes to the toolbar's DOM element. | | rotateRightButton | PassThroughOption | Used to pass attributes to the rotate right button's DOM element. | | rotateLeftButton | PassThroughOption | Used to pass attributes to the rotate left button's DOM element. | | zoomOutButton | PassThroughOption | Used to pass attributes to the zoom out button's DOM element. | | zoomInButton | PassThroughOption | Used to pass attributes to the zoom in button's DOM element. | | closeButton | PassThroughOption | Used to pass attributes to the close button's DOM element. | | original | PassThroughOption | Used to pass attributes to the original/preview image's DOM element. | | motion | MotionOptions | Used to pass options to the motion component/directive. | ## Theming ### CSS Classes | Class | Description | |-------|-------------| | p-image | Class name of the root element | | p-image-preview-mask | Class name of the preview mask element | | p-image-preview-icon | Class name of the preview icon element | | p-image-mask | Class name of the mask element | | p-image-toolbar | Class name of the toolbar element | | p-image-rotate-right-button | Class name of the rotate right button element | | p-image-rotate-left-button | Class name of the rotate left button element | | p-image-zoom-out-button | Class name of the zoom out button element | | p-image-zoom-in-button | Class name of the zoom in button element | | p-image-close-button | Class name of the close button element | | p-image-original | Class name of the original element | ### Design Tokens | Token | CSS Variable | Description | |-------|--------------|-------------| | image.transition.duration | --p-image-transition-duration | Transition duration of root | | image.preview.icon.size | --p-image-preview-icon-size | Icon size of preview | | image.preview.mask.background | --p-image-preview-mask-background | Mask background of preview | | image.preview.mask.color | --p-image-preview-mask-color | Mask color of preview | | image.toolbar.position.left | --p-image-toolbar-position-left | Position left of toolbar | | image.toolbar.position.right | --p-image-toolbar-position-right | Position right of toolbar | | image.toolbar.position.top | --p-image-toolbar-position-top | Position top of toolbar | | image.toolbar.position.bottom | --p-image-toolbar-position-bottom | Position bottom of toolbar | | image.toolbar.blur | --p-image-toolbar-blur | Blur of toolbar | | image.toolbar.background | --p-image-toolbar-background | Background of toolbar | | image.toolbar.border.color | --p-image-toolbar-border-color | Border color of toolbar | | image.toolbar.border.width | --p-image-toolbar-border-width | Border width of toolbar | | image.toolbar.border.radius | --p-image-toolbar-border-radius | Border radius of toolbar | | image.toolbar.padding | --p-image-toolbar-padding | Padding of toolbar | | image.toolbar.gap | --p-image-toolbar-gap | Gap of toolbar | | image.action.hover.background | --p-image-action-hover-background | Hover background of action | | image.action.color | --p-image-action-color | Color of action | | image.action.hover.color | --p-image-action-hover-color | Hover color of action | | image.action.size | --p-image-action-size | Size of action | | image.action.icon.size | --p-image-action-icon-size | Icon size of action | | image.action.border.radius | --p-image-action-border-radius | Border radius of action | | image.action.focus.ring.width | --p-image-action-focus-ring-width | Focus ring width of action | | image.action.focus.ring.style | --p-image-action-focus-ring-style | Focus ring style of action | | image.action.focus.ring.color | --p-image-action-focus-ring-color | Focus ring color of action | | image.action.focus.ring.offset | --p-image-action-focus-ring-offset | Focus ring offset of action | | image.action.focus.ring.shadow | --p-image-action-focus-ring-shadow | Focus ring shadow of action | --- # Angular Accordion Component Accordion groups a collection of contents in tabs. ## Accessibility Screen Reader Accordion header elements have a button role and use aria-controls to define the id of the content section along with aria-expanded for the visibility state. The value to read a header element defaults to the value of the header property and can be customized by defining an aria-label or aria-labelledby property. Each header has a heading role, for which the level is customized by headerAriaLevel and has a default level of 2 as per W3C specifications. Disabled accordions headers use aria-disabled and are excluded from the keybord navigation. The content uses region role, defines an id that matches the aria-controls of the header and aria-labelledby referring to the id of the header. Header Keyboard Support ## Basic Accordion is defined using AccordionPanel , AccordionHeader and AccordionContent components. Each AccordionPanel must contain a unique value property to specify the active item. **Example:** ```typescript import { Component } from '@angular/core'; import { AccordionModule } from '@openng/optimus-ui/accordion'; @Component({ template: `
Header I

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Header II

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.

Header III

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.

`, standalone: true, imports: [AccordionModule] }) export class AccordionBasicDemo {} ``` ## Controlled Panels can be controlled programmatically using value property as a model. **Example:** ```typescript import { Component } from '@angular/core'; import { AccordionModule } from '@openng/optimus-ui/accordion'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
Header I

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Header II

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.

Header III

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus.

`, standalone: true, imports: [AccordionModule, ButtonModule] }) export class AccordionControlledDemo { active: string = '0'; } ``` ## Disabled Enabling disabled property of an AccordionTab prevents user interaction. **Example:** ```typescript import { Component } from '@angular/core'; import { AccordionModule } from '@openng/optimus-ui/accordion'; @Component({ template: `
Header I

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Header II

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.

Header III

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus.

Header IV
`, standalone: true, imports: [AccordionModule] }) export class AccordionDisabledDemo {} ``` ## Dynamic AccordionPanel can be generated dynamically using the standard @for block. **Example:** ```typescript import { Component } from '@angular/core'; import { AccordionModule } from '@openng/optimus-ui/accordion'; @Component({ template: `
@for (tab of tabs; track tab.title) { {{ tab.title }}

{{ tab.content }}

}
`, standalone: true, imports: [AccordionModule] }) export class AccordionDynamicDemo { tabs: any[]; } ``` ## Multiple Only one tab at a time can be active by default, enabling multiple property changes this behavior to allow multiple tabs. In this case activeIndex needs to be an array. **Example:** ```typescript import { Component } from '@angular/core'; import { AccordionModule } from '@openng/optimus-ui/accordion'; @Component({ template: `
Header I

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Header II

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.

Header III

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus.

`, standalone: true, imports: [AccordionModule] }) export class AccordionMultipleDemo {} ``` ## Template Accordion is customized with toggleicon template. **Example:** ```typescript import { Component } from '@angular/core'; import { AccordionModule } from '@openng/optimus-ui/accordion'; import { AvatarModule } from '@openng/optimus-ui/avatar'; import { BadgeModule } from '@openng/optimus-ui/badge'; @Component({ template: `
@if (active) { } @else { } Amy Elsner

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

@if (active) { } @else { } Onyama Limba

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.

@if (active) { } @else { } Ioni Bowcher

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus.

`, standalone: true, imports: [AccordionModule, AvatarModule, BadgeModule] }) export class AccordionTemplateDemo {} ``` ## Accordion Panel AccordionPanel is a helper component for Accordion component. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | value | ModelSignal | undefined | Value of the active tab. | | disabled | InputSignalWithTransform | false | Disables the tab when enabled. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | ## Accordion Header AccordionHeader is a helper component for Accordion component. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | ### Templates | Name | Type | Description | |------|------|-------------| | toggleicon | TemplateRef | Toggle icon template. | ## Accordion Accordion groups a collection of contents in tabs. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | value | ModelSignal | undefined | Value of the active tab. | | multiple | InputSignalWithTransform | false | When enabled, multiple tabs can be activated at the same time. | | styleClass | string | - | Class of the element. **(Deprecated)** | | expandIcon | string | - | Icon of a collapsed tab. | | collapseIcon | string | - | Icon of an expanded tab. | | selectOnFocus | InputSignalWithTransform | false | When enabled, the focused tab is activated. | | transitionOptions | string | 400ms cubic-bezier(0.86, 0, 0.07, 1) | Transition options of the animation. **(Deprecated)** | | motionOptions | InputSignal | ... | The motion options. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | ### Emits | Name | Parameters | Description | |------|------------|-------------| | onClose | event: AccordionTabCloseEvent | Callback to invoke when an active tab is collapsed by clicking on the header. | | onOpen | event: AccordionTabOpenEvent | Callback to invoke when a tab gets expanded. | ## Pass Through Options | Name | Type | Description | |------|------|-------------| | root | PassThroughOption | Used to pass attributes to the root's DOM element. | | motion | MotionOptions | Used to pass options to the motion component/directive. | ## Theming ### CSS Classes | Class | Description | |-------|-------------| | p-accordion | Class name of the root element | | p-accordioncontent | Class name of the content wrapper | | p-accordioncontent-content | Class name of the content | | p-accordionheader | Class name of the header | | p-accordionheader-toggle-icon | Class name of the toggle icon | | p-accordionpanel | Class name of the panel | ### Design Tokens | Token | CSS Variable | Description | |-------|--------------|-------------| | accordion.transition.duration | --p-accordion-transition-duration | Transition duration of root | | accordion.panel.border.width | --p-accordion-panel-border-width | Border width of panel | | accordion.panel.border.color | --p-accordion-panel-border-color | Border color of panel | | accordion.header.color | --p-accordion-header-color | Color of header | | accordion.header.hover.color | --p-accordion-header-hover-color | Hover color of header | | accordion.header.active.color | --p-accordion-header-active-color | Active color of header | | accordion.header.active.hover.color | --p-accordion-header-active-hover-color | Active hover color of header | | accordion.header.padding | --p-accordion-header-padding | Padding of header | | accordion.header.font.weight | --p-accordion-header-font-weight | Font weight of header | | accordion.header.border.radius | --p-accordion-header-border-radius | Border radius of header | | accordion.header.border.width | --p-accordion-header-border-width | Border width of header | | accordion.header.border.color | --p-accordion-header-border-color | Border color of header | | accordion.header.background | --p-accordion-header-background | Background of header | | accordion.header.hover.background | --p-accordion-header-hover-background | Hover background of header | | accordion.header.active.background | --p-accordion-header-active-background | Active background of header | | accordion.header.active.hover.background | --p-accordion-header-active-hover-background | Active hover background of header | | accordion.header.focus.ring.width | --p-accordion-header-focus-ring-width | Focus ring width of header | | accordion.header.focus.ring.style | --p-accordion-header-focus-ring-style | Focus ring style of header | | accordion.header.focus.ring.color | --p-accordion-header-focus-ring-color | Focus ring color of header | | accordion.header.focus.ring.offset | --p-accordion-header-focus-ring-offset | Focus ring offset of header | | accordion.header.focus.ring.shadow | --p-accordion-header-focus-ring-shadow | Focus ring shadow of header | | accordion.header.toggle.icon.color | --p-accordion-header-toggle-icon-color | Toggle icon color of header | | accordion.header.toggle.icon.hover.color | --p-accordion-header-toggle-icon-hover-color | Toggle icon hover color of header | | accordion.header.toggle.icon.active.color | --p-accordion-header-toggle-icon-active-color | Toggle icon active color of header | | accordion.header.toggle.icon.active.hover.color | --p-accordion-header-toggle-icon-active-hover-color | Toggle icon active hover color of header | | accordion.header.first.top.border.radius | --p-accordion-header-first-top-border-radius | First top border radius of header | | accordion.header.first.border.width | --p-accordion-header-first-border-width | First border width of header | | accordion.header.last.bottom.border.radius | --p-accordion-header-last-bottom-border-radius | Last bottom border radius of header | | accordion.header.last.active.bottom.border.radius | --p-accordion-header-last-active-bottom-border-radius | Last active bottom border radius of header | | accordion.content.border.width | --p-accordion-content-border-width | Border width of content | | accordion.content.border.color | --p-accordion-content-border-color | Border color of content | | accordion.content.background | --p-accordion-content-background | Background of content | | accordion.content.color | --p-accordion-content-color | Color of content | | accordion.content.padding | --p-accordion-content-padding | Padding of content | --- # Angular Animate On Scroll Directive AnimateOnScroll is used to apply animations to elements when entering or leaving the viewport during scrolling. ## Accessibility Screen Reader AnimateOnScroll does not require any roles and attributes. Keyboard Support Component does not include any interactive elements. ## Basic Animation classes are defined with the enterClass and leaveClass properties. This example utilizes @openng/optimus-ui-tailwindcss plugin animations however any valid CSS animation is supported. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
Scroll Down
Individual Lorem ipsum dolor sit amet consectetur adipisicing elit.
Team Lorem ipsum dolor sit amet consectetur adipisicing elit.
Enterprise Lorem ipsum dolor sit amet consectetur adipisicing elit.
Jenna Thompson Lorem ipsum dolor sit amet consectetur adipisicing elit.
Isabel Garcia Lorem ipsum dolor sit amet consectetur adipisicing elit.
Xavier Mason Lorem ipsum dolor sit amet consectetur adipisicing elit.
850K Customers Lorem ipsum dolor sit amet consectetur adipisicing elit.
$1.5M Revenue Lorem ipsum dolor sit amet consectetur adipisicing elit.
140K Sales Lorem ipsum dolor sit amet consectetur adipisicing elit.
Bandwidth Lorem ipsum dolor sit amet consectetur adipisicing elit.
Storage Lorem ipsum dolor sit amet consectetur adipisicing elit.
Requests Lorem ipsum dolor sit amet consectetur adipisicing elit.
`, standalone: true, imports: [AvatarModule] }) export class AnimateonscrollBasicDemo {} ``` ## Animate On Scroll AnimateOnScroll is used to apply animations to elements when entering or leaving the viewport during scrolling. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | enterClass | string | - | Selector to define the CSS class for enter animation. | | leaveClass | string | - | Selector to define the CSS class for leave animation. | | root | HTMLElement | - | Specifies the root option of the IntersectionObserver API. | | rootMargin | string | - | Specifies the rootMargin option of the IntersectionObserver API. | | threshold | number | 0.5 | Specifies the threshold option of the IntersectionObserver API | | once | boolean | false | Whether the scroll event listener should be removed after initial run. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | --- # Angular AutoComplete Component AutoComplete is an input component that provides real-time suggestions when being typed. ## Accessibility Screen Reader Value to describe the component can either be provided via label tag combined with inputId prop or using ariaLabelledBy , ariaLabel props. The input element has combobox role in addition to aria-autocomplete , aria-haspopup and aria-expanded attributes. The relation between the input and the popup is created with aria-controls and aria-activedescendant attribute is used to instruct screen reader which option to read during keyboard navigation within the popup list. In multiple mode, chip list uses listbox role whereas each chip has the option role with aria-label set to the label of the chip. The popup list has an id that refers to the aria-controls attribute of the input element and uses listbox as the role. Each list item has option role and an id to match the aria-activedescendant of the input element. ## advanced-chips-doc This example demonstrates an advanced use case with templating, object handling, dropdown, and multiple mode. **Example:** ```typescript import { Component, OnInit, inject, signal } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { ProductService } from '@/service/productservice'; import { Product } from '@/domain/product'; @Component({ template: `
{{ product.name }} {{ product.category }}
\${{ product.price }}
@if (value.price) {
{{ value.name }} \${{ value.price }}
} @else { {{ value }} }
`, standalone: true, imports: [AutoCompleteModule, FormsModule], providers: [ProductService] }) export class AutocompleteAdvancedChipsDemo implements OnInit { private productService = inject(ProductService); products = signal([]); ngOnInit() { this.productService.getProductsSmall().then((data) => this.products.set(data)); } filterProducts(event: any) { let filtered: Product[] = []; let query = event.query; for (let i = 0; i < this.products().length; i++) { let product = this.products()[i]; if (product.name?.toLowerCase().indexOf(query.toLowerCase()) == 0) { filtered.push(product); } } this.filteredProducts = filtered; } getProductLabel(product: any): string { if (typeof product === 'string') { return product; } return product?.name || ''; } getProductValue(product: any): any { if (typeof product === 'string') { return { name: product, custom: true }; } return { id: product.id, name: product.name, price: product.price, quantity: product.quantity }; } } ``` ## basic-chips-doc With ⁠multiple enabled, the AutoComplete component behaves like a chips or tags input. Use addOnBlur , ⁠addOnTab , and ⁠separator properties to customize the keystroke behavior for adding items. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteBasicChipsDemo { valueBlur: any[] = []; valueTab: any[] = []; valueSeparator: any[] = []; valueCombined: any[] = []; } ``` ## Basic AutoComplete uses ngModel for two-way binding, requires a list of suggestions and a completeMethod to query for the results. The completeMethod gets the query text as event.query property and should update the suggestions with the search results. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteBasicDemo { items: any[] = []; value: any; search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## clear-icon-doc When showClear is enabled, a clear icon is displayed to clear the value. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteClearIconDemo { items: any[] = []; value: any; search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## Disabled When disabled is present, the element cannot be edited and focused. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteDisabledDemo { items: any[] | undefined; selectedItem: any; suggestions: any[] | undefined; search(event: AutoCompleteCompleteEvent) { this.suggestions = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## Dropdown Enabling dropdown property displays a button next to the input field where click behavior of the button is defined using dropdownMode property that takes blank or current as possible values. blank is the default mode to send a query with an empty string whereas current setting sends a query with the current value of the input. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteDropdownDemo { items: any[] | undefined; value: any; search(event: AutoCompleteCompleteEvent) { let _items = [...Array(10).keys()]; this.items = event.query ? [...Array(10).keys()].map((item) => event.query + '-' + item) : _items; } } ``` ## Filled Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteFilledDemo { items: any[] | undefined; selectedItem: any; suggestions: any[] | undefined; search(event: AutoCompleteCompleteEvent) { this.suggestions = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## float-label-doc A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { FloatLabelModule } from '@openng/optimus-ui/floatlabel'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FloatLabelModule, FormsModule] }) export class AutocompleteFloatLabelDemo { value1: string | undefined; value2: string | undefined; value3: string | undefined; items: any[] | undefined; search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## Fluid The fluid prop makes the component take up the full width of its container when set to true. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteFluidDemo { items: any[] = []; value: any; search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## force-selection-doc ForceSelection mode validates the manual input to check whether it also exists in the suggestions list, if not the input value is cleared to make sure the value passed to the model is always one of the suggestions. **Example:** ```typescript import { Component, OnInit, inject } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { CountryService } from '@/service/countryservice'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule], providers: [CountryService] }) export class AutocompleteForceSelectionDemo implements OnInit { private countryService = inject(CountryService); countries: any[] | undefined; selectedCountry: any; filteredCountries: any[] | undefined; ngOnInit() { this.countryService.getCountries().then((countries) => { this.countries = countries; }); } filterCountry(event: AutoCompleteCompleteEvent) { let filtered: any[] = []; let query = event.query; for (let i = 0; i < (this.countries as any[]).length; i++) { let country = (this.countries as any[])[i]; if (country.name.toLowerCase().indexOf(query.toLowerCase()) == 0) { filtered.push(country); } } this.filteredCountries = filtered; } } ``` ## Group Option grouping is enabled when group property is set to true . group template is available to customize the option groups. All templates get the option instance as the default local template variable. **Example:** ```typescript import { Component, OnInit } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { SelectItemGroup, FilterService } from '@openng/optimus-ui/api'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
{{ group.label }}
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteGroupDemo implements OnInit { selectedCity: any; filteredGroups: any[] | undefined; groupedCities: SelectItemGroup[] | undefined; ngOnInit() { this.groupedCities = [ { label: 'Germany', value: 'de', items: [ { label: 'Berlin', value: 'Berlin' }, { label: 'Frankfurt', value: 'Frankfurt' }, { label: 'Hamburg', value: 'Hamburg' }, { label: 'Munich', value: 'Munich' } ] }, { label: 'USA', value: 'us', items: [ { label: 'Chicago', value: 'Chicago' }, { label: 'Los Angeles', value: 'Los Angeles' }, { label: 'New York', value: 'New York' }, { label: 'San Francisco', value: 'San Francisco' } ] }, { label: 'Japan', value: 'jp', items: [ { label: 'Kyoto', value: 'Kyoto' }, { label: 'Osaka', value: 'Osaka' }, { label: 'Tokyo', value: 'Tokyo' }, { label: 'Yokohama', value: 'Yokohama' } ] } ]; } filterGroupedCity(event: AutoCompleteCompleteEvent) { let query = event.query; let filteredGroups = []; for (let optgroup of this.groupedCities as SelectItemGroup[]) { let filteredSubOptions = this.filterService.filter(optgroup.items, ['label'], query, 'contains'); if (filteredSubOptions && filteredSubOptions.length) { filteredGroups.push({ label: optgroup.label, value: optgroup.value, items: filteredSubOptions }); } } this.filteredGroups = filteredGroups; } } ``` ## ifta-label-doc IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { IftaLabelModule } from '@openng/optimus-ui/iftalabel'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, IftaLabelModule, FormsModule] }) export class AutocompleteIftaLabelDemo { items: any[] | undefined; value: any; search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## Invalid The invalid state is applied using the ⁠invalid property to indicate failed validation, which can be integrated with Angular Forms. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteInvalidDemo { value1: any; value2: any; suggestions: any[] | undefined; search(event: AutoCompleteCompleteEvent) { this.suggestions = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## Multiple Enable multiple selection mode using the ⁠multiple property to allow users to select more than one value from the autocomplete. When enabled, the value reference must be an array. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteMultipleDemo { value1: any[] | undefined; value2: any[] | undefined; items: any[] | undefined; search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } } ``` ## Objects AutoComplete can also work with objects using the optionLabel property that defines the label to display as a suggestion. The value passed to the model would still be the object instance of a suggestion. Here is an example with a Country object that has name and code fields such as {name: "United States", code:"USA"} . **Example:** ```typescript import { Component, OnInit, inject } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { CountryService } from '@/service/countryservice'; import { Country } from '@/domain/customer'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule], providers: [CountryService] }) export class AutocompleteObjectsDemo implements OnInit { private countryService = inject(CountryService); countries: any[] | undefined; selectedCountry: any; filteredCountries: any[] | undefined; ngOnInit() { this.countryService.getCountries().then((countries) => { this.countries = countries; }); } filterCountry(event: AutoCompleteCompleteEvent) { let filtered: any[] = []; let query = event.query; for (let i = 0; i < (this.countries as any[]).length; i++) { let country = (this.countries as any[])[i]; if (country.name.toLowerCase().indexOf(query.toLowerCase()) == 0) { filtered.push(country); } } this.filteredCountries = filtered; } } ``` ## reactive-forms-doc AutoComplete can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control. **Example:** ```typescript import { Component, inject } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { MessageModule } from '@openng/optimus-ui/message'; import { ToastModule } from '@openng/optimus-ui/toast'; import { ButtonModule } from '@openng/optimus-ui/button'; import { MessageService } from '@openng/optimus-ui/api'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
@if (isInvalid('value')) { Value is required. }
`, standalone: true, imports: [AutoCompleteModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule] }) export class AutocompleteReactiveFormsDemo { messageService = inject(MessageService); items: any[] | undefined; exampleForm: FormGroup | undefined; formSubmitted: boolean = false; constructor() { this.exampleForm = this.fb.group({ value: ['', Validators.required] }); } search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } onSubmit() { this.formSubmitted = true; if (this.exampleForm.valid) { this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 }); this.exampleForm.reset(); this.formSubmitted = false; } } isInvalid(controlName: string) { const control = this.exampleForm.get(controlName); return control?.invalid && (control.touched || this.formSubmitted); } } ``` ## Sizes AutoComplete provides small and large sizes as alternatives to the base. **Example:** ```typescript import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteSizesDemo { items: any[] | undefined; value1: any; value2: any; value3: any; search() { this.items = []; } } ``` ## Template AutoComplete offers multiple templates for customization through templating. **Example:** ```typescript import { Component, OnInit, inject } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { ButtonModule } from '@openng/optimus-ui/button'; import { CountryService } from '@/service/countryservice'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
{{ country.name }}
Available Countries
`, standalone: true, imports: [AutoCompleteModule, ButtonModule, FormsModule], providers: [CountryService] }) export class AutocompleteTemplateDemo implements OnInit { private countryService = inject(CountryService); countries: any[] | undefined; selectedCountryAdvanced: any[] | undefined; filteredCountries: any[] | undefined; ngOnInit() { this.countryService.getCountries().then((countries) => { this.countries = countries; }); } filterCountry(event: AutoCompleteCompleteEvent) { let filtered: any[] = []; let query = event.query; for (let i = 0; i < (this.countries as any[]).length; i++) { let country = (this.countries as any[])[i]; if (country.name.toLowerCase().indexOf(query.toLowerCase()) == 0) { filtered.push(country); } } this.filteredCountries = filtered; } } ``` ## template-driven-forms-doc **Example:** ```typescript import { Component, inject } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; import { MessageModule } from '@openng/optimus-ui/message'; import { ToastModule } from '@openng/optimus-ui/toast'; import { ButtonModule } from '@openng/optimus-ui/button'; import { MessageService } from '@openng/optimus-ui/api'; @Component({ template: `
@if (val.invalid && (val.touched || exampleForm.submitted)) { Value is required. }
`, standalone: true, imports: [AutoCompleteModule, MessageModule, ToastModule, ButtonModule, FormsModule] }) export class AutocompleteTemplateDrivenFormsDemo { messageService = inject(MessageService); items: any[] = []; value: any; search(event: AutoCompleteCompleteEvent) { this.items = [...Array(10).keys()].map((item) => event.query + '-' + item); } onSubmit(form: any) { if (form.valid) { this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 }); form.resetForm(); } } } ``` ## virtual-scroll-doc Virtual scrolling is an efficient way of rendering the options by displaying a small subset of data in the viewport at any time. When dealing with huge number of options, it is suggested to enable virtual scrolling to avoid performance issues. Usage is simple as setting virtualScroll property to true and defining virtualScrollItemSize to specify the height of an item. **Example:** ```typescript import { Component, OnInit } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@openng/optimus-ui/autocomplete'; interface AutoCompleteCompleteEvent { originalEvent: Event; query: string; } @Component({ template: `
`, standalone: true, imports: [AutoCompleteModule, FormsModule] }) export class AutocompleteVirtualScrollDemo implements OnInit { selectedItem: any; filteredItems: any[] | undefined; items: any[] | undefined; ngOnInit() { this.items = []; for (let i = 0; i < 10000; i++) { this.items.push({ label: 'Item ' + i, value: 'Item ' + i }); } } filterItems(event: AutoCompleteCompleteEvent) { //in a real application, make a request to a remote url with the query and return filtered results, for demo we filter at client side let filtered: any[] = []; let query = event.query; for (let i = 0; i < (this.items as any[]).length; i++) { let item = (this.items as any[])[i]; if (item.label.toLowerCase().indexOf(query.toLowerCase()) == 0) { filtered.push(item); } } this.filteredItems = filtered; } } ``` ## Auto Complete AutoComplete is an input component that provides real-time suggestions when being typed. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | minLength | number | 1 | Minimum number of characters to initiate a search. **(Deprecated)** | | minQueryLength | number | - | Minimum number of characters to initiate a search. | | delay | number | 300 | Delay between keystrokes to wait before sending a query. | | panelStyle | { [klass: string]: any } | - | Inline style of the overlay panel element. | | styleClass | string | - | Style class of the component. **(Deprecated)** | | panelStyleClass | string | - | Style class of the overlay panel element. | | inputStyle | { [klass: string]: any } | - | Inline style of the input field. | | inputId | string | - | Identifier of the focus input to match a label defined for the component. | | inputStyleClass | string | - | Inline style of the input field. | | placeholder | string | - | Hint text for the input field. | | readonly | boolean | false | When present, it specifies that the input cannot be typed. | | scrollHeight | string | 200px | Maximum height of the suggestions panel. | | lazy | boolean | false | Defines if data is loaded and interacted with in lazy manner. | | virtualScroll | boolean | false | Whether the data should be loaded on demand during scroll. | | virtualScrollItemSize | number | - | Height of an item in the list for VirtualScrolling. | | virtualScrollOptions | ScrollerOptions | - | Whether to use the scroller feature. The properties of scroller component can be used like an object in it. | | autoHighlight | boolean | false | When enabled, highlights the first item in the list by default. | | forceSelection | boolean | false | When present, autocomplete clears the manual input if it does not match of the suggestions to force only accepting values from the suggestions. | | type | string | text | Type of the input, defaults to "text". | | autoZIndex | boolean | true | Whether to automatically manage layering. | | baseZIndex | number | 0 | Base zIndex value to use in layering. | | ariaLabel | string | - | Defines a string that labels the input for accessibility. | | dropdownAriaLabel | string | - | Defines a string that labels the dropdown button for accessibility. | | ariaLabelledBy | string | - | Specifies one or more IDs in the DOM that labels the input field. | | dropdownIcon | string | - | Icon class of the dropdown icon. | | unique | boolean | true | Ensures uniqueness of selected items on multiple mode. | | group | boolean | false | Whether to display options as grouped when nested options are provided. | | completeOnFocus | boolean | false | Whether to run a query when input receives focus. | | showClear | boolean | false | When enabled, a clear icon is displayed to clear the value. | | dropdown | boolean | false | Displays a button next to the input field when enabled. | | showEmptyMessage | boolean | true | Whether to show the empty message or not. | | dropdownMode | string | blank | Specifies the behavior dropdown button. Default "blank" mode sends an empty string and "current" mode sends the input value. | | multiple | boolean | false | Specifies if multiple values can be selected. | | addOnTab | boolean | false | When enabled, the input value is added to the selected items on tab key press when multiple is true and typeahead is false. | | tabindex | number | - | Index of the element in tabbing order. | | dataKey | string | - | A property to uniquely identify a value in options. | | emptyMessage | string | - | Text to display when there is no data. Defaults to global value in i18n translation configuration. | | showTransitionOptions | string | .12s cubic-bezier(0, 0, 0.2, 1) | Transition options of the show animation. **(Deprecated)** | | hideTransitionOptions | string | .1s linear | Transition options of the hide animation. **(Deprecated)** | | autofocus | boolean | false | When present, it specifies that the component should automatically get focus on load. | | autocomplete | string | off | Used to define a string that autocomplete attribute the current element. | | optionGroupChildren | string | items | Name of the options field of an option group. | | optionGroupLabel | string | label | Name of the label field of an option group. | | overlayOptions | OverlayOptions | - | Options for the overlay element. | | suggestions | any[] | - | An array of suggestions to display. | | optionLabel | string \| ((item: any) => string) | - | Property name or getter function to use as the label of an option. | | optionValue | string \| ((item: any) => string) | - | Property name or getter function to use as the value of an option. | | id | string | - | Unique identifier of the component. | | searchMessage | string | '{0} results are available' | Text to display when the search is active. Defaults to global value in i18n translation configuration. | | emptySelectionMessage | string | 'No selected item' | Text to display when filtering does not return any results. Defaults to global value in i18n translation configuration. | | selectionMessage | string | '{0} items selected' | Text to be displayed in hidden accessible field when options are selected. Defaults to global value in i18n translation configuration. | | autoOptionFocus | boolean | false | Whether to focus on the first visible or selected element when the overlay panel is shown. | | selectOnFocus | boolean | false | When enabled, the focused option is selected. | | searchLocale | boolean | false | Locale to use in searching. The default locale is the host environment's current locale. | | optionDisabled | string \| ((item: any) => string) | - | Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. | | focusOnHover | boolean | true | When enabled, the hovered option will be focused. | | typeahead | boolean | true | Whether typeahead is active or not. | | addOnBlur | boolean | false | Whether to add an item on blur event if the input has value and typeahead is false with multiple mode. | | separator | string \| RegExp | - | Separator char to add item when typeahead is false and multiple mode is enabled. | | appendTo | InputSignal | 'self' | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). | | motionOptions | InputSignal | ... | The motion options. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | | required | InputSignalWithTransform | false | There must be a value (if set). | | invalid | InputSignalWithTransform | false | When present, it specifies that the component should have invalid state style. | | disabled | InputSignalWithTransform | false | When present, it specifies that the component should have disabled state style. | | name | InputSignal | undefined | When present, it specifies that the name of the input. | | fluid | InputSignalWithTransform | false | Spans 100% width of the container when enabled. | | variant | InputSignal<"outlined" \| "filled"> | 'outlined' | Specifies the input variant of the component. | | size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. | | inputSize | InputSignal | undefined | Specifies the visible width of the input element in characters. | | pattern | InputSignal | undefined | Specifies the value must match the pattern. | | min | InputSignal | undefined | The value must be greater than or equal to the value. | | max | InputSignal | undefined | The value must be less than or equal to the value. | | step | InputSignal | undefined | Unless the step is set to the any literal, the value must be min + an integral multiple of the step. | | minlength | InputSignal | undefined | The number of characters (code points) must not be less than the value of the attribute, if non-empty. | | maxlength | InputSignal | undefined | The number of characters (code points) must not exceed the value of the attribute. | ### Emits | Name | Parameters | Description | |------|------------|-------------| | completeMethod | event: AutoCompleteCompleteEvent | Callback to invoke to search for suggestions. | | onSelect | event: AutoCompleteSelectEvent | Callback to invoke when a suggestion is selected. | | onUnselect | event: AutoCompleteUnselectEvent | Callback to invoke when a selected value is removed. | | onAdd | event: AutoCompleteAddEvent | Callback to invoke when an item is added via addOnBlur or separator features. | | onFocus | event: Event | Callback to invoke when the component receives focus. | | onBlur | event: Event | Callback to invoke when the component loses focus. | | onDropdownClick | event: AutoCompleteDropdownClickEvent | Callback to invoke to when dropdown button is clicked. | | onClear | event: Event | Callback to invoke when clear button is clicked. | | onInputKeydown | event: KeyboardEvent | Callback to invoke on input key down. | | onKeyUp | event: KeyboardEvent | Callback to invoke on input key up. | | onShow | event: Event | Callback to invoke on overlay is shown. | | onHide | event: Event | Callback to invoke on overlay is hidden. | | onLazyLoad | event: AutoCompleteLazyLoadEvent | Callback to invoke on lazy load data. | ### Templates | Name | Type | Description | |------|------|-------------| | item | TemplateRef> | Custom item template. | | empty | TemplateRef | Custom empty message template. | | header | TemplateRef | Custom header template. | | footer | TemplateRef | Custom footer template. | | selecteditem | TemplateRef> | Custom selected item template. | | group | TemplateRef> | Custom group template. | | loader | TemplateRef | Custom loader template. | | removeicon | TemplateRef | Custom remove icon template. | | loadingicon | TemplateRef | Custom loading icon template. | | clearicon | TemplateRef | Custom clear icon template. | | dropdownicon | TemplateRef | Custom dropdown icon template. | ## Pass Through Options | Name | Type | Description | |------|------|-------------| | host | PassThroughOption | Used to pass attributes to the host's DOM element. | | root | PassThroughOption | Used to pass attributes to the root's DOM element. | | pcInputText | InputTextPassThrough | Used to pass attributes to the InputText component. | | inputMultiple | PassThroughOption | Used to pass attributes to the input multiple's DOM element. | | chipItem | PassThroughOption | Used to pass attributes to the chip item's DOM element. | | pcChip | ChipPassThrough | Used to pass attributes to the Chip component. | | chipIcon | PassThroughOption | Used to pass attributes to the chip icon's DOM element. | | inputChip | PassThroughOption | Used to pass attributes to the input chip's DOM element. | | clearIcon | PassThroughOption | Used to pass attributes to the clear icon's DOM element. | | loader | PassThroughOption | Used to pass attributes to the loader's DOM element. | | dropdown | PassThroughOption | Used to pass attributes to the dropdown button's DOM element. | | pcOverlay | OverlayPassThrough | Used to pass attributes to the Overlay component. | | overlay | PassThroughOption | Used to pass attributes to the overlay's DOM element. | | listContainer | PassThroughOption | Used to pass attributes to the list container's DOM element. | | pcScroller | VirtualScrollerPassThrough | Used to pass attributes to the Scroller component. | | list | PassThroughOption | Used to pass attributes to the list's DOM element. | | optionGroup | PassThroughOption | Used to pass attributes to the option group's DOM element. | | option | PassThroughOption | Used to pass attributes to the option's DOM element. | | emptyMessage | PassThroughOption | Used to pass attributes to the empty message's DOM element. | ## Theming ### CSS Classes | Class | Description | |-------|-------------| | p-autocomplete | Class name of the root element | | p-autocomplete-input | Class name of the input element | | p-autocomplete-input-multiple | Class name of the input multiple element | | p-autocomplete-chip-item | Class name of the chip item element | | p-autocomplete-chip | Class name of the chip element | | p-autocomplete-chip-icon | Class name of the chip icon element | | p-autocomplete-input-chip | Class name of the input chip element | | p-autocomplete-loader | Class name of the loader element | | p-autocomplete-dropdown | Class name of the dropdown element | | p-autocomplete-overlay | Class name of the panel element | | p-autocomplete-list | Class name of the list element | | p-autocomplete-option-group | Class name of the option group element | | p-autocomplete-option | Class name of the option element | | p-autocomplete-empty-message | Class name of the empty message element | | p-autocomplete-clear-icon | Class name of the clear icon | ### Design Tokens | Token | CSS Variable | Description | |-------|--------------|-------------| | autocomplete.background | --p-autocomplete-background | Background of root | | autocomplete.disabled.background | --p-autocomplete-disabled-background | Disabled background of root | | autocomplete.filled.background | --p-autocomplete-filled-background | Filled background of root | | autocomplete.filled.hover.background | --p-autocomplete-filled-hover-background | Filled hover background of root | | autocomplete.filled.focus.background | --p-autocomplete-filled-focus-background | Filled focus background of root | | autocomplete.border.color | --p-autocomplete-border-color | Border color of root | | autocomplete.hover.border.color | --p-autocomplete-hover-border-color | Hover border color of root | | autocomplete.focus.border.color | --p-autocomplete-focus-border-color | Focus border color of root | | autocomplete.invalid.border.color | --p-autocomplete-invalid-border-color | Invalid border color of root | | autocomplete.color | --p-autocomplete-color | Color of root | | autocomplete.disabled.color | --p-autocomplete-disabled-color | Disabled color of root | | autocomplete.placeholder.color | --p-autocomplete-placeholder-color | Placeholder color of root | | autocomplete.invalid.placeholder.color | --p-autocomplete-invalid-placeholder-color | Invalid placeholder color of root | | autocomplete.shadow | --p-autocomplete-shadow | Shadow of root | | autocomplete.padding.x | --p-autocomplete-padding-x | Padding x of root | | autocomplete.padding.y | --p-autocomplete-padding-y | Padding y of root | | autocomplete.border.radius | --p-autocomplete-border-radius | Border radius of root | | autocomplete.focus.ring.width | --p-autocomplete-focus-ring-width | Focus ring width of root | | autocomplete.focus.ring.style | --p-autocomplete-focus-ring-style | Focus ring style of root | | autocomplete.focus.ring.color | --p-autocomplete-focus-ring-color | Focus ring color of root | | autocomplete.focus.ring.offset | --p-autocomplete-focus-ring-offset | Focus ring offset of root | | autocomplete.focus.ring.shadow | --p-autocomplete-focus-ring-shadow | Focus ring shadow of root | | autocomplete.transition.duration | --p-autocomplete-transition-duration | Transition duration of root | | autocomplete.overlay.background | --p-autocomplete-overlay-background | Background of overlay | | autocomplete.overlay.border.color | --p-autocomplete-overlay-border-color | Border color of overlay | | autocomplete.overlay.border.radius | --p-autocomplete-overlay-border-radius | Border radius of overlay | | autocomplete.overlay.color | --p-autocomplete-overlay-color | Color of overlay | | autocomplete.overlay.shadow | --p-autocomplete-overlay-shadow | Shadow of overlay | | autocomplete.list.padding | --p-autocomplete-list-padding | Padding of list | | autocomplete.list.gap | --p-autocomplete-list-gap | Gap of list | | autocomplete.option.focus.background | --p-autocomplete-option-focus-background | Focus background of option | | autocomplete.option.selected.background | --p-autocomplete-option-selected-background | Selected background of option | | autocomplete.option.selected.focus.background | --p-autocomplete-option-selected-focus-background | Selected focus background of option | | autocomplete.option.color | --p-autocomplete-option-color | Color of option | | autocomplete.option.focus.color | --p-autocomplete-option-focus-color | Focus color of option | | autocomplete.option.selected.color | --p-autocomplete-option-selected-color | Selected color of option | | autocomplete.option.selected.focus.color | --p-autocomplete-option-selected-focus-color | Selected focus color of option | | autocomplete.option.padding | --p-autocomplete-option-padding | Padding of option | | autocomplete.option.border.radius | --p-autocomplete-option-border-radius | Border radius of option | | autocomplete.option.group.background | --p-autocomplete-option-group-background | Background of option group | | autocomplete.option.group.color | --p-autocomplete-option-group-color | Color of option group | | autocomplete.option.group.font.weight | --p-autocomplete-option-group-font-weight | Font weight of option group | | autocomplete.option.group.padding | --p-autocomplete-option-group-padding | Padding of option group | | autocomplete.dropdown.width | --p-autocomplete-dropdown-width | Width of dropdown | | autocomplete.dropdown.sm.width | --p-autocomplete-dropdown-sm-width | Sm width of dropdown | | autocomplete.dropdown.lg.width | --p-autocomplete-dropdown-lg-width | Lg width of dropdown | | autocomplete.dropdown.border.color | --p-autocomplete-dropdown-border-color | Border color of dropdown | | autocomplete.dropdown.hover.border.color | --p-autocomplete-dropdown-hover-border-color | Hover border color of dropdown | | autocomplete.dropdown.active.border.color | --p-autocomplete-dropdown-active-border-color | Active border color of dropdown | | autocomplete.dropdown.border.radius | --p-autocomplete-dropdown-border-radius | Border radius of dropdown | | autocomplete.dropdown.focus.ring.width | --p-autocomplete-dropdown-focus-ring-width | Focus ring width of dropdown | | autocomplete.dropdown.focus.ring.style | --p-autocomplete-dropdown-focus-ring-style | Focus ring style of dropdown | | autocomplete.dropdown.focus.ring.color | --p-autocomplete-dropdown-focus-ring-color | Focus ring color of dropdown | | autocomplete.dropdown.focus.ring.offset | --p-autocomplete-dropdown-focus-ring-offset | Focus ring offset of dropdown | | autocomplete.dropdown.focus.ring.shadow | --p-autocomplete-dropdown-focus-ring-shadow | Focus ring shadow of dropdown | | autocomplete.dropdown.background | --p-autocomplete-dropdown-background | Background of dropdown | | autocomplete.dropdown.hover.background | --p-autocomplete-dropdown-hover-background | Hover background of dropdown | | autocomplete.dropdown.active.background | --p-autocomplete-dropdown-active-background | Active background of dropdown | | autocomplete.dropdown.color | --p-autocomplete-dropdown-color | Color of dropdown | | autocomplete.dropdown.hover.color | --p-autocomplete-dropdown-hover-color | Hover color of dropdown | | autocomplete.dropdown.active.color | --p-autocomplete-dropdown-active-color | Active color of dropdown | | autocomplete.chip.border.radius | --p-autocomplete-chip-border-radius | Border radius of chip | | autocomplete.chip.focus.background | --p-autocomplete-chip-focus-background | Focus background of chip | | autocomplete.chip.focus.color | --p-autocomplete-chip-focus-color | Focus color of chip | | autocomplete.empty.message.padding | --p-autocomplete-empty-message-padding | Padding of empty message | --- # Angular AutoFocus Directive AutoFocus manages focus on focusable element on load. ## Basic AutoFocus is applied to any focusable input element with the pAutoFocus directive. **Example:** ```typescript import { Component } from '@angular/core'; import { InputTextModule } from '@openng/optimus-ui/inputtext'; @Component({ template: `
`, standalone: true, imports: [InputTextModule] }) export class AutofocusBasicDemo {} ``` ## Auto Focus AutoFocus manages focus on focusable element on load. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | autofocus | boolean | false | When present, it specifies that the component should automatically get focus on load. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | --- # Angular Avatar Component Avatar represents people using icons, labels and images. ## Accessibility Screen Reader Avatar does not include any roles and attributes by default. Any attribute is passed to the root element so you may add a role like img along with aria-labelledby or aria-label to describe the component. In case avatars need to be tabbable, tabIndex can be added as well to implement custom key handlers. Keyboard Support Component does not include any interactive elements. ## AvatarGroup Grouping is available by wrapping multiple Avatar components inside an AvatarGroup . **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
`, standalone: true, imports: [AvatarModule] }) export class AvatarAvatargroupDemo {} ``` ## avatargroupstyle-doc **Example:** ```typescript import { Component } from '@angular/core'; @Component({ template: `
Name Element
p-avatar-group Container element.
`, standalone: true, imports: [] }) export class AvatarAvatargroupstyleDemo {} ``` ## avatarstyle-doc Following is the list of structural style classes, for theming classes visit theming page. **Example:** ```typescript import { Component } from '@angular/core'; @Component({ template: `
Name Element
p-avatar Container element.
p-avatar-image Container element in image mode.
p-avatar-circle Container element with a circle shape.
p-avatar-text Text of the Avatar.
p-avatar-icon Icon of the Avatar.
p-avatar-lg Container element with a large size.
p-avatar-xl Container element with an xlarge size.
`, standalone: true, imports: [] }) export class AvatarAvatarstyleDemo {} ``` ## Badge A badge can be added to an Avatar with the Badge directive. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
`, standalone: true, imports: [AvatarModule] }) export class AvatarBadgeDemo {} ``` ## Icon A font icon is displayed as an Avatar with the icon property. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
Icon
Circle
Badge
`, standalone: true, imports: [AvatarModule] }) export class AvatarIconDemo {} ``` ## Image Use the image property to display an image as an Avatar. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
Image
Badge
Gravatar
`, standalone: true, imports: [AvatarModule] }) export class AvatarImageDemo {} ``` ## Label A letter Avatar is defined with the label property. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
Label
Circle
Badge
`, standalone: true, imports: [AvatarModule] }) export class AvatarLabelDemo {} ``` ## Shape Avatar comes in two different styles specified with the shape property, square is the default and circle is the alternative. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
`, standalone: true, imports: [AvatarModule] }) export class AvatarShapeDemo {} ``` ## Size size property defines the size of the Avatar with large and xlarge as possible values. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
`, standalone: true, imports: [AvatarModule] }) export class AvatarSizeDemo {} ``` ## Template Content can easily be customized with the dynamic content instead of using the built-in modes. **Example:** ```typescript import { Component } from '@angular/core'; import { AvatarModule } from '@openng/optimus-ui/avatar'; @Component({ template: `
`, standalone: true, imports: [AvatarModule] }) export class AvatarTemplateDemo {} ``` ## Avatar Avatar represents people using icons, labels and images. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | label | string | - | Defines the text to display. | | icon | string | - | Defines the icon to display. | | image | string | - | Defines the image to display. | | size | "large" \| "xlarge" \| "normal" | normal | Size of the element. | | shape | "circle" \| "square" | square | Shape of the element. | | styleClass | string | - | Class of the element. **(Deprecated)** | | ariaLabel | string | - | Establishes a string value that labels the component. | | ariaLabelledBy | string | - | Establishes relationships between the component and label(s) where its value should be one or more element IDs. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | ### Emits | Name | Parameters | Description | |------|------------|-------------| | onImageError | event: Event | This event is triggered if an error occurs while loading an image file. | ## Pass Through Options | Name | Type | Description | |------|------|-------------| | host | PassThroughOption | Used to pass attributes to the host's DOM element. | | root | PassThroughOption | Used to pass attributes to the root's DOM element. | | label | PassThroughOption | Used to pass attributes to the label's DOM element. | | icon | PassThroughOption | Used to pass attributes to the icon's DOM element. | | image | PassThroughOption | Used to pass attributes to the image's DOM element. | ## Theming ### CSS Classes | Class | Description | |-------|-------------| | p-avatar | Class name of the root element | | p-avatar-label | Class name of the label element | | p-avatar-icon | Class name of the icon element | | p-avatar-image | Container element in image mode | | p-avatar-circle | Container element with a circle shape | | p-avatar-lg | Container element with a large size | | p-avatar-xl | Container element with an xlarge size | ### Design Tokens | Token | CSS Variable | Description | |-------|--------------|-------------| | avatar.width | --p-avatar-width | Width of root | | avatar.height | --p-avatar-height | Height of root | | avatar.font.size | --p-avatar-font-size | Font size of root | | avatar.background | --p-avatar-background | Background of root | | avatar.color | --p-avatar-color | Color of root | | avatar.border.radius | --p-avatar-border-radius | Border radius of root | | avatar.icon.size | --p-avatar-icon-size | Size of icon | | avatar.group.border.color | --p-avatar-group-border-color | Border color of group | | avatar.group.offset | --p-avatar-group-offset | Offset of group | | avatar.lg.width | --p-avatar-lg-width | Width of lg | | avatar.lg.height | --p-avatar-lg-height | Height of lg | | avatar.lg.font.size | --p-avatar-lg-font-size | Font size of lg | | avatar.lg.icon.size | --p-avatar-lg-icon-size | Icon size of lg | | avatar.lg.group.offset | --p-avatar-lg-group-offset | Group offset of lg | | avatar.xl.width | --p-avatar-xl-width | Width of xl | | avatar.xl.height | --p-avatar-xl-height | Height of xl | | avatar.xl.font.size | --p-avatar-xl-font-size | Font size of xl | | avatar.xl.icon.size | --p-avatar-xl-icon-size | Icon size of xl | | avatar.xl.group.offset | --p-avatar-xl-group-offset | Group offset of xl | --- # Angular Badge Component Badge is a small status indicator for another element. ## Accessibility Screen Reader Badge does not include any roles and attributes by default, any attribute is passed to the root element so aria roles and attributes can be added if required. If the badges are dynamic, aria-live may be utilized as well. In case badges need to be tabbable, tabIndex can be added to implement custom key handlers. Keyboard Support Component does not include any interactive elements. ## Basic Content of the badge is specified using the value property. **Example:** ```typescript import { Component } from '@angular/core'; import { BadgeModule } from '@openng/optimus-ui/badge'; @Component({ template: `
`, standalone: true, imports: [BadgeModule] }) export class BadgeBasicDemo {} ``` ## Button Buttons have built-in support for badges to display a badge inline. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class BadgeButtonDemo {} ``` ## directive-doc Content of the badge is specified using the value property. **Example:** ```typescript import { Component } from '@angular/core'; @Component({ template: `
`, standalone: true, imports: [] }) export class BadgeDirectiveDemo {} ``` ## Overlay A badge can be added to any element by encapsulating the content with the OverlayBadge component. **Example:** ```typescript import { Component } from '@angular/core'; import { OverlayBadgeModule } from '@openng/optimus-ui/overlaybadge'; @Component({ template: `
`, standalone: true, imports: [OverlayBadgeModule] }) export class BadgeOverlayDemo {} ``` ## position-doc A Badge can be positioned at the top right corner of an element by adding p-overlay-badge style class to the element and embedding the badge inside. **Example:** ```typescript import { Component } from '@angular/core'; @Component({ template: `
`, standalone: true, imports: [] }) export class BadgePositionDemo {} ``` ## Severity Severity defines the color of the badge, possible values are success , info , warn and danger **Example:** ```typescript import { Component } from '@angular/core'; import { BadgeModule } from '@openng/optimus-ui/badge'; @Component({ template: `
`, standalone: true, imports: [BadgeModule] }) export class BadgeSeverityDemo {} ``` ## Size Badge sizes are adjusted with the badgeSize property that accepts small , large and xlarge as the possible alternatives to the default size. Currently sizes only apply to component mode. **Example:** ```typescript import { Component } from '@angular/core'; import { BadgeModule } from '@openng/optimus-ui/badge'; @Component({ template: `
`, standalone: true, imports: [BadgeModule] }) export class BadgeSizeDemo {} ``` ## Badge Directive Badge Directive is directive usage of badge component. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | ptBadgeDirective | InputSignal | undefined | Used to pass attributes to DOM elements inside the Badge component. **(Deprecated)** | | pBadgePT | InputSignal | undefined | Used to pass attributes to DOM elements inside the Badge component. | | pBadgeUnstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | disabled | boolean | false | When specified, disables the component. | | badgeSize | "small" \| "large" \| "xlarge" | - | Size of the badge, valid options are "large" and "xlarge". | | size | "small" \| "large" \| "xlarge" | - | Size of the badge, valid options are "large" and "xlarge". **(Deprecated)** | | severity | "success" \| "info" \| "warn" \| "danger" \| "secondary" \| "contrast" | - | Severity type of the badge. | | value | string \| number | - | Value to display inside the badge. | | badgeStyle | { [klass: string]: any } | - | Inline style of the element. | | badgeStyleClass | string | - | Class of the element. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | ## Badge Badge is a small status indicator for another element. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | styleClass | InputSignal | ... | Class of the element. **(Deprecated)** | | badgeSize | InputSignal<"small" \| "large" \| "xlarge"> | ... | Size of the badge, valid options are "large" and "xlarge". | | size | InputSignal<"small" \| "large" \| "xlarge"> | ... | Size of the badge, valid options are "large" and "xlarge". | | severity | InputSignal<"success" \| "info" \| "warn" \| "danger" \| "secondary" \| "contrast"> | ... | Severity type of the badge. | | value | InputSignal | ... | Value to display inside the badge. | | badgeDisabled | InputSignalWithTransform | ... | When specified, disables the component. | | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | ## Pass Through Options | Name | Type | Description | |------|------|-------------| | host | PassThroughOption | Used to pass attributes to the host's DOM element. | | root | PassThroughOption | Used to pass attributes to the root's DOM element. | ## Theming ### CSS Classes | Class | Description | |-------|-------------| | p-badge | Class name of the root element | ### Design Tokens | Token | CSS Variable | Description | |-------|--------------|-------------| | badge.border.radius | --p-badge-border-radius | Border radius of root | | badge.padding | --p-badge-padding | Padding of root | | badge.font.size | --p-badge-font-size | Font size of root | | badge.font.weight | --p-badge-font-weight | Font weight of root | | badge.min.width | --p-badge-min-width | Min width of root | | badge.height | --p-badge-height | Height of root | | badge.dot.size | --p-badge-dot-size | Size of dot | | badge.sm.font.size | --p-badge-sm-font-size | Font size of sm | | badge.sm.min.width | --p-badge-sm-min-width | Min width of sm | | badge.sm.height | --p-badge-sm-height | Height of sm | | badge.lg.font.size | --p-badge-lg-font-size | Font size of lg | | badge.lg.min.width | --p-badge-lg-min-width | Min width of lg | | badge.lg.height | --p-badge-lg-height | Height of lg | | badge.xl.font.size | --p-badge-xl-font-size | Font size of xl | | badge.xl.min.width | --p-badge-xl-min-width | Min width of xl | | badge.xl.height | --p-badge-xl-height | Height of xl | | badge.primary.background | --p-badge-primary-background | Background of primary | | badge.primary.color | --p-badge-primary-color | Color of primary | | badge.secondary.background | --p-badge-secondary-background | Background of secondary | | badge.secondary.color | --p-badge-secondary-color | Color of secondary | | badge.success.background | --p-badge-success-background | Background of success | | badge.success.color | --p-badge-success-color | Color of success | | badge.info.background | --p-badge-info-background | Background of info | | badge.info.color | --p-badge-info-color | Color of info | | badge.warn.background | --p-badge-warn-background | Background of warn | | badge.warn.color | --p-badge-warn-color | Color of warn | | badge.danger.background | --p-badge-danger-background | Background of danger | | badge.danger.color | --p-badge-danger-color | Color of danger | | badge.contrast.background | --p-badge-contrast-background | Background of contrast | | badge.contrast.color | --p-badge-contrast-color | Color of contrast | --- # Angular BlockUI Component BlockUI can either block other components or the whole page. ## Accessibility Screen Reader BlockUI manages aria-busy state attribute when the UI gets blocked and unblocked. Any valid attribute is passed to the root element so additional attributes like role and aria-live can be used to define live regions. Keyboard Support Component does not include any interactive elements. ## Basic The element to block should be placed as a child of BlockUI and blocked property is required to control the state. **Example:** ```typescript import { Component } from '@angular/core'; import { BlockUIModule } from '@openng/optimus-ui/blockui'; import { ButtonModule } from '@openng/optimus-ui/button'; import { PanelModule } from '@openng/optimus-ui/panel'; @Component({ template: `

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

`, standalone: true, imports: [BlockUIModule, ButtonModule, PanelModule] }) export class BlockuiBasicDemo { blockedPanel: boolean = false; } ``` ## Document If the target element is not specified, BlockUI blocks the document by default. **Example:** ```typescript import { Component } from '@angular/core'; import { BlockUIModule } from '@openng/optimus-ui/blockui'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [BlockUIModule, ButtonModule] }) export class BlockuiDocumentDemo { blockedDocument: boolean = false; } ``` ## Block U I BlockUI can either block other components or the whole page. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | | target | any | - | Name of the local ng-template variable referring to another component. | | autoZIndex | boolean | true | Whether to automatically manage layering. | | baseZIndex | number | 0 | Base zIndex value to use in layering. | | styleClass | string | - | Class of the element. **(Deprecated)** | | blocked | boolean | - | Current blocked state as a boolean. | ### Templates | Name | Type | Description | |------|------|-------------| | content | TemplateRef | template of the content | ## Pass Through Options | Name | Type | Description | |------|------|-------------| | host | PassThroughOption | Used to pass attributes to the host's DOM element. | | root | PassThroughOption | Used to pass attributes to the root's DOM element. | ## Theming ### CSS Classes | Class | Description | |-------|-------------| | p-blockui | Class name of the root element | ### Design Tokens | Token | CSS Variable | Description | |-------|--------------|-------------| | blockui.border.radius | --p-blockui-border-radius | Border radius of root | --- # Angular Breadcrumb Component Breadcrumb provides contextual information about page hierarchy. ## Accessibility Screen Reader Breadcrumb uses the nav element and since any attribute is passed to the root implicitly aria-labelledby or aria-label can be used to describe the component. Inside an ordered list is used where the list item separators have aria-hidden to be able to ignored by the screen readers. If the last link represents the current route, aria-current is added with "page" as the value. Keyboard Support No special keyboard interaction is needed, all menuitems are focusable based on the page tab sequence. ## Basic Breadcrumb provides contextual information about page hierarchy. **Example:** ```typescript import { Component, OnInit } from '@angular/core'; import { BreadcrumbModule } from '@openng/optimus-ui/breadcrumb'; import { MenuItem } from '@openng/optimus-ui/api'; @Component({ template: `
`, standalone: true, imports: [BreadcrumbModule] }) export class BreadcrumbBasicDemo implements OnInit { items: MenuItem[] | undefined; home: MenuItem | undefined; ngOnInit() { this.items = [{ label: 'Electronics' }, { label: 'Computer' }, { label: 'Accessories' }, { label: 'Keyboard' }, { label: 'Wireless' }]; this.home = { icon: 'pi pi-home' }; } } ``` ## Router Menu items support navigation via routerLink, programmatic routing using commands, or external URLs. **Example:** ```typescript import { Component } from '@angular/core'; import { BreadcrumbModule } from '@openng/optimus-ui/breadcrumb'; import { MenuItem } from '@openng/optimus-ui/api'; @Component({ template: `
`, standalone: true, imports: [BreadcrumbModule] }) export class BreadcrumbRouterDemo { items: MenuItem[] = [{ label: 'Components' }, { label: 'Form' }, { label: 'InputText', routerLink: '/inputtext' }]; home: MenuItem = { icon: 'pi pi-home', routerLink: '/' }; } ``` ## Template Custom content can be placed inside the items using the item template. The divider between the items has its own separator template. **Example:** ```typescript import { Component, OnInit } from '@angular/core'; import { BreadcrumbModule } from '@openng/optimus-ui/breadcrumb'; import { MenuItem } from '@openng/optimus-ui/api'; @Component({ template: `
/
`, standalone: true, imports: [BreadcrumbModule] }) export class BreadcrumbTemplateDemo implements OnInit { items: MenuItem[] | undefined; home: MenuItem | undefined; ngOnInit() { this.items = [{ icon: 'pi pi-sitemap' }, { icon: 'pi pi-book' }, { icon: 'pi pi-wallet' }, { icon: 'pi pi-shopping-bag' }, { icon: 'pi pi-calculator' }]; this.home = { icon: 'pi pi-home' }; } } ``` ## Breadcrumb Breadcrumb provides contextual information about page hierarchy. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | | model | MenuItem[] | - | An array of menuitems. | | style | { [klass: string]: any } | - | Inline style of the component. | | styleClass | string | - | Style class of the component. | | home | MenuItem | - | MenuItem configuration for the home icon. | | homeAriaLabel | string | - | Defines a string that labels the home icon for accessibility. | ### Emits | Name | Parameters | Description | |------|------------|-------------| | onItemClick | event: BreadcrumbItemClickEvent | Fired when an item is selected. | ### Templates | Name | Type | Description | |------|------|-------------| | item | TemplateRef | Custom item template. | | separator | TemplateRef | Custom separator template. | ## Pass Through Options | Name | Type | Description | |------|------|-------------| | root | PassThroughOption | Used to pass attributes to the root's DOM element. | | list | PassThroughOption | Used to pass attributes to the list's DOM element. | | homeItem | PassThroughOption | Used to pass attributes to the home item's DOM element. | | item | PassThroughOption | Used to pass attributes to the item's DOM element. | | itemLink | PassThroughOption | Used to pass attributes to the item link's DOM element. | | itemIcon | PassThroughOption | Used to pass attributes to the item icon's DOM element. | | itemLabel | PassThroughOption | Used to pass attributes to the item label's DOM element. | | separator | PassThroughOption | Used to pass attributes to the separator's DOM element. | | separatorIcon | PassThroughOption | Used to pass attributes to the separator icon's DOM element. | ## Theming ### CSS Classes | Class | Description | |-------|-------------| | p-breadcrumb | Class name of the root element | | p-breadcrumb-list | Class name of the list element | | p-breadcrumb-home-item | Class name of the home item element | | p-breadcrumb-separator | Class name of the separator element | | p-breadcrumb-item | Class name of the item element | | p-breadcrumb-item-link | Class name of the item link element | | p-breadcrumb-item-icon | Class name of the item icon element | | p-breadcrumb-item-label | Class name of the item label element | ### Design Tokens | Token | CSS Variable | Description | |-------|--------------|-------------| | breadcrumb.padding | --p-breadcrumb-padding | Padding of root | | breadcrumb.background | --p-breadcrumb-background | Background of root | | breadcrumb.gap | --p-breadcrumb-gap | Gap of root | | breadcrumb.transition.duration | --p-breadcrumb-transition-duration | Transition duration of root | | breadcrumb.item.color | --p-breadcrumb-item-color | Color of item | | breadcrumb.item.hover.color | --p-breadcrumb-item-hover-color | Hover color of item | | breadcrumb.item.border.radius | --p-breadcrumb-item-border-radius | Border radius of item | | breadcrumb.item.gap | --p-breadcrumb-item-gap | Gap of item | | breadcrumb.item.icon.color | --p-breadcrumb-item-icon-color | Icon color of item | | breadcrumb.item.icon.hover.color | --p-breadcrumb-item-icon-hover-color | Icon hover color of item | | breadcrumb.item.focus.ring.width | --p-breadcrumb-item-focus-ring-width | Focus ring width of item | | breadcrumb.item.focus.ring.style | --p-breadcrumb-item-focus-ring-style | Focus ring style of item | | breadcrumb.item.focus.ring.color | --p-breadcrumb-item-focus-ring-color | Focus ring color of item | | breadcrumb.item.focus.ring.offset | --p-breadcrumb-item-focus-ring-offset | Focus ring offset of item | | breadcrumb.item.focus.ring.shadow | --p-breadcrumb-item-focus-ring-shadow | Focus ring shadow of item | | breadcrumb.separator.color | --p-breadcrumb-separator-color | Color of separator | --- # Angular Button Component Button is an extension to standard button element with icons and theming. ## Accessibility Screen Reader Button component renders a native button element that implicitly includes any passed prop. Text to describe the button is defined with the aria-label prop, if not present label prop is used as the value. If the button is icon only or custom templating is used, it is recommended to use aria-label so that screen readers would be able to read the element properly. ## Badge Buttons have built-in badge support with badge and badgeClass properties. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonBadgeDemo {} ``` ## Basic Text to display on a button is defined with the label property. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonBasicDemo {} ``` ## Button Group Multiple buttons are grouped when wrapped inside an element with ButtonGroup component. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonButtongroupDemo {} ``` ## buttonset-doc Multiple buttons are grouped when wrapped inside an element with p-buttonset class. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; import { RippleModule } from '@openng/optimus-ui/ripple'; @Component({ template: `
`, standalone: true, imports: [ButtonModule, RippleModule] }) export class ButtonButtonsetDemo {} ``` ## Directive Button can also be used as directive using pButton along with pButtonLabel and pButtonIcon helper directives. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonDirectiveDemo {} ``` ## Disabled When disabled is present, the element cannot be edited and focused. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonDisabledDemo {} ``` ## Icons Icon of a button is specified with icon property and position is configured using iconPos attribute. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonIconsDemo {} ``` ## iconsonly-doc Buttons can have icons without labels. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonIconsonlyDemo {} ``` ## Link A button can be rendered as a link when link property is present, while the pButton directive can be applied on an anchor element to style the link as a button. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: ` `, standalone: true, imports: [ButtonModule] }) export class ButtonLinkDemo {} ``` ## Loading Busy state is controlled with the loading property. **Example:** ```typescript import { Component, signal } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonLoadingDemo { loading = signal(false); load() { this.loading.set(true); setTimeout(() => { this.loading.set(false); }, 2000); } } ``` ## Outlined Outlined buttons display a border without a background initially. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonOutlinedDemo {} ``` ## Raised Raised buttons display a shadow to indicate elevation. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonRaisedDemo {} ``` ## Raised Text Text buttons can be displayed as raised for elevation. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonRaisedtextDemo {} ``` ## Rounded Rounded buttons have a circular border radius. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonRoundedDemo {} ``` ## Severity Severity defines the type of button. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonSeverityDemo {} ``` ## Sizes Button provides small and large sizes as alternatives to the standard. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonSizesDemo {} ``` ## Template Custom content inside a button is defined as children. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonTemplateDemo {} ``` ## Text Text buttons are displayed as textual elements. **Example:** ```typescript import { Component } from '@angular/core'; import { ButtonModule } from '@openng/optimus-ui/button'; @Component({ template: `
`, standalone: true, imports: [ButtonModule] }) export class ButtonTextDemo {} ``` ## Button Directive Button directive is an extension to button component. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | | ptButtonDirective | InputSignal | undefined | Used to pass attributes to DOM elements inside the Button component. **(Deprecated)** | | pButtonPT | InputSignal | undefined | Used to pass attributes to DOM elements inside the Button component. | | pButtonUnstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | text | boolean | false | Add a textual class to the button without a background initially. | | plain | boolean | false | Add a plain textual class to the button without a background initially. | | raised | boolean | false | Add a shadow to indicate elevation. | | size | "small" \| "large" | - | Defines the size of the button. | | outlined | boolean | false | Add a border class without a background initially. | | rounded | boolean | false | Add a circular border radius to the button. | | iconPos | ButtonIconPosition | left | Position of the icon. | | loadingIcon | string | - | Icon to display in loading state. | | fluid | InputSignalWithTransform | undefined | Spans 100% width of the container when enabled. | | label | string | - | Text of the button. **(Deprecated)** | | icon | string | - | Name of the icon. **(Deprecated)** | | loading | boolean | - | Whether the button is in loading state. | | buttonProps | ButtonProps | - | Used to pass all properties of the ButtonProps to the Button component. **(Deprecated)** | | severity | ButtonSeverity | - | Defines the style of the button. | ## Button Button is an extension to standard button element with icons and theming. ### Props | Name | Type | Default | Description | |------|------|---------|-------------| | dt | InputSignal | undefined | Defines scoped design tokens of the component. | | unstyled | InputSignal | undefined | Indicates whether the component should be rendered without styles. | | pt | InputSignal | undefined | Used to pass attributes to DOM elements inside the component. | | ptOptions | InputSignal | undefined | Used to configure passthrough(pt) options of the component. | | type | string | button | Type of the button. | | badge | string | - | Value of the badge. | | disabled | boolean | false | When present, it specifies that the component should be disabled. | | raised | boolean | false | Add a shadow to indicate elevation. | | rounded | boolean | false | Add a circular border radius to the button. | | text | boolean | false | Add a textual class to the button without a background initially. | | plain | boolean | false | Add a plain textual class to the button without a background initially. | | outlined | boolean | false | Add a border class without a background initially. | | link | boolean | false | Add a link style to the button. | | tabindex | number | - | Add a tabindex to the button. | | size | "small" \| "large" | - | Defines the size of the button. | | variant | "text" \| "outlined" | - | Specifies the variant of the component. | | style | { [klass: string]: any } | - | Inline style of the element. | | styleClass | string | - | Class of the element. | | badgeClass | string | - | Style class of the badge. **(Deprecated)** | | badgeSeverity | "success" \| "info" \| "warn" \| "danger" \| "help" \| "primary" \| "secondary" \| "contrast" | secondary | Severity type of the badge. | | ariaLabel | string | - | Used to define a string that autocomplete attribute the current element. | | autofocus | boolean | false | When present, it specifies that the component should automatically get focus on load. | | iconPos | ButtonIconPosition | left | Position of the icon. | | icon | string | - | Name of the icon. | | label | string | - | Text of the button. | | loading | boolean | false | Whether the button is in loading state. | | loadingIcon | string | - | Icon to display in loading state. | | severity | ButtonSeverity | - | Defines the style of the button. | | buttonProps | ButtonProps | - | Used to pass all properties of the ButtonProps to the Button component. | | fluid | InputSignalWithTransform | undefined | Spans 100% width of the container when enabled. | ### Emits | Name | Parameters | Description | |------|------------|-------------| | onClick | event: MouseEvent | Callback to execute when button is clicked. This event is intended to be used with the component. Using a regular