Contributing · How to add components to Forge.
var(--background) 等變數,支援明暗模式。components/taiwan/<ComponentName>/index.tsx 建立元件。lib/registry.ts 新增 metadata(slug、props 等)。lib/code-examples/<slug>.ts 提供三段範例(basic / fullProps / formIntegration)。app/components/[slug]/ComponentDemo.tsx 加入互動展示變體。npm run build,確保無型別錯誤。"use client";
import { useState } from "react";
export interface MyComponentProps {
value: string;
onChange: (v: string) => void;
disabled?: boolean;
}
export default function MyComponent({
value,
onChange,
disabled = false,
}: MyComponentProps) {
return (
<input
value={value}
onChange={(e) => onChange(e.target.value)}
disabled={disabled}
className="w-full px-3 py-2 rounded-lg border border-[var(--input-border)] bg-[var(--input-bg)]"
/>
);
}發現 bug 或有新元件想法?前往 /submit 提交,或直接在 GitHub 開 issue。