# V number field 10

> Percentage with scrub

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-number-field-10).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-number-field-10
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-number-field-10-light-d1c68b610d70bad1.png
- Registry item: https://ui.cnippet.dev/r/v-number-field-10.json
- Categories: number field
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-number-field-10.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/number-field`

## Files

### `registry/default/variants/v-number-field-10.tsx`

```tsx
"use client";

import { useState } from "react";
import {
  NumberField,
  NumberFieldDecrement,
  NumberFieldGroup,
  NumberFieldIncrement,
  NumberFieldInput,
  NumberFieldScrubArea,
} from "@/registry/default/ui/number-field";

export default function Particle() {
  const [fontSize, setFontSize] = useState(16);

  return (
    <div className="flex w-full max-w-xs flex-col gap-4">
      <NumberField
        max={48}
        min={8}
        onValueChange={(value) => {
          if (value !== null) setFontSize(value);
        }}
        step={1}
        value={fontSize}
      >
        <NumberFieldScrubArea label="Font size (px)" />
        <NumberFieldGroup>
          <NumberFieldDecrement />
          <NumberFieldInput />
          <NumberFieldIncrement />
        </NumberFieldGroup>
      </NumberField>
      <div className="rounded-lg border bg-muted/30 px-4 py-3">
        <p className="text-foreground leading-snug" style={{ fontSize }}>
          The quick brown fox jumps over the lazy dog.
        </p>
      </div>
    </div>
  );
}
```
