Open7

v0

nassynassy

v0 が動く環境の構築手順

手順構築

npm create vite@latest gui -- --template react-ts

以下の手順に従う

https://ui.shadcn.com/docs/installation/vite

Would you like to use TypeScript (recommended)? no / yes -> yes
Which style would you like to use? › Default -> Default
Which color would you like to use as base color? › Slate -> Slate
Where is your global CSS file? › › src/index.css -> src/index.css.  (以前間違えた!)
Do you want to use CSS variables for colors? › no / yes -> yes
Are you using a custom tailwind prefix eg. tw-? (Leave blank if not) -> blank
Where is your tailwind.config.js located? › tailwind.config.js  -> tailwind.config.js
Configure the import alias for components: › @/components -> @/components
Configure the import alias for utils: › @/lib/utils -> @/lib/utils
Are you using React Server Components? › no / yes (no) -> no
Write configuration to components.json. Proceed? > yes

component を追加する

npx shadcn-ui@latest add button input label table textarea tabs dropdown-menu

v0のコンポーネントを足す

npm install react-router-dom
mkdir src/components/pages
touch src/components/pages/component.tsx

component.tsx を以下にする

export default function Component() {
  return (
      <>
        <div>hoge</div>
      </>
  )
}

App.tsx を書き換える。

import './App.css'
import Component from "@/components/pages/component.tsx";
import {
    BrowserRouter as Router,
    Routes,
    Route,
} from 'react-router-dom';

function App() {

  return (
        <Router>
            <Routes>
                <Route path="/" element={<Component />}/>
            </Routes>
        </Router>
  )
}

export default App

v0のcomponentを貼り付ける。

参考(コンポーネント一覧)

https://ui.shadcn.com/docs/components/accordion

nassynassy

開発工程ですること

  • 全てのフロントが表示される状態にする
    • ボタンを押したら表示されるwindndow
    • スナックバー
    • データが無いよの表示
  • API Client を作る
  • 繋ぎこむ
nassynassy

npx create-next-app@latest --typescript --tailwind --eslint --app --src-dir --use-npm

以下の手順に従う
https://ui.shadcn.com/docs/installation/next

Edit tsconfig.json file を vite versionを参考にする

✔ Which style would you like to use? › Default
✔ Which color would you like to use as base color? › Zinc
✔ Would you like to use CSS variables for colors? … no / yes -> yes