JGuang

Fine-tune Card

Fine-tune Card · Beautiful UI

Preview
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/fine-tune-card.json

Fine-tune Card

Install: npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/fine-tune-card.json

When to use

Adjust numeric properties, a layout mode and a type selection.

Key props and data

Native propMeaning
fieldsUnique key, label, initial value, min/max and optional step/suffix; rendered in pairs.
optionsAvailable strings in the Type menu.
onChangeReceives segment, values and type after user edits.
labelsPartial localized labels for title, layout, type, placeholder, adjust and edited.

Interaction and state checks

Test typing, arrow keys, Shift-arrow, pointer scrubbing, layouts and menu selection. The native field rounds to whole numbers even with a fractional step; use integer-valued properties here.

Integration boundaries

fields values initialize internal state; this is not a fully controlled inspector. Remount for a different inspected object. onChange does not save anything automatically.

The runnable usage and source reference below preserve the native API. These practical guides do not claim a full translation of upstream prose.

Runnable usage

Install a complete example below first, then import its installed entry. Parameterized example source, shared helpers, native components and CSS are included; no manual relative-import edits are required.

import Demo from '@/components/beautiful-ui/examples/presets/fine-tune-card-property-editing';
import '@/styles/beautiful-ui.css';
export default function Example() { return <Demo />; }

Preview states

Default, Property editing

Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.

The agent adjusts design properties in an inspector.

Complete example installation

These are runnable native states and parameterized usage scenarios, not additional components. Each bundle includes its source closure, helpers, pinned dependencies, independent CSS and licenses. Scenario names are not new native component props; consult the source API below.

Default

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/fine-tune-card/fine-tune-card-default.json

Default import: @/components/beautiful-ui/examples/presets/fine-tune-card-default

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

Property editing

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/fine-tune-card/fine-tune-card-property-editing.json

Default import: @/components/beautiful-ui/examples/presets/fine-tune-card-property-editing

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

Initialize Tailwind CSS v4, import beautiful-ui.css once and synchronize theme with the host html dark class. Examples read html lang for Chinese/English and do not supply backend, authentication or recording. Network/clipboard availability still depends on the browser.

Source-backed parameter reference

Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.

FineTuneCard({
  fields = FIELDS,
  options = OPTIONS,
  labels,
  onChange,
}: FineTuneCardProps)
export type FineTuneField = {
  key: string;
  label: string;
  value: number;
  min: number;
  max: number;
  step?: number;
  suffix?: string;
};

export type FineTuneCardLabels = {
  title: string;
  layout: string;
  type: string;
  placeholder: string;
  adjust: string;
  edited: string;
};

export type FineTuneState = {
  segment: number;
  values: Record<string, number>;
  type: string;
};

export type FineTuneCardProps = {
  /** Accepted for gallery/registry parity; not used by this card. */
  variant?: string;
  /** The scrub-able properties shown in the layout grid (rendered in pairs). */
  fields?: FineTuneField[];
  /** Options offered in the Type menu. */
  options?: string[];
  /** Prominent copy strings. */
  labels?: Partial<FineTuneCardLabels>;
  /** Called with the full editable state whenever the user edits it. */
  onChange?: (state: FineTuneState) => void;
};

Destructuring defaults in source

Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.

// FineTuneCard
fields = FIELDS

// FineTuneCard
options = OPTIONS

Native and external types

External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.

Partial<FineTuneCardLabels>
Record<string, number>