MenuModel API

    Steps requires a collection of menuitems as its model.

    1. <p-steps [model]="items"></p-steps>
    2.  

    Readonly

    1. <p-steps [model]="items" [readonly]="false"></p-steps>
    2.  

    Events

    Following is the list of structural style classes, for theming classes visit .

    Dependencies

    Source

    View on GitHub

    1. @Component({
    2. templateUrl: 'showcase/demo/steps/stepsdemo.html',
    3. providers: [MessageService],
    4. styles: [`
    5. .ui-steps .ui-steps-item {
    6. width: 25%;
    7. }
    8. .ui-steps.steps-custom {
    9. margin-bottom: 30px;
    10. }
    11. .ui-steps.steps-custom .ui-steps-item .ui-menuitem-link {
    12. padding: 0 1em;
    13. }
    14. .ui-steps.steps-custom .ui-steps-item .ui-steps-number {
    15. background-color: #0081c2;
    16. color: #FFFFFF;
    17. display: inline-block;
    18. border-radius: 50%;
    19. margin-top: -14px;
    20. margin-bottom: 10px;
    21. }
    22. .ui-steps.steps-custom .ui-steps-item .ui-steps-title {
    23. color: #555555;
    24. }
    25. `],
    26. encapsulation: ViewEncapsulation.None
    27. })
    28. export class StepsDemo implements OnInit {
    29. items: MenuItem[];
    30. activeIndex: number = 1;
    31. constructor(private messageService: MessageService) {}
    32. ngOnInit() {
    33. this.items = [{
    34. command: (event: any) => {
    35. this.activeIndex = 0;
    36. this.messageService.add({severity:'info', summary:'First Step', detail: event.item.label});
    37. },
    38. {
    39. label: 'Seat',
    40. command: (event: any) => {
    41. this.activeIndex = 1;
    42. this.messageService.add({severity:'info', summary:'Seat Selection', detail: event.item.label});
    43. }
    44. },
    45. {
    46. label: 'Payment',
    47. command: (event: any) => {
    48. this.activeIndex = 2;
    49. this.messageService.add({severity:'info', summary:'Pay with CC', detail: event.item.label});
    50. }
    51. },
    52. {
    53. label: 'Confirmation',
    54. command: (event: any) => {
    55. this.activeIndex = 3;
    56. this.messageService.add({severity:'info', summary:'Last Step', detail: event.item.label});
    57. }
    58. }
    59. ];
    60. }
    61. }