Angular PrimeNG Knob Component Last Updated : 19 Aug, 2021 Comments Improve Suggest changes Like Article Like Report Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Knob component in Angular PrimeNG. Knob component: It is a form component that is used to define a dialer type knob that contains labels and some data values. Properties: size: It is used to set the size of the component in pixels. It is of number data type, the default value is 100.disabled: It specifies that the element should be disabled. It is of the boolean data type, the default value is false.readonly: It is used to specify that the component cannot be edited. It is of the boolean data type, the default value is false.min: It is used to set the minimum boundary value. It is of number data type, the default value is 0.max: It is used to set the maximum boundary value. It is of number data type, the default value is 100.step: It is used to set the step factor to increment/decrement the value. It is of number data type, the default value is null.valueColor: It is used to set the background of the value. It is of string data type, the default value is null.rangeColor: It is used to set the background color of the range. It is of number data type, the default value is null.textColor: It is used to set the color of the value text. It is of number data type, the default value is null.strokeWidth: It is used to set the width of the knob stroke. It is of number datatype, the default value is 14.showValue: It is used to specify whether to show the value inside the knob. It is of the boolean datatype, the default value is true.valueTemplate: It is used to set the template string of the value. It is of string data type, the default value is value.style: It is used to set the Inline style of the element. It is of object data type, the default value is null.styleClass: It is used to set the Style class of the element. It is of string data type, the default value is null.Events: onChange: It is a callback that is fired when the value changes. Styling: p-knob: It is a styling Container element.p-knob-text: It is a styling Text element.p-knob-value: It is a styling Value element.p-knob-text: It is a styling Text element.Creating Angular Application & module Installation : Step 1: Create an Angular application using the following command. ng new appname Step 2: After creating your project folder i.e. appname, move to it using the following command. cd appname Step 3: Install PrimeNG in your given directory. npm install primeng --save npm install primeicons --save Project Structure: After completion of the installation process, it will look like the following. Example 1: In this step, we will see the basic example that illustrates the use of the knob component. app.component.html <h2 style="color: green">GeeksforGeeks</h2> <h5>PrimeNG Knob component</h5> <div class="p-field p-col-12 p-md-4"> <h4>Basic</h4> <p-knob [size]="150" [strokeWidth]="9" valueColor="green" rangeColor="navy"> </p-knob> <h4>Disabled</h4> <p-knob [size]="150" [strokeWidth]="9" valueColor="Green" rangeColor="grey" [disabled]="true"> </p-knob> </div> app.module.ts import { NgModule } from "@angular/core"; import { BrowserModule } from "@angular/platform-browser"; import { FormsModule } from "@angular/forms"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { AppComponent } from "./app.component"; import { KnobModule } from "primeng/knob"; @NgModule({ imports: [BrowserModule, BrowserAnimationsModule, KnobModule, FormsModule], declarations: [AppComponent], bootstrap: [AppComponent], }) export class AppModule {} Output: Example 2: In this example, we will know how to use the steps & stroke property in the knob component. app.component.html <h2 style="color: green">GeeksforGeeks</h2> <h5>PrimeNG Knob component</h5> <div class="p-field p-col-12 p-md-4"> <h5>Step</h5> <p-knob [size]="150" [strokeWidth]="9" valueColor="Green" rangeColor="Blue" [step]="10"> </p-knob> </div> <div class="p-field p-col-12 p-md-4"> <h5>Stroke</h5> <p-knob [size]="150" [strokeWidth]="9" valueColor="Green" rangeColor="Blue" [step]="10" [strokeWidth]="5"> </p-knob> </div> app.module.ts import { NgModule } from "@angular/core"; import { BrowserModule } from "@angular/platform-browser"; import { FormsModule } from "@angular/forms"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { AppComponent } from "./app.component"; import { KnobModule } from "primeng/knob"; @NgModule({ imports: [BrowserModule, BrowserAnimationsModule, KnobModule, FormsModule], declarations: [AppComponent], bootstrap: [AppComponent], }) export class AppModule {} Output: Reference: https://primefaces.org/primeng/showcase/#/knob Comment More infoAdvertise with us taran910 Follow Improve Article Tags : Web Technologies AngularJS Angular-PrimeNG Similar Reads Angular PrimeNG Form AutoComplete Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that helps to create an attractive user interface with enhanced functionality. These components can be utilized for great styling & are used to make responsive websites with very much ease. There are diff 12 min read Angular PrimeNG Calendar Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the calendar component in angular ngx bootstrap. Calendar c 8 min read Angular PrimeNG Form CascadeSelect Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. This article will show us how to use the Angular PrimeNG Form CascadeSelect Component. The CascadeSe 6 min read Angular PrimeNG Form Checkbox Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. This article will show us how to use the calendar component in angular ngx bootstrap. Checkbox Compo 5 min read Angular PrimeNG Chips Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Chips component in Angular PrimeNG. Chips component: It 5 min read Angular PrimeNG ColorPicker Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the colorPicker component in Angular PrimeNG. colorPicker c 4 min read Angular PrimeNG Dropdown Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Dropdown component in Angular ngx Bootstrap. We will al 9 min read Angular PrimeNG Form Editor Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see how to use the Form Editor Component in Angular PrimeNG. The Form Edito 3 min read Angular PrimeNG FloatLabel Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the FloatLabel component in angular PrimeNG. FloatLabel com 2 min read Angular PrimeNG InputGroup Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the InputGroup component in angular primeNG. InputGroup com 2 min read Like