Installation
Neumorphism UI は Base UI primitive を使う shadcn Registry です。コンポーネントのソースと CSS token をプロジェクトへコピーします。React、Tailwind CSS、shadcn CLI が必要です。
1. shadcn を初期化
components.json がない場合は、最初に shadcn を初期化してください。
shadcn 初期化コマンド
npx shadcn@latest init2. Registry を接続
CLI で namespace と現在の Registry URL を登録します。
Registry 登録コマンド
npx shadcn@latest registry add @neumorphism-ui=https://neumorphism-ui.dev/r/{name}.jsoncomponents.json に直接追加
namespace は @neumorphism-ui、URL テンプレートは https://neumorphism-ui.dev/r/{name}.json です。
components.json の Registry 設定
{
"registries": {
"@neumorphism-ui": "https://neumorphism-ui.dev/r/{name}.json"
}
}3. コンポーネントを追加
共享基础主题只需首次安装。之后添加组件不会重新安装所选主题。
インストール: neumorphism-ui
npx shadcn@latest add @neumorphism-ui/neumorphism-ui基本テーマの後、Next.jsのapp/layout.tsxまたはViteのsrc/main.tsxでフォントCSSを一度読み込みます。
Pretendard
import "pretendard/dist/web/variable/pretendardvariable.css";Sage スタイルをインストール
npx shadcn@latest add @neumorphism-ui/button --overwrite仅在替换初始生成的按钮时使用 --overwrite。替换自定义按钮前,请先提交并检查更改。
4. テーマを適用
style item はコンポーネントのソースを変えずに、パレット、シャドウ、角丸 token を上書きします。導入前に dry-run で変更内容を確認できます。
Dry run
Sage スタイルの dry-run
npx shadcn@latest add @neumorphism-ui/style-sage --dry-runInstall
Sage スタイルをインストール
npx shadcn@latest add @neumorphism-ui/style-sageほかの preset と詳細 token は Theme Studioで確認できます。