vani-jsx-setup
8
总安装量
6
周安装量
#34162
全站排名
安装命令
npx skills add https://github.com/itsjavi/vani --skill vani-jsx-setup
Agent 安装分布
claude-code
3
windsurf
2
trae
2
opencode
2
github-copilot
2
Skill 文档
Vani JSX Setup
Instructions for enabling JSX with Vani and creating JSX-based components.
When to Use
Use this when a project wants .tsx files with Vani or needs a JSX example.
Steps
- Ensure
tsconfig.jsonsetsjsxtoreact-jsxandjsxImportSourceto@vanijs/vani. - Create a
.tsxcomponent usingcomponentand return JSX. - Keep state in local variables and call
handle.update()on events. - Mount with
renderToDOMas usual.
Arguments
- tsconfigPath – path to TypeScript config (defaults to
tsconfig.json) - componentName – name of the JSX component (defaults to
Counter) - mountSelector – id for the root element (defaults to
app)
Examples
Example 1 usage pattern:
Configure JSX and create a <button> counter that calls handle.update() on click.
Example 2 usage pattern:
Mix JSX components inside JS-first components using @vanijs/vani/html helpers.
Output
Example output:
Updated: tsconfig.json
Created: src/counter.tsx
Notes: JSX uses @vanijs/vani as jsxImportSource.
Present Results to User
Explain the JSX settings, highlight where explicit updates happen, and list the files changed.