Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/rhinobase/raftyui
Browse files Browse the repository at this point in the history
  • Loading branch information
Dk579 committed Oct 13, 2023
2 parents 65d6da0 + 202805b commit 279c635
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 106 deletions.
49 changes: 27 additions & 22 deletions examples/rafty-nextjs-pages-router-ts/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Rafty UI - Next.js Pages Router example in TypeScript

## Getting Started
This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with Rafty UI installed.

First, run the development server:
## How to use

Download the example [or clone the repo](https://github.com/rhinobase/raftyui):

<!-- #default-branch-switch -->

```bash
npx create-next-app rafty-nextjs-pages-router-ts --example https://github.com/rhinobase/raftyui/tree/main/examples/rafty-nextjs-pages-router-ts
cd rafty-nextjs-pages-router-ts
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
or:

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
<!-- #default-branch-switch -->

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs-pages-router-ts)

## Learn More
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs-pages-router-ts)

To learn more about Next.js, take a look at the following resources:
## Learn more

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
To learn more about this example:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
- [Next.js documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Customizing Rafty UI](https://rafty.rhinobase.io) - approaches to customizing Rafty UI.

## Deploy on Vercel
## What's next?

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
<!-- #default-branch-switch -->

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
You now have a working example project.
You can head back to the documentation and continue by browsing the [templates](https://rafty.rhinobase.io/docs/examples) section.
49 changes: 27 additions & 22 deletions examples/rafty-nextjs-pages-router/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Rafty UI - Next.js Pages Router example

## Getting Started
This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with Rafty UI installed.

First, run the development server:
## How to use

Download the example [or clone the repo](https://github.com/rhinobase/raftyui):

<!-- #default-branch-switch -->

```bash
npx create-next-app rafty-nextjs-pages-router --example https://github.com/rhinobase/raftyui/tree/main/examples/rafty-nextjs-pages-router
cd rafty-nextjs-pages-router
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
or:

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
<!-- #default-branch-switch -->

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs-pages-router)

## Learn More
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs-pages-router)

To learn more about Next.js, take a look at the following resources:
## Learn more

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
To learn more about this example:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
- [Next.js documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Customizing Rafty UI](https://rafty.rhinobase.io) - approaches to customizing Rafty UI.

## Deploy on Vercel
## What's next?

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
<!-- #default-branch-switch -->

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
You now have a working example project.
You can head back to the documentation and continue by browsing the [templates](https://rafty.rhinobase.io/docs/examples) section.
47 changes: 28 additions & 19 deletions examples/rafty-nextjs-ts/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Rafty UI - Next.js App Router example in TypeScript

## Getting Started
This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with Rafty UI installed.

First, run the development server:
## How to use

Download the example [or clone the repo](https://github.com/rhinobase/raftyui):

<!-- #default-branch-switch -->

```bash
npx create-next-app rafty-nextjs-ts --example https://github.com/rhinobase/raftyui/tree/main/examples/rafty-nextjs-ts
cd rafty-nextjs-ts
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
or:

<!-- #default-branch-switch -->

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs-ts)

## Learn More
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs-ts)

To learn more about Next.js, take a look at the following resources:
## Learn more

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
To learn more about this example:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
- [Next.js documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Customizing Rafty UI](https://rafty.rhinobase.io) - approaches to customizing Rafty UI.

## Deploy on Vercel
## What's next?

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
<!-- #default-branch-switch -->

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
You now have a working example project.
You can head back to the documentation and continue by browsing the [templates](https://rafty.rhinobase.io/docs/examples) section.
47 changes: 28 additions & 19 deletions examples/rafty-nextjs/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Rafty UI - Next.js App Router example

## Getting Started
This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with Rafty UI installed.

First, run the development server:
## How to use

Download the example [or clone the repo](https://github.com/rhinobase/raftyui):

<!-- #default-branch-switch -->

```bash
npx create-next-app rafty-nextjs --example https://github.com/rhinobase/raftyui/tree/main/examples/rafty-nextjs
cd rafty-nextjs
```

Install it and run:

```bash
npm install
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
or:

<!-- #default-branch-switch -->

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs)

## Learn More
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/rhinobase/raftyui/tree/main/examples/rafty-nextjs)

To learn more about Next.js, take a look at the following resources:
## Learn more

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
To learn more about this example:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
- [Next.js documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Customizing Rafty UI](https://rafty.rhinobase.io) - approaches to customizing Rafty UI.

## Deploy on Vercel
## What's next?

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
<!-- #default-branch-switch -->

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
You now have a working example project.
You can head back to the documentation and continue by browsing the [templates](https://rafty.rhinobase.io/docs/examples) section.
50 changes: 31 additions & 19 deletions examples/rafty-vite-ts/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
# React + TypeScript + Vite
# Rafty UI - Vite.js example in TypeScript

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
## How to use

Currently, two official plugins are available:
Download the example [or clone the repo](https://github.com/rhinobase/raftyui):

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
<!-- #default-branch-switch -->

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
```bash
npx degit https://github.com/rhinobase/raftyui/examples/rafty-vite-ts rafty-vite-ts
cd rafty-vite-ts
```

- Configure the top-level `parserOptions` property like this:
Install it and run:

```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```bash
npm install
npm run dev
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
or:

<!-- #default-branch-switch -->

[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/rhinobase/raftyui/tree/main/examples/rafty-vite-ts)

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/rhinobase/raftyui/tree/main/examples/rafty-vite-ts)

## The idea behind the example

This example uses [Vite.js](https://github.com/vitejs/vite).
It includes [@rafty/ui](https://rafty.rhinobase.io) and its dev dependencies, `@rafty/plugin`, the default style engine in Rafty UI.

## What's next?

<!-- #default-branch-switch -->

You now have a working example project.
You can head back to the documentation and continue by browsing the [templates](https://rafty.rhinobase.io/docs/examples) section.
41 changes: 36 additions & 5 deletions examples/rafty-vite/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
# React + Vite
# Rafty UI - Vite.js example

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
## How to use

Currently, two official plugins are available:
Download the example [or clone the repo](https://github.com/rhinobase/raftyui):

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
<!-- #default-branch-switch -->

```bash
npx degit https://github.com/rhinobase/raftyui/examples/rafty-vite rafty-vite
cd rafty-vite
```

Install it and run:

```bash
npm install
npm run dev
```

or:

<!-- #default-branch-switch -->

[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/rhinobase/raftyui/tree/main/examples/rafty-vite)

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/rhinobase/raftyui/tree/main/examples/rafty-vite)

## The idea behind the example

This example uses [Vite.js](https://github.com/vitejs/vite).
It includes [@rafty/ui](https://rafty.rhinobase.io) and its dev dependencies, `@rafty/plugin`, the default style engine in Rafty UI.

## What's next?

<!-- #default-branch-switch -->

You now have a working example project.
You can head back to the documentation and continue by browsing the [templates](https://rafty.rhinobase.io/docs/examples) section.

0 comments on commit 279c635

Please sign in to comment.