wxsub/element-plus-formkit/element-plus-formkit-generator
Claude Code and agent skill by wxsub/element-plus-formkit
- community
Checking that the SKILL.md file is still in the repository.
Generate form code using element-plus-formkit. Triggered when the user needs to build/create any form, whether from an uploaded image, a description, or any other requirement.
Install
npx vskill@latest install wxsub/element-plus-formkit/element-plus-formkit-generatorSKILL.md
Form Development
Whenever the user needs to build or create a form — whether from an uploaded image, a text description, or any other requirement — use this skill to generate form code using the element-plus-formkit component.
This skill is not limited to image-based scenarios. Any request involving form creation should use this skill.
Workflow
Step 1: Analyze the Image
Carefully examine the uploaded image and identify all form elements. For each form field, extract the following information:
- Label: The display text of the form field (e.g. "Name", "Department Name")
- Type: The form control type (refer to the type mapping table below)
- Required: Whether the field is marked as required (usually indicated by a red asterisk
*) - Options: For dropdown/radio/checkbox fields, extract all available options
- Layout: Observe the form layout (number of columns, groups, sections)
Step 2: Map FormKit Config Types
Based on the visual form elements in the image, map them to the corresponding formkit type. For full module documentation, refer to: element-plus-formkit Modules
Basic Modules
| Visual Element | formkit type | Description | |
|---|---|---|---|
| Single-line text input | input | Default type for text fields | |
| Multi-line textarea | input + props: { type: 'textarea' } | Or use textarea type | |
| Password input | input + props: { type: 'password', showPassword: true } | ||
| Number input | input + props: { type: 'number' } |
Selection Modules
| Visual Element | formkit type | Description | |
|---|---|---|---|
| Dropdown select | select | Requires options array in { name, id } format. Also supports dynamically fetching options via requester field | |
| Dictionary dropdown | dict | When options come from system dictionary, use props: { type: 'dict_key' } (project-specific) | |
| Cascader | cascader | For hierarchical data with clear parent-child structure. Requires options array in { value, label, children } format | |
| Custom cascader | vCascader | Project-specific cascader component | |
| Radio buttons | radio | Requires options array in { name, id } format | |
| Checkboxes | checkbox | Requires options array in { name, id } format | |
| Switch | switch | Toggle between two states. Commonly uses props: { inlinePrompt: true, activeText: '...', inactiveText: '...' } |
Date/Time Modules
| Visual Element | formkit type | Description | |
|---|---|---|---|
| Date picker | datePicker | Add class: '!w-full' in props by default. Use props: { valueFormat: 'YYYY-MM-DD', class: '!w-full' } | |
| DateTime picker | datePicker + props: { type: 'datetime', class: '!w-full' } | ||
| Date range picker | datePicker + props: { type: 'daterange', class: '!w-full' } | ||
| DateTime range picker | datePicker + props: { type: 'datetimerange', class: '!w-full' } |
Note: When datetime form fields are detected in the image, always addclass: '!w-full'to thepropsof that config item by default.
Advanced Modules
| Visual Element | formkit type | Description | |
|---|---|---|---|
| File upload | upload | Uses props: { accept, width, height }. Upload configuration is set globally via setConfigure('upload', ...) | |
| Input tag | inputTag | Allows users to add content as tags. Requires element-plus >= 2.13.3 | |
| Mention (@mention) | mention | Mention someone/something in input. Supports options array or requester for dynamic fetching. Unique properties: valueKey, labelKey | |
| Rate (rating) | rate | Star rating component | |
| Color picker | colorPicker | Color selection | |
| Slider | slider | Slider selection. Uses props: { min, max, step } | |
| Time picker | timePicker | Time selection | |
| Time range picker | timePicker + props: { isRange: true } |
Dynamic Options Loading
Modules such as select and mention support dynamically fetching options via requester + handler fields:
Cascader Options Format
Cascader options use a different format from regular selectors, with { value, label, children } structure:
Step 3: Generate Config Array
Generate a formkit config array following the project's existing pattern. Each config item follows this structure:
Key Naming Rules:
- Use camelCase (e.g.
deptName,phone,createTime) - Names should be descriptive yet concise
- Map Chinese label meanings to English (e.g. "机构名称" ->
deptNameorinstitutionName)
Options Format (select/radio/checkbox):
Step 4: Generate Complete Vue Component Code
Generate code containing the following:
- Template: Use the
<formkit>component with:configandv-model - Script: Import formkit, define reactive form data and config
Template Pattern
Common formkit Component Properties:
| Property | Type | Description | |
|---|---|---|---|
config | Array | Form field configuration array | |
v-model | Object | Reactive form data object | |
label-position | String | Label position: 'left' / 'right' / 'top' | |
label-width | Number | Component prop (Number): sets the uniform label width for all form items. Can also be used in individual config items (String) for precise control, with higher priority than the component prop |
label-width Calculation Strategy (only effective whenlabel-positionis'left'or'right', ignored when'top'):1. Analyze the label widths of all form items in the image, calculate an average, and set it as the component proplabel-width(number type)2. If a form item has a label significantly wider than the average, precisely specifylabelWidth: '150px'(string type) in that config item to prevent label text wrappingExample: Most labels are about 80px wide, but one label "Central Local Unit Identifier" is about 150px wide:```ts// Set uniformly on component<formkit :label-width="80" ... />// Override precisely in the specific config item{ type: 'radio', label: 'Central Local Unit Identifier', key: 'unitId', labelWidth: '150px', ... }```
columns | Number | Number of form items per row for quick uniform layout (e.g. columns: 3 means 3 items per row) | |
|---|---|---|---|
span | Number | Grid span for a single form item (24-grid system), configured in the config item, with higher priority than columns | |
gap | Object | Spacing between items: { col: 30, row: 20 } (col is column gap, row is row gap) | |
size | String | Component size: 'large' / 'default' / 'small' | |
disabled | Boolean | Disable all form items | |
ref | String | Template reference for accessing form methods (e.g. validate()) |
Script Pattern
Step 5: Handle Special Cases
Dictionary Dropdown Fields: If the dropdown select field in the image may use system dictionary data:
Grouped Form Sections: If the form has groups/sections, use el-divider or section titles between multiple <formkit> instances:
Span Fine-grained Layout Control:
Both columns and span control the number of form items per row and do not conflict:
columnsis a component prop for quick uniform layout (e.g.columns: 3means exactly 3 items per row)spanis a config item prop that divides each row into 24 equal parts, precisely controlling how many parts each item occupies, with higher priority than `columns`
Usage Strategy:
- If the form has a fixed number of columns per row, simply use
columns - If most rows have a fixed column count but some rows differ (e.g. a row with only 2 or 4 items), use
spanfor those rows
Example: Assuming columns: 3 (3 items per row, each taking 8 equal parts), but one row has only 2 items that should each take half:
Disabled/Read-only Fields:
Slots:
formkit supports various slots for extending form content. For full documentation, refer to: element-plus-formkit Slots
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 91 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/element-plus-formkit-generator/SKILL.md
Popularity
- Repository stars
- 71
- Repository forks
- 6
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wxsub/element-plus-formkit/element-plus-formkit-generator)