x0k/svelte-jsonschema-form/sjsf-custom-components
Claude Code and agent skill by x0k/svelte-jsonschema-form
- community
Checking that the SKILL.md file is still in the repository.
Create custom widgets, field templates, and component adapters for svelte-jsonschema-form in Svelte 5. Use when creating custom input controls, overriding theme components, extending theme resolvers with overrideByRecord/extendByRecord, typing props with ComponentProps, or augmenting UiOptions.
Install
npx vskill@latest install x0k/svelte-jsonschema-form/sjsf-custom-componentsSKILL.md
SJSF Custom Components
This skill explains how to build custom widgets, modify theme components, and extend field templates in svelte-jsonschema-form (v3) using Svelte 5 runes.
Step 1: Writing a Custom Widget Component
Custom widgets receive value = $bindable(), config, and handlers. For native elements, build props with inputAttributes:
If your widget renders a wrapper component instead of a native element directly, keep spreading — the attachment (a symbol-keyed prop inside attributes) forwards through each spread until it lands on a native element:
Only when the third-party input does NOT forward spreads/attachments (e.g. bits-ui / skeleton components with explicit onValueChange props), map handlers: { oninput, onchange, onblur } (Handlers in WidgetCommonProps) to its event props via spread. Call manually only inside your own handler when you also do work (filtering, value mapping):
See Component Types Reference for available component and widget prop signatures.
Step 2: Replacing Components via UI Schema
To use a custom component for a specific field or across the form without altering the global theme, specify it in uiSchema:
Step 3: Overriding Theme Globally with overrideByRecord
extendByRecord registers new components; overrideByRecord replaces existing ones:
Export this modified theme from src/lib/sjsf/defaults.ts.
Step 4: Custom UI Options & Type Augmentation
Namespace custom widget options under one prefixed key:
Set via "ui:options": { myColorPicker: { ... } }. Read with uiOption("myColorPicker"), or merge a custom option bag with composeProps — include the common steps (inputProps for id/name/required, disabledProp, aria helpers), not just uiOptionProps alone:
For native elements skip the hand-rolled chain and use inputAttributes (Step 1) — it composes all of the above plus the handlers attachment.
See UI Options Augmentation Reference for full TypeScript recipes.
Gotchas & Rules
- Nullable Values: Widgets receive
value: V | undefined. For text inputs map empty toundefined:
``svelte <input bind:value={() => value ?? "", (v) => (value = v || undefined)} /> ``
- Event Attachment via `handlers`:
inputAttributes/selectAttributes/textareaAttributesembedhandlersAttachment(handlers)(symbol-keyed@attach, forwarded through spreads). Spread{...attributes}and do nothing else. Only if the custom input drops attachments, map by reference (onValueChange: handlers.oninput) or callhandlers.oninput?.()inside your own wrapper handler.Confighas noid/disabled. - Queries vs Commands in Form Context:
- Queries (
retrieveUiOption,getFieldErrors,getId) track reactive dependencies. - Commands (
updateErrors,setValue,validateField) do not track dependencies and are used in callbacks.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sjsf-custom-components/SKILL.md
Popularity
- 7-day trend score
- 0
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/x0k/svelte-jsonschema-form/sjsf-custom-components)