N
Nyxis
Tools

ParameterForm

Schema-driven form for tool parameters — string, number, enum, boolean, list, and JSON.

Preview

Free-text search.

Max results.

Filter by tag.

Approximate matching.

Installation

pnpm add nyxis-ui

Usage

import { ParameterForm, type ParameterField } from 'nyxis-ui';

const fields: ParameterField[] = [
  { name: 'query', type: 'string', required: true },
  { name: 'limit', type: 'number', defaultValue: 5 },
  { name: 'tags', type: 'string[]', placeholder: 'add a tag' },
  { name: 'fuzzy', type: 'boolean', defaultValue: true },
];

<ParameterForm fields={fields} onSubmit={(value) => execute(value)} submitLabel="Run" />;

Field types

TypeRenders as
stringText input
numberNumeric input with inputMode="decimal"
booleanToggle switch
enumNative select with options
string[]Chip input (free-form) or chip-select (with options)
jsonMultiline textarea, parsed live (falls back to raw string on parse error)

When to use this

The most common pattern: the model proposes a tool call → you surface the args via <ParameterForm> so the user can adjust them → then dispatch. This gives users an “approve before run” loop without writing per-tool forms by hand.