Run the CLI
Use the CLI to add the component to your project.
npx @ngzard/ui@latest add dividerThe Divider component is used to visually separate content with a horizontal or vertical line.
Before divider
After divider
import { Component } from '@angular/core';
import { ZardDividerComponent } from '../divider.component';
@Component({
selector: 'z-demo-divider-default',
imports: [ZardDividerComponent],
standalone: true,
template: `
<div class="flex flex-col">
<p>Before divider</p>
<z-divider />
<p>After divider</p>
</div>
`,
})
export class ZardDemoDividerDefaultComponent {}
Use the CLI to add the component to your project.
npx @ngzard/ui@latest add dividerpnpm dlx @ngzard/ui@latest add divideryarn dlx @ngzard/ui@latest add dividerbunx @ngzard/ui@latest add dividerCreate the component directory structure and add the following files to your project.
Before divider
After divider
import { Component } from '@angular/core';
import { ZardDividerComponent } from '../divider.component';
@Component({
selector: 'z-demo-divider-default',
imports: [ZardDividerComponent],
standalone: true,
template: `
<div class="flex flex-col">
<p>Before divider</p>
<z-divider />
<p>After divider</p>
</div>
`,
})
export class ZardDemoDividerDefaultComponent {}
Left
Right
import { Component } from '@angular/core';
import { ZardDividerComponent } from '../divider.component';
@Component({
selector: 'z-demo-divider-vertical',
imports: [ZardDividerComponent],
standalone: true,
template: `
<div class="flex h-20">
<p>Left</p>
<z-divider zOrientation="vertical" />
<p>Right</p>
</div>
`,
})
export class ZardDemoDividerVerticalComponent {}