Fine-tune Card
Adjust something an agent produced with a compact panel of number, choice, and menu controls.
Overview
Fine-tune Card is a small panel of controls for adjusting a result without writing another prompt: a chart's size, a reply's length, a tone. You describe the controls as data, and the card reports every value when one changes.
The card holds the values and nothing else. Regenerating or restyling the result is your application's work, in onValuesChange.
Anatomy
- HeaderThe title, an Edited note, and Reset
- NumberA field that can be typed into, stepped, or scrubbed by its label
- SegmentA small set of choices, one always chosen
- SelectA menu, for longer lists
Installing fine-tune-card brings Button, Number Field, Select, and Toggle along as registry dependencies.
Behavior
Numbers
A number field accepts typing, steps with the arrow keys, and scrubs when its label is dragged sideways. min, max, and step are enforced by the field.
Edited and Reset
When any value differs from defaultValues, the header says Edited and offers Reset, which returns every control to its default and reports the defaults through onValuesChange.
Accessibility
The card is a group named by its title. Its controls are the Honest UI Number Field, Toggle group, and Select, each named by its label, and they keep their own keyboard behavior. Scrubbing is an extra for pointer users. Every value can also be typed.
Edited is a polite status, so it is announced when the first change is made.
Installation
Usage
import { FineTuneCard } from "@/components/ai/fine-tune-card"
<FineTuneCard
title="Reply style"
defaultValues={{ length: 300, tone: "neutral" }}
controls={[
{ type: "number", id: "length", label: "Max words", min: 50, max: 1000, step: 50 },
{
type: "select",
id: "tone",
label: "Tone",
options: [
{ value: "neutral", label: "Neutral" },
{ value: "formal", label: "Formal" },
],
},
]}
onValuesChange={(values) => reply.regenerate(values)}
/>onValuesChange runs on every change, including each step of a scrub. Debounce it if your handler starts a request.
Examples
Numbers only
Two number fields. Drag a label to scrub.
API reference
FineTuneCard
Accepts native div props beyond those listed.