# V label 8

> With character counter

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

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

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-label-8.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/label`

## Files

### `registry/default/variants/v-label-8.tsx`

```tsx
"use client";

import { useState } from "react";

import { Field } from "@/registry/default/ui/field";
import { Label } from "@/registry/default/ui/label";
import { Textarea } from "@/registry/default/ui/textarea";

export function Pattern() {
  const [length, setLength] = useState(0);

  return (
    <Field className="w-full max-w-xs">
      <Label className="justify-between" htmlFor="label-counter">
        Bio
        <span className="text-muted-foreground">{length}/200</span>
      </Label>
      <Textarea
        id="label-counter"
        maxLength={200}
        onChange={(e) => setLength(e.target.value.length)}
        placeholder="Tell us about yourself…"
      />
    </Field>
  );
}
```
