### BEM SCSS Implementation Example Source: https://github.com/brisanet/ion-plus/blob/main/docs/bem- style-guide.md Shows how to implement the BEM naming convention using SCSS, leveraging parent selectors for cleaner nesting. This example demonstrates the structure for a header component with its elements. ```scss .header { // rules &__logo { // rules } &__search { // rules } &__list { // rules } &__item { // rules } } ``` -------------------------------- ### BEM CSS Examples Source: https://github.com/brisanet/ion-plus/blob/main/docs/bem- style-guide.md Demonstrates BEM naming conventions for CSS classes, including block modifiers and element selectors. These examples illustrate how to apply BEM for different states and variations of components. ```css .button--red { ... }; .button--blue { ... }; .button--sm { ... } .button--md { ... } ``` -------------------------------- ### BEM HTML Structure Example Source: https://github.com/brisanet/ion-plus/blob/main/docs/bem- style-guide.md Illustrates the BEM naming convention applied to HTML elements for a header component. This example shows how to structure parent blocks, child elements, and nested lists using BEM syntax. ```html
``` -------------------------------- ### BEM Conditional Element Example Source: https://github.com/brisanet/ion-plus/blob/main/docs/bem- style-guide.md Illustrates how to combine block and modifier classes with element classes in HTML to represent conditional states. This example shows a button that is in a 'loading' state with a spinner element. ```html ``` -------------------------------- ### IonIconComponent Examples in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt Shows how to use the IonIconComponent from the Ion Plus library in Angular. Demonstrates basic icon usage, custom size and color, and different highlight effects. ```typescript import { Component } from '@angular/core'; import { IonIconComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-icons', standalone: true, imports: [IonIconComponent], template: ` ` }) export class IconsComponent {} ``` -------------------------------- ### IonButtonComponent Examples in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt Demonstrates the usage of the IonButtonComponent from the Ion Plus library in an Angular application. Shows various styles, sizes, states, and icon configurations for buttons. ```typescript import { Component } from '@angular/core'; import { IonButtonComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-example', standalone: true, imports: [IonButtonComponent], template: ` ` }) export class ExampleComponent { isLoading = false; handleClick(): void { this.isLoading = true; // Perform action } } ``` -------------------------------- ### Clone and Run Ion Plus Project Source: https://github.com/brisanet/ion-plus/blob/main/README.md Clones the Ion Plus repository and installs its dependencies using yarn. This is for running the project locally, often for development or testing purposes. ```bash git clone https://github.com/Brisanet/ion-plus.git yarn install yarn run storybook ``` -------------------------------- ### Install Ion Plus Package Source: https://github.com/brisanet/ion-plus/blob/main/README.md Installs the Ion Plus package as a dependency in your project using npm. This is the primary method for integrating Ion Plus into your existing applications. ```bash npm i @brisanet/ion-plus ``` -------------------------------- ### BEM Nested Element Structure Example Source: https://github.com/brisanet/ion-plus/blob/main/docs/bem- style-guide.md Demonstrates two approaches for handling nested elements within a BEM structure. The first uses a single block with nested elements, while the second introduces a new block for the nested component. ```html or ``` -------------------------------- ### IonAlertComponent Examples in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt Illustrates the implementation of the IonAlertComponent from the Ion Plus library in Angular. Covers different alert types, closable alerts, and custom content using ng-template. ```typescript import { Component } from '@angular/core'; import { IonAlertComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-alerts', standalone: true, imports: [IonAlertComponent], template: `

Custom Alert Content

This is a fully customized alert body.

` }) export class AlertsComponent {} ``` -------------------------------- ### Implement Tab Navigation with IonTabGroupComponent (TypeScript) Source: https://context7.com/brisanet/ion-plus/llms.txt Illustrates the usage of the IonTabGroupComponent for creating tabbed interfaces. It covers both horizontal and vertical tab layouts, customizable borders, and size options. The example also shows how to handle tab selection events and dynamically render content based on the active tab. ```typescript import { Component } from '@angular/core'; import { IonTabGroupComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-tabs', standalone: true, imports: [IonTabGroupComponent], template: ` @switch (activeTab) { @case ('overview') {
Overview content here
} @case ('details') {
Details content here
} @case ('settings') {
Settings content here
} } ` }) export class TabsComponent { activeTab = 'overview'; tabs = [ { label: 'Overview', selected: true }, { label: 'Details', selected: false }, { label: 'Settings', selected: false }, { label: 'Disabled', selected: false, disabled: true } ]; verticalTabs = [ { label: 'Profile', selected: true, iconType: 'user' }, { label: 'Security', selected: false, iconType: 'lock' }, { label: 'Notifications', selected: false, iconType: 'bell' } ]; onTabSelect(tab: any): void { this.activeTab = tab.label.toLowerCase(); console.log('Selected tab:', tab); } } ``` -------------------------------- ### IonSwitchComponent: Toggle Switch in Angular with Reactive Forms Source: https://context7.com/brisanet/ion-plus/llms.txt Details the IonSwitchComponent for creating toggle switches in Angular, supporting ControlValueAccessor for seamless integration with reactive forms. Examples include basic usage, different sizes, disabled states, and form control binding. ```typescript import { Component } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { IonSwitchComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-switches', standalone: true, imports: [IonSwitchComponent, ReactiveFormsModule], template: ` ` }) export class SwitchesComponent { notificationsEnabled = true; smallSwitch = false; mediumSwitch = true; largeSwitch = false; disabledValue = true; darkModeControl = new FormControl(false); onToggle(value: boolean): void { console.log('Notifications:', value ? 'enabled' : 'disabled'); } } ``` -------------------------------- ### Displaying Configuration Title (Angular-like) Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/modal/modal.component.html Displays the title fetched from the application's configuration. This directive assumes a `configuration().title` property exists and holds the string to be displayed. ```html {{ configuration().title }} ``` -------------------------------- ### Conditional Rendering Logic in ION-Plus Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/badge/badge.component.html This snippet demonstrates conditional rendering based on the 'dot()' function. If 'dot()' returns true, it further checks 'showIcon()' and 'showLabel()'. If 'showLabel()' is true, it displays the 'label()'. Otherwise, if 'dot()' is false, it displays 'displayLabel()'. ```C# @if (dot()) { @if (showIcon()) { } @if (showLabel()) { {{ label() }} } } @else { {{ displayLabel() }} } ``` -------------------------------- ### IonTagComponent: Categorization Labels in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt Illustrates the IonTagComponent for creating customizable labels or tags in Angular. Supports various status colors, outline/filled styles, and optional icons. Requires @brisanet/ion-plus. ```typescript import { Component } from '@angular/core'; import { IonTagComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-tags', standalone: true, imports: [IonTagComponent], template: ` ` }) export class TagsComponent {} ``` -------------------------------- ### Configure Prettier in VS Code Source: https://github.com/brisanet/ion-plus/blob/main/README.md Configures VS Code to use Prettier for code formatting on save, integrating with ESLint for consistent code style. This ensures code quality and maintainability. ```json { "editor.formatOnSave": true, "prettier.eslintIntegration": true } ``` -------------------------------- ### Conditional Description Display in ION Plus Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/alert/alert.component.html This code illustrates the conditional display of a description in the ION Plus project. It checks if a description is present and renders it if the condition is met. This is useful for providing additional context or details. ```html @if (!!description()) { {{ description() }} } ``` -------------------------------- ### Display Toast Notifications with IonNotificationService (TypeScript) Source: https://context7.com/brisanet/ion-plus/llms.txt Demonstrates how to use the IonNotificationService to display various types of toast notifications including success, info, warning, and error messages. It also shows how to configure custom animations and auto-dismiss behavior. This service is crucial for providing user feedback within the application. ```typescript import { Component, inject } from '@angular/core'; import { IonNotificationService, IonButtonComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-notifications', standalone: true, imports: [IonButtonComponent], template: ` ` }) export class NotificationsComponent { private notificationService = inject(IonNotificationService); showSuccess(): void { this.notificationService.success( 'Success!', 'Your changes have been saved successfully.', { fadeIn: 'fadeInUp', fadeOut: 'fadeOutUp' }, () => console.log('Success notification closed') ); } showInfo(): void { this.notificationService.info( 'Information', 'New updates are available for your application.', { icon: 'info-solid' } ); } showWarning(): void { this.notificationService.warning( 'Warning', 'Please review your input before proceeding.', { fadeIn: 'fadeInRight', fadeOut: 'fadeOutRight' } ); } showError(): void { this.notificationService.error( 'Error', 'An unexpected error occurred. Please try again.', { icon: 'close-solid' }, () => console.log('Error notification closed') ); } showFixed(): void { this.notificationService.info( 'Fixed Notification', 'This notification will not auto-dismiss. Click the close button to remove it.', { fixed: true } ); } } ``` -------------------------------- ### Creating Styled Links with IonLinkComponent in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt The IonLinkComponent provides styled link elements with icon support and click handling. It can be configured with various properties like 'label', 'link', 'target', 'icon', 'iconSide', 'size', 'bold', and 'disabled'. ```typescript import { Component } from '@angular/core'; import { IonLinkComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-links', standalone: true, imports: [IonLinkComponent], template: ` ` }) export class LinksComponent { goBack(): void { history.back(); } } ``` -------------------------------- ### IonModalService: Programmatic Modal Dialogs with Custom Components Source: https://context7.com/brisanet/ion-plus/llms.txt The IonModalService allows for the programmatic opening of modal dialogs. It supports custom components as modal content, various configuration options for titles, dimensions, footers, and header buttons, as well as alert-style modals. The service returns an observable to handle modal interactions and data. ```typescript import { Component, inject } from '@angular/core'; import { IonModalService, IonButtonComponent } from '@brisanet/ion-plus'; // Custom modal content component @Component({ selector: 'app-user-form', standalone: true, template: `
` }) export class UserFormComponent { name = ''; email = ''; } @Component({ selector: 'app-modal-example', standalone: true, imports: [IonButtonComponent], template: ` ` }) export class ModalExampleComponent { private modalService = inject(IonModalService); openModal(): void { const { id, observable } = this.modalService.open(UserFormComponent, { title: 'Create User', width: 500, params: { name: 'Default Name', email: '' }, footer: { showDivider: true, primaryButton: { label: 'Save', icon: { type: 'check-solid' } }, secondaryButton: { label: 'Cancel' } }, headerButton: { label: 'Help', icon: { type: 'info-solid' } } }); observable.subscribe(response => { if (response.action === 'onConfirm') { console.log('Form data:', response.instance); // Access form data: response.instance?.name, response.instance?.email } else if (response.action === 'onClose') { console.log('Modal closed'); } else if (response.action === 'onHeaderAction') { console.log('Header button clicked'); } }); } openConfirmation(): void { const { observable } = this.modalService.open(UserFormComponent, { title: 'Confirm Action', width: 400, alert: { type: 'warning', message: 'Are you sure?', description: 'This action cannot be undone.' }, footer: { primaryButton: { label: 'Confirm' }, secondaryButton: { label: 'Cancel' } }, preventCloseOnEscKey: true }); observable.subscribe(response => { if (response.action === 'onConfirm') { // Perform action this.modalService.close(); } }); } } ``` -------------------------------- ### IonAccordionComponent: Collapsible Panels in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt Demonstrates the IonAccordionComponent for creating collapsible accordion panels in Angular. It supports single and multiple open panels, and allows for custom header and body templates. Requires @brisanet/ion-plus. ```typescript import { Component } from '@angular/core'; import { IonAccordionComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-accordion', standalone: true, imports: [IonAccordionComponent], template: `
{{ item.title }} @if (item.badge) { {{ item.badge }} }

{{ item.content }}

@if (item.details) { }
` }) export class AccordionComponent { faqs = [ { title: 'What is Ion Plus?', content: 'Ion Plus is a modern Angular component library.', show: false }, { title: 'How do I install it?', content: 'Run npm i @brisanet/ion-plus', show: false }, { title: 'Is it free?', content: 'Yes, Ion Plus is open source.', show: true } ]; sections = [ { title: 'Features', badge: 'New', content: 'Check out our latest features:', details: ['Dark mode', 'Responsive design', 'Accessibility'], show: true }, { title: 'Documentation', content: 'Visit our Storybook for detailed documentation.', show: false } ]; onAccordionChange(item: any): void { console.log('Accordion changed:', item); } } ``` -------------------------------- ### Conditional Rendering based on Type Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/avatar/avatar.component.html This snippet demonstrates conditional rendering using a switch statement based on the result of the `type()` function. It handles different cases ('initials', 'icon', 'photo') to display appropriate content. Dependencies include the `type()` and `initials()` functions. ```html @switch (type()) { @case ('initials') { {{ initials() }} } @case ('icon') { } @case ('photo') { } } ``` -------------------------------- ### IonSpinnerComponent: Display Loading Indicators in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt The IonSpinnerComponent is used to display loading indicators. It offers customization options for size, color (including custom hex codes), and the ability to display accompanying text with adjustable text sizes. This component is part of the Ion-Plus library and requires Angular. ```typescript import { Component } from '@angular/core'; import { IonSpinnerComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-spinners', standalone: true, imports: [IonSpinnerComponent], template: ` ` }) export class SpinnersComponent {} ``` -------------------------------- ### IonCheckboxComponent: Basic and Advanced Usage in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt Demonstrates the IonCheckboxComponent for basic checkboxes, disabled states, indeterminate states, and lists of checkboxes in an Angular application. It utilizes two-way binding and event handling for managing checkbox states. ```typescript import { Component } from '@angular/core'; import { IonCheckboxComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-checkboxes', standalone: true, imports: [IonCheckboxComponent], template: ` @for (item of items; track item.value) { } ` }) export class CheckboxesComponent { termsAccepted = false; selectAll = false; isIndeterminate = false; items = [ { label: 'Option 1', value: '1', checked: false }, { label: 'Option 2', value: '2', checked: true }, { label: 'Option 3', value: '3', checked: false } ]; onSelectAllChange(checked: boolean): void { this.items.forEach(item => item.checked = checked); this.isIndeterminate = false; } } ``` -------------------------------- ### IonPopoverDirective: Create and Configure Popovers in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt The IonPopoverDirective allows for the creation of dynamic popovers in Angular applications. It supports custom content, action buttons, different trigger mechanisms (click, hover), and control over popover behavior like persistence and close icons. Dependencies include Angular's Component and specific Ion-Plus components. ```typescript import { Component } from '@angular/core'; import { IonPopoverDirective, IonButtonComponent, IonPositions } from '@brisanet/ion-plus'; @Component({ selector: 'app-popovers', standalone: true, imports: [IonPopoverDirective, IonButtonComponent], template: `

This is the popover content.

Are you sure you want to proceed?

Quick information tooltip-like popover.

` }) export class PopoversComponent { positions = IonPositions; popoverActions = [ { label: 'Confirm', type: 'primary' as const }, { label: 'Cancel', type: 'secondary' as const } ]; onConfirm(): void { console.log('Confirmed'); } onCancel(): void { console.log('Cancelled'); } } ``` -------------------------------- ### Conditional Rendering with Disabled and Loading States (C#) Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/button/button.component.html This snippet demonstrates conditional rendering logic using Razor syntax. It checks if a component is disabled or loading before rendering specific content. No external dependencies are explicitly mentioned. ```csharp @if (!disabled() && loading()) { } ``` -------------------------------- ### Conditional Rendering with Icon Type Check (C#) Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/button/button.component.html This snippet shows an alternative conditional rendering path based on the presence and type of an icon. It's useful for dynamically displaying UI elements related to icons. No external dependencies are explicitly mentioned. ```csharp @else if (icon() && icon()?.type) { } ``` -------------------------------- ### IonTooltipDirective: Add Tooltips to Elements (TypeScript) Source: https://context7.com/brisanet/ion-plus/llms.txt The IonTooltipDirective allows adding customizable tooltips to any HTML element. It supports various trigger methods (hover, click), positions, and delays, and can even render custom template content. This directive is part of the @brisanet/ion-plus library. ```typescript import { Component } from '@angular/core'; import { IonTooltipDirective, IonButtonComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-tooltips', standalone: true, imports: [IonTooltipDirective, IonButtonComponent], template: `
Custom Tooltip

With rich HTML content

` }) export class TooltipsComponent {} ``` -------------------------------- ### IonStepsComponent: Multi-step Workflow Indicator (Angular) Source: https://context7.com/brisanet/ion-plus/llms.txt The IonStepsComponent is an Angular component used to display a progress indicator for multi-step workflows. It supports basic step display, clickable navigation, disabled states, and status indicators. It requires Angular and the '@brisanet/ion-plus' library. Input properties include 'steps', 'current', 'clickable', and 'disabled'. Output events include 'currentChange'. ```typescript import { Component } from '@angular/core'; import { IonStepsComponent, IonButtonComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-steps', standalone: true, imports: [IonStepsComponent, IonButtonComponent], template: `
` }) export class StepsComponent { currentStep = 1; isProcessing = false; steps = [ { label: 'Account Setup', description: 'Create your account' }, { label: 'Profile', description: 'Complete your profile' }, { label: 'Verification', description: 'Verify your email' }, { label: 'Complete', description: 'All done!' } ]; statusSteps = [ { label: 'Completed', status: 'checked' as const }, { label: 'In Progress', status: 'selected' as const }, { label: 'Error', status: 'error' as const }, { label: 'Pending', status: 'default' as const } ]; previousStep(): void { if (this.currentStep > 1) this.currentStep--; } nextStep(): void { if (this.currentStep < this.steps.length) this.currentStep++; } onStepChange(step: number): void { console.log('Step changed to:', step); } } ``` -------------------------------- ### ION-Plus Dropdown Template Logic Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/directives/dropdown/dropdown.component.html This snippet illustrates the Angular template logic for the ION-Plus dropdown component. It handles loading states, iterates through options, displays labels based on configuration, and conditionally shows selection indicators and a clear button for multi-select mode. Dependencies include Angular's template syntax and component-specific functions like dropdownLoading(), dropdownOptions(), dropdownConfig(), and selectedOptions(). ```html @if (dropdownLoading()) { } @else { @for (option of dropdownOptions(); let i = $index; track i) {* @if (option.icon) { } {{ dropdownConfig().propLabel ? option[dropdownConfig().propLabel!] : option.label }} @if (option.selected) { } } @empty { } @if ( dropdownConfig().multiple && dropdownConfig().clearButton && selectedOptions().length ) { } } ``` -------------------------------- ### IonPopConfirmComponent: Implement Confirmation Dialogs in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt The IonPopConfirmComponent provides a reusable confirmation dialog for critical actions. It allows customization of titles, descriptions, confirmation/cancel texts, and types (warning, info, success). Event handlers are available for confirm and close actions. It depends on Angular's Component and Ion-Plus directives. ```typescript import { Component } from '@angular/core'; import { IonPopconfirmDirective, IonButtonComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-popconfirm', standalone: true, imports: [IonPopconfirmDirective, IonButtonComponent], template: ` ` }) export class PopConfirmComponent { onDelete(): void { console.log('Item deleted'); } onPublish(): void { console.log('Article published'); } onComplete(): void { console.log('Marked as complete'); } onCancel(): void { console.log('Action cancelled'); } } ``` -------------------------------- ### IonSelectComponent: Dropdown with Single/Multiple Selection, Search, and Loading Source: https://context7.com/brisanet/ion-plus/llms.txt The IonSelectComponent is a versatile dropdown component supporting single and multiple selections, an integrated search feature, and a loading state indicator. It accepts an array of options and emits events for user selections and search queries. Dependencies include the IonSelectComponent itself. ```typescript import { Component } from '@angular/core'; import { IonSelectComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-select', standalone: true, imports: [IonSelectComponent], template: ` ` }) export class SelectComponent { isLoading = false; dynamicOptions: any[] = []; countries = [ { label: 'United States', value: 'us' }, { label: 'Canada', value: 'ca' }, { label: 'Brazil', value: 'br' } ]; skills = [ { label: 'JavaScript', value: 'js' }, { label: 'TypeScript', value: 'ts' }, { label: 'Angular', value: 'angular' }, { label: 'React', value: 'react' } ]; categories = [ { label: 'Technology', value: 'tech' }, { label: 'Business', value: 'business' }, { label: 'Design', value: 'design' } ]; users = [ { label: 'John Doe', value: '1' }, { label: 'Jane Smith', value: '2' } ]; onCountrySelect(selected: any[]): void { console.log('Country:', selected); } onSkillsSelect(selected: any[]): void { console.log('Skills:', selected); } onCategorySelect(selected: any[]): void { console.log('Category:', selected); } onUserSelect(selected: any[]): void { console.log('User:', selected); } onSearch(query: string): void { console.log('Search query:', query); } } ``` -------------------------------- ### Conditional Alert Display (Angular-like) Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/modal/modal.component.html Renders an alert component if an alert object is present in the configuration. It uses the `as` keyword to assign the alert object to a local variable `alert` for use within the block. ```html @if (configuration().alert; as alert) { } ``` -------------------------------- ### Conditional Footer Rendering (Angular-like) Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/modal/modal.component.html Conditionally renders the footer section based on the `hide` property within the `footer` object of the configuration. If `configuration().footer?.hide` is not true, the footer will be displayed. ```html @if (!configuration().footer?.hide) { } ``` -------------------------------- ### IonSidebarComponent: Collapsible Navigation Menu (Angular) Source: https://context7.com/brisanet/ion-plus/llms.txt The IonSidebarComponent is an Angular component that provides a collapsible sidebar for navigation. It supports menu items, item groups, and logo configuration. It requires Angular and the '@brisanet/ion-plus' library. Key properties include 'items', 'logoConfig', and 'closeOnSelect'. ```typescript import { Component } from '@angular/core'; import { IonSidebarComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-sidebar', standalone: true, imports: [IonSidebarComponent], template: ` ` }) export class SidebarComponent { logoConfig = { src: 'assets/logo.svg', action: () => this.navigateHome() }; sidebarItems = [ { title: 'Dashboard', icon: 'home' as const, selected: true, action: () => console.log('Dashboard clicked') }, { title: 'Users', icon: 'user' as const, selected: false, action: () => console.log('Users clicked') }, { title: 'Settings', icon: 'settings' as const, selected: false, options: [ { title: 'General', icon: 'settings' as const, action: () => console.log('General settings') }, { title: 'Security', icon: 'lock' as const, action: () => console.log('Security settings') }, { title: 'Notifications', icon: 'bell' as const, action: () => console.log('Notification settings') } ] }, { title: 'Disabled Item', icon: 'block' as const, disabled: true } ]; navigateHome(): void { console.log('Navigate to home'); } } ``` -------------------------------- ### IonRadioComponent: Radio Button Group in Angular Source: https://context7.com/brisanet/ion-plus/llms.txt Illustrates the IonRadioComponent for creating radio button groups in Angular, enabling single-selection options with two-way binding. It shows how to configure options, handle value changes, and manage disabled states. ```typescript import { Component } from '@angular/core'; import { IonRadioComponent } from '@brisanet/ion-plus'; @Component({ selector: 'app-radio', standalone: true, imports: [IonRadioComponent], template: `

Selected: {{ selectedPayment }}

` }) export class RadioComponent { selectedPayment = 'credit'; selectedShipping = 'standard'; paymentOptions = [ { label: 'Credit Card', value: 'credit' }, { label: 'PayPal', value: 'paypal' }, { label: 'Bank Transfer', value: 'bank' } ]; shippingOptions = [ { label: 'Standard Shipping', value: 'standard' }, { label: 'Express Shipping', value: 'express' }, { label: 'Same Day (Unavailable)', value: 'same-day', disabled: true } ]; onPaymentChange(value: string): void { console.log('Payment method changed:', value); } } ``` -------------------------------- ### Show Tooltip Conditionally - ION Plus Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/directives/tooltip/tooltip.component.html This snippet demonstrates how to conditionally render a tooltip in ION Plus. The tooltip's visibility is controlled by the `ionTooltipVisible()` function. If the function returns true, the tooltip content is rendered. ```html @if (ionTooltipVisible()) { @if (title()) { {{ title() }} } @if (contentTemplate() !== null) { } } ``` -------------------------------- ### Conditional Label Rendering based on Shape (C#) Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/button/button.component.html This snippet illustrates rendering a label only when the shape is 'normal' and a label exists. It's a common pattern for conditionally displaying text content in UI components. No external dependencies are explicitly mentioned. ```csharp @if (shape() === 'normal' && label()) { {{ label() }} } ``` -------------------------------- ### Conditional Header Button Rendering (Angular-like) Source: https://github.com/brisanet/ion-plus/blob/main/projects/ion/src/lib/modal/modal.component.html Renders a header button only if the configuration allows it and it's not explicitly hidden. It checks for the existence and visibility status of `configuration().headerButton`. ```html @if ( configuration().headerButton && !( configuration().headerButton?.hidden && configuration().headerButton?.hidden() ) ) { } ```