### Month Mode Example
Source: https://www.fraktonng.com/docs/calendar-navigator/features
Example demonstrating month mode navigation with date selection and current date display.
```html
```
--------------------------------
### Example with Labels and Value Formatting
Source: https://www.fraktonng.com/docs/progress-bar/features
Demonstrates combining labels, inline values, and custom formatting for non-percentage units within a card layout. Includes a guided badge.
```html
Labels and value formatting
Combine labels, inline values, and custom formatting for non-percentage units.
Guided
```
--------------------------------
### Configurable Paginator Example
Source: https://www.fraktonng.com/docs/paginator/features
Shows different configurations of the paginator for various use cases. This example is suitable for demonstrating flexibility.
```html
```
--------------------------------
### Form Integration Example
Source: https://www.fraktonng.com/docs/calendar-navigator/features
Example demonstrating how to integrate the calendar navigator with reactive forms and form validation.
```html
```
--------------------------------
### Install Frakton NG Package
Source: https://www.fraktonng.com/docs/components-actions-button--raised
Install the Frakton NG library using npm. This is the first step to using any Frakton NG components.
```bash
npm install frakton-ng
```
--------------------------------
### Complete Progress Bar Example
Source: https://www.fraktonng.com/docs/progress-bar/features
Show a progress bar in a completed state. This example configures value, label, and other display properties.
```html
```
--------------------------------
### Basic Paginator Example
Source: https://www.fraktonng.com/docs/paginator/features
A default paginator example with all features enabled. Allows navigation and page size adjustments.
```html
```
--------------------------------
### Dynamic Mode Switching Example
Source: https://www.fraktonng.com/docs/calendar-navigator/features
Example showing dynamic mode switching between month and year navigation. Includes buttons to toggle mode and navigate to today.
```html
Selected: {{ internalDate() | date:'fullDate' }}
```
--------------------------------
### Basic Calendar Navigator Setup
Source: https://www.fraktonng.com/docs/calendar-navigator/features
Basic setup for the calendar navigator component, setting the mode and current date.
```html
```
--------------------------------
### Basic Textarea Usage
Source: https://www.fraktonng.com/docs/textarea/features
A fundamental example of using the fkt-textarea component with a label and placeholder. This serves as a starting point for capturing free-form text.
```html
Current value: {{ control().value() || '(empty)' }}
```
--------------------------------
### Basic Navigator Example
Source: https://www.fraktonng.com/docs/navigator/features
A fundamental implementation of the navigator component, demonstrating simple previous/next navigation along with a counter state.
```html
```
--------------------------------
### Multi-Theme Setup for Switching
Source: https://www.fraktonng.com/docs/getting-started-theming-styling
Include both light and dark theme CSS files in your project configuration to enable easy theme switching.
```json
{
"styles": [
"node_modules/frakton-ng/assets/styles.css",
"node_modules/frakton-ng/assets/themes/light.css",
"node_modules/frakton-ng/assets/themes/dark.css"
]
}
```
--------------------------------
### Item Navigation Example
Source: https://www.fraktonng.com/docs/navigator/features
Example for navigating through a list of items, including proper boundary detection. This snippet displays the current item's title and description, along with navigation controls.
```html
{{ currentItem().title }}
{{ currentItem().description }}
Item {{ currentIndex() + 1 }} of {{ items.length }}
```
--------------------------------
### Page Navigation Example
Source: https://www.fraktonng.com/docs/navigator/features
Example for pagination-style navigation, including page numbers and navigation controls. This snippet displays the current page and total pages, with controls to move between them.
```html
Page {{ currentPage() }} of {{ totalPages() }}
```
--------------------------------
### Basic Autocomplete Example
Source: https://www.fraktonng.com/docs/autocomplete/features
Demonstrates the basic implementation of the autocomplete component with predefined options, including search and selection.
```typescript
```
--------------------------------
### Template Reference Examples
Source: https://www.fraktonng.com/docs/table/features
Provides examples of using ng-templates for custom cell rendering, including customer details and formatted amounts.
```HTML
{{ name }}order {{ since }}
500" [class.amount--low]="amount < 200">
${{ amount.toFixed(2) }}
```
--------------------------------
### Date Navigation Example
Source: https://www.fraktonng.com/docs/navigator/features
Example for navigating through dates, ensuring proper handling of boundary conditions. This snippet includes custom content display and event handling for month navigation.
```html
{{ formattedDate() }}
```
--------------------------------
### Responsive Paginator Example
Source: https://www.fraktonng.com/docs/paginator/features
Illustrates the responsive design of the paginator, which adapts to different screen sizes with mobile-friendly reordering.
```html
```
--------------------------------
### Disabled State Navigation Example
Source: https://www.fraktonng.com/docs/navigator/features
Demonstrates dynamic enable/disable states for the navigator's buttons based on specific business logic. This example shows individual disabling of previous, next, or both buttons.
```html
Previous Disabled
Next Disabled
Both Disabled
```
--------------------------------
### Basic Select Example
Source: https://www.fraktonng.com/docs/select/features
Demonstrates a basic select dropdown with options. Use this for simple selection scenarios where no pre-selection or special states are needed.
```html
Selected Value: {{ control().value() || 'None' }}
```
--------------------------------
### Aligning Spacing Systems
Source: https://www.fraktonng.com/docs/getting-started-migration-guides/features
Example CSS showing how to align spacing systems between libraries like Bootstrap and Frakton NG using a common spacing unit.
```css
/* Align spacing systems */
:root {
--spacing-unit: 8px;
/* Bootstrap spacing (if using Ng-Bootstrap) */
--bs-spacer: var(--spacing-unit);
/* Frakton spacing */
--fkt-space-xs: calc(var(--spacing-unit) * 0.5);
--fkt-space-sm: var(--spacing-unit);
--fkt-space-md: calc(var(--spacing-unit) * 2);
}
```
--------------------------------
### Coordinating Theme Colors
Source: https://www.fraktonng.com/docs/getting-started-migration-guides/features
Example CSS demonstrating how to coordinate brand colors between different UI libraries (Material, Frakton NG) using CSS variables.
```css
/* Coordinate colors between libraries */
:root {
/* Your brand colors */
--brand-primary: #1976d2;
--brand-accent: #ff4081;
/* Material variables */
--mat-primary: var(--brand-primary);
/* Frakton variables */
--fkt-color-primary: var(--brand-primary);
--fkt-color-accent: var(--brand-accent);
}
```
--------------------------------
### Basic Calendar Usage
Source: https://www.fraktonng.com/docs/calendar/features
Demonstrates the basic setup of the FktCalendar component for date selection with month and year navigation.
```html
```
--------------------------------
### Loading State Navigation Example
Source: https://www.fraktonng.com/docs/navigator/features
Illustrates navigation with loading states during asynchronous operations, such as data fetching. The navigator buttons are disabled while loading, and a spinner is shown.
```html
@if (isLoading()) {
Loading...
}
```
--------------------------------
### Interactive Overlay with Shared State
Source: https://www.fraktonng.com/docs/overlay/features
An interactive overlay example demonstrating how changes within the overlay can update shared application state.
```html
Shared State
Counter: Items:
Changes made in overlays will update this shared state automatically.
```
--------------------------------
### Frakton NG Button and Overlay Menu Example (After Migration)
Source: https://www.fraktonng.com/docs/getting-started-migration-guides/features
Illustrates the equivalent functionality using Frakton NG's button with a built-in loading state and an overlay service for a dropdown menu.
```typescript
// After (Frakton NG)
import {FktButtonComponent} from 'frakton-ng/button';
import {FktOverlayService} from 'frakton-ng/overlay';
@Component({
template: `
`,
imports: [FktButtonComponent]
})
export class ExampleComponent {
constructor(private overlay: FktOverlayService) {
}
openMenu(event: Event) {
this.overlay.open({
anchorElementRef: {nativeElement: event.target as HTMLElement},
component: ActionsMenuComponent,
data: {
onEdit: () => this.edit(),
onDelete: () => this.delete()
}
});
}
}
```
--------------------------------
### Vertical Divider Variants Example
Source: https://www.fraktonng.com/docs/divider/features
Illustrates vertical dividers with different variants. This example iterates through variants to showcase distinct styling options for horizontal content separation.
```html
@for (variant of variants; track variant.label) {
{{ variant.label }}
}
```
--------------------------------
### Default Light Theme Setup
Source: https://www.fraktonng.com/docs/getting-started-theming-styling
Configure your project to use Frakton NG's default light theme by including the main styles and the light theme CSS file.
```json
{
"styles": [
"node_modules/frakton-ng/assets/styles.css",
"node_modules/frakton-ng/assets/themes/light.css"
]
}
```
--------------------------------
### Character Counter Example
Source: https://www.fraktonng.com/docs/textarea/features
Demonstrates a textarea with a live character counter, progress bar, and statistics. Useful for input fields with length restrictions.
```html
❌ Character limit exceeded by {{ characterCount() - maxLength() }}
characters
}
}
```
--------------------------------
### Ng-Bootstrap Button and Dropdown Example (Before Migration)
Source: https://www.fraktonng.com/docs/getting-started-migration-guides/features
Shows a typical implementation using Ng-Bootstrap's button and dropdown components, including a loading state for the button.
```typescript
// Before (Ng-Bootstrap)
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
@Component({
template: `
`,
imports: [NgbModule]
})
```
--------------------------------
### Raised Button Example
Source: https://www.fraktonng.com/docs/button
A standard raised button for primary actions. Configure text, theme, and disabled state.
```html
```
--------------------------------
### Frakton NG Component Usage Example
Source: https://www.fraktonng.com/docs/getting-started-migration-guides/features
Demonstrates the usage of Frakton NG components like fkt-button, fkt-input, and fkt-select within a component's template.
```typescript
@Component({
template: `
`,
imports: [FktButtonComponent, FktInputComponent, FktSelectComponent]
})
```
--------------------------------
### Skeleton Types Example
Source: https://www.fraktonng.com/docs/skeleton/features
Showcases different skeleton types including text, circle, rectangle, button, and image placeholders.
```html
Skeleton Types
Different skeleton types for various content placeholders.
@if (showLabels()) {
Text
Single and multi-line text placeholders
}
@if (showLabels()) {
Circle
Perfect for avatars and profile images
}
@if (showLabels()) {
Rectangle
General purpose rectangular placeholders
}
@if (showLabels()) {
Button
Button-shaped placeholders
}
```
--------------------------------
### Basic Checkbox Example
Source: https://www.fraktonng.com/docs/checkbox/features
A basic FktCheckbox with label text. Clicking the checkbox or label toggles its state. This is useful for simple agreement or selection scenarios.
```html
```
--------------------------------
### Horizontal Divider Sizes with Label
Source: https://www.fraktonng.com/docs/divider/features
Demonstrates different horizontal divider sizes with labels. This example iterates through variants to display various configurations.
```html
@for (variant of variants; track variant.label) {
{{ variant.label }}
}
```
--------------------------------
### Loading Button Example
Source: https://www.fraktonng.com/docs/button
A button that displays a loading state with custom text, useful for asynchronous operations. Configure text, loadingText, theme, color, loading, and disabled state.
```html
```
--------------------------------
### Button with Icon Example
Source: https://www.fraktonng.com/docs/button
A button that includes an icon alongside text. Configure text, theme, color, icon, and disabled state.
```html
```
--------------------------------
### Adding New Functionality with Frakton NG
Source: https://www.fraktonng.com/docs/getting-started-migration-guides/features
Demonstrates starting a migration by integrating new features using Frakton NG components alongside existing UI elements.
```typescript
// Begin with new features or components
@Component({
ttemplate: `
...
`
})
```
--------------------------------
### Progress Bar Variants
Source: https://www.fraktonng.com/docs/progress-bar/features
Showcase different visual variants of the progress bar. This example iterates through a list of variants to apply different styles.
```html
@for (variant of variants; track variant.label) {
{{ variant.label }}
}
```
--------------------------------
### Vertical Divider Sizes Example
Source: https://www.fraktonng.com/docs/divider/features
Demonstrates vertical dividers with different sizes. This code iterates through variants to apply various size and spacing configurations for vertical separation.
```html
@for (variant of variants; track variant.label) {
{{ variant.label }}
}
```
--------------------------------
### Form Integration with Textarea
Source: https://www.fraktonng.com/docs/textarea/features
Demonstrates integrating the textarea component into a reactive form with multiple input fields. This example showcases validation, control, and submission handling.
```html
Contact Form
```
--------------------------------
### Tooltip Positioning - Top
Source: https://www.fraktonng.com/docs/tooltip/features
Examples of tooltips positioned at the top. The 'position' attribute can be set to 'top-start', 'top-center', or 'top-end'. The 'disableAutoReposition' attribute is used to prevent automatic repositioning.
```html
Top Positions
```
--------------------------------
### Import FktCalendarNavigatorComponent
Source: https://www.fraktonng.com/docs/calendar-navigator/features
Import the FktCalendarNavigatorComponent from the 'frakton-ng/calendar-navigator' module.
```typescript
import {FktCalendarNavigatorComponent} from "frakton-ng/calendar-navigator";
```
--------------------------------
### Migrating from PrimeNG Components to Frakton NG
Source: https://www.fraktonng.com/docs/getting-started-migration-guides/features
Illustrates a direct replacement strategy for migrating from PrimeNG components to their Frakton NG equivalents, showing the 'before' state with PrimeNG imports and template.
```typescript
// Before (PrimeNG)
import {ButtonModule} from 'primeng/button';
import {InputTextModule} from 'primeng/inputtext';
import {DropdownModule} from 'primeng/dropdown';
@Component({
template: `
p-button>
`,
imports: [ButtonModule, InputTextModule, DropdownModule]
})
```