vani-forms-inputs
8
总安装量
6
周安装量
#35995
全站排名
安装命令
npx skills add https://github.com/itsjavi/vani --skill vani-forms-inputs
Agent 安装分布
claude-code
3
windsurf
2
trae
2
opencode
2
github-copilot
2
Skill 文档
Forms and Inputs
Instructions for building forms that update on submit or preserve focus during controlled input.
When to Use
Use this when you need form handling, text inputs, or focus-safe controlled inputs.
Steps
- Keep input values in local variables and avoid re-rendering on every keystroke.
- On submit, update local state and call
handle.update(). - For controlled inputs, store a
DomRef, callhandle.updateSync(), then restore focus/selection. - Prefer splitting inputs into their own components if a sibling preview must update live.
Arguments
- submitOn – submit trigger (
submitorblur, defaults tosubmit) - useControlledInput – whether to demonstrate controlled input handling (defaults to
false) - formName – component name (defaults to
Form)
Examples
Example 1 usage pattern:
Create a contact form that updates the UI only after submit.
Example 2 usage pattern:
Implement a controlled input that preserves focus with a DomRef.
Output
Example output:
Created: src/contact-form.ts
Notes: Inputs are uncontrolled until submit.
Present Results to User
Explain the update strategy (submit vs controlled) and where focus is preserved.
name: vani-forms-inputs description: Implement Vani forms and inputs without losing focus. argument-hint: “[form or input behavior]”
Vani Forms and Inputs Command
When to use
Use this skill when handling inputs, forms, or focus-sensitive UI in Vani.
Instructions
Follow these steps:
- Keep input values in local variables.
- Read input changes via
oninputwithout callinghandle.update(). - On submit or blur, update state and call
handle.update(). - For controlled inputs, use a
DomRef, callhandle.updateSync(), then restore focus/selection.
Output expectations
- Use only
@vanijs/vanior other public packages. - Avoid re-rendering on every keystroke unless focus is preserved.
- If $ARGUMENTS is provided, adapt the strategy to that form scenario.