Mutates an a <input type='number'> tag into a field with a pair of buttons next to it that can be used to "spin" a numeric value up or down by a specified increment.
Playground
<ply-input-spinner>Input Spinner</ply-input-spinner>
Use <ply-input-spinner> component which will render the default input spinner. To control the width of the spinner, add a width with a Tailwindcss class name to the component.
<form action="">
<ply-input-spinner class="w-[150px]"></ply-input-spinner>
</form>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add input-spinner
// Paths are relative to aliases.components (default: src/app/components)
import { InputSpinnerComponent } from './input-spinner/input-spinner.component';
@Component({
selector: 'app-input-spinner-example',
imports: [
InputSpinnerComponent
],
template: `...`
})
export class InputSpinnerExampleComponent {}Install
npx ply-ui-cli add input-spinner
Add inside the <ply-input-spinner> the text which you want to show in the label without any closing tag. Check the example below.
<form action="">
<ply-input-spinner class="w-[150px]">Choose quantity</ply-input-spinner>
</form>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add input-spinner
// Paths are relative to aliases.components (default: src/app/components)
import { InputSpinnerComponent } from './input-spinner/input-spinner.component';
@Component({
selector: 'app-input-spinner-example',
imports: [
InputSpinnerComponent
],
template: `...`
})
export class InputSpinnerExampleComponent {}Install
npx ply-ui-cli add input-spinner
Use [disabled]="true" inside <ply-input-spinner> component to disable it.
<form action="">
<ply-input-spinner class="w-[150px]"></ply-input-spinner>
</form>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add input-spinner
// Paths are relative to aliases.components (default: src/app/components)
import { InputSpinnerComponent } from './input-spinner/input-spinner.component';
@Component({
selector: 'app-input-spinner-example',
imports: [
InputSpinnerComponent
],
template: `...`
})
export class InputSpinnerExampleComponent {}Install
npx ply-ui-cli add input-spinner
Run the following command to add this component to your project:
npx ply-ui-cli add input-spinner
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.
npx -y ply-ui-mcp
Ply provides standalone components. Import the exact elements you want to use into your component.
// Install: npx ply-ui-cli add input-spinner
// Paths are relative to aliases.components (default: src/app/components)
import { InputSpinnerComponent } from './input-spinner/input-spinner.component';
@Component({
selector: 'app-your-component',
imports: [
InputSpinnerComponent
],
template: `...`
})
export class YourComponent {} API for input-spinner — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
ply-input-spinner | class | string | '' | Additional host CSS classes (merged via cn()). |
ply-input-spinner | classes | string | '' | — |
ply-input-spinner | min | number | 0 | — |
ply-input-spinner | max | unknown | Infinity | — |
ply-input-spinner | step | number | 1 | — |
ply-input-spinner | disabled | boolean | false | Whether the control is disabled (consumer-facing input). |
Content