Leave Yamada UI a star

Star
Yamada UIYamada UIv1.7.2

Getting Started with Gatsby

Install the package

First, create your application.

Execute one of the following commands in the terminal.

pnpm create gatsby -ts
Copied!

Yamada UI allows you to use most components and hooks by simply installing @yamada-ui/react.

pnpm add @yamada-ui/react
Copied!

If you want to use tables, calendars, carousels, etc., you need to install them separately.

pnpm add @yamada-ui/table
Copied!
PackageDescription
@yamada-ui/table

Provides convenient table components using @tanstack/react-table.

@yamada-ui/calendar

Provides convenient calendar and date picker components using dayjs.

@yamada-ui/carousel

Provides convenient carousel components using embla-carousel-react.

@yamada-ui/dropzone

Provides convenient dropzone components using react-dropzone.

@yamada-ui/charts

Provides convenient chart components using recharts.

@yamada-ui/markdown

Provides convenient markdown components using react-markdown and react-syntax-highlighter.

@yamada-ui/fontawesome

Provides components for conveniently using Font Awesome.

Add UIProvider

After installing Yamada UI, create gatsby-browser.tsx and add UIProvider.

gatsby-browser.tsx

import * as React from "react"
import type { GatsbyBrowser } from "gatsby"
import { UIProvider } from "@yamada-ui/react"
export const wrapPageElement: GatsbyBrowser["wrapPageElement"] = ({
element,
}) => {
return <UIProvider>{element}</UIProvider>
}
Copied!

Use components

Once you've added UIProvider, you can start using components within your application.

index.tsx

import * as React from "react"
import { Button } from "@yamada-ui/react"
import type { HeadFC, PageProps } from "gatsby"
const IndexPage: React.FC<PageProps> = () => {
return <Button>Click me!</Button>
}
export default IndexPage
export const Head: HeadFC = () => <title>Home Page</title>
Copied!

Edit this page on GitHub

PreviousRemixNextHono