├── .eslintrc.json ├── .gitignore ├── README.md ├── app ├── favicon.ico ├── globals.css ├── layout.tsx └── page.tsx ├── components ├── ADialog.tsx ├── AccordionDemo.tsx ├── Employee.tsx └── TextAnimation.tsx ├── next.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── next.svg ├── profile.png ├── united states.svg └── vercel.svg ├── tailwind.config.ts └── tsconfig.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 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). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | # or 12 | pnpm dev 13 | # or 14 | bun dev 15 | ``` 16 | 17 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 18 | 19 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. 20 | 21 | This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. 22 | 23 | ## Learn More 24 | 25 | To learn more about Next.js, take a look at the following resources: 26 | 27 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 28 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 29 | 30 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 31 | 32 | ## Deploy on Vercel 33 | 34 | 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. 35 | 36 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 37 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rehan-Ul-Haq/Introduction-to-Radix-UI/d3fbce5089c63bdc8f2ad53fe91e46271c11d034/app/favicon.ico -------------------------------------------------------------------------------- /app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import { Inter } from "next/font/google"; 3 | import "./globals.css"; 4 | // import "@radix-ui/themes/styles.css"; 5 | // import { Theme, ThemePanel } from "@radix-ui/themes"; 6 | 7 | const inter = Inter({ subsets: ["latin"] }); 8 | 9 | export const metadata: Metadata = { 10 | title: "Create Next App", 11 | description: "Generated by create next app", 12 | }; 13 | 14 | export default function RootLayout({ 15 | children, 16 | }: { 17 | children: React.ReactNode; 18 | }) { 19 | return ( 20 | 21 | 22 | {/* */} 23 | {children} 24 | {/* */} 25 | {/* */} 26 | 27 | 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /app/page.tsx: -------------------------------------------------------------------------------- 1 | import ADialog from "@/components/ADialog"; 2 | import AccordionDemo from "@/components/AccordionDemo"; 3 | import Employee from "@/components/Employee"; 4 | import { TextAnimation } from "@/components/TextAnimation"; 5 | 6 | export default function Home() { 7 | return ( 8 |
9 | {/*By default, AccordionDemo is being displayed. comment it before using other components */} 10 | 11 | 12 | {/* comment all other components. To use this, uncomment Theme, ThemePanel, and their imports in layout.tsx */} 13 | {/* */} 14 | 15 | {/* Check out how to use Radix Styling options (Flex, Text, Heading, Avatar, Box and Card) */} 16 | {/* */} 17 | 18 | {/* Just a quick demo of TextAnimation using framer motion. make sure to install framer motion */} 19 | {/* */} 20 |
21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /components/ADialog.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { AlertDialog, Button, Flex } from "@radix-ui/themes"; 3 | 4 | 5 | export default function ADialog() { 6 | return ( 7 |
8 | 9 | 10 | 11 | 12 | 13 | Revoke access 14 | 15 | Are you sure? This application will no longer be accessible and any 16 | existing sessions will be expired. 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /components/AccordionDemo.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import * as Accordion from "@radix-ui/react-accordion"; 3 | import { ChevronDownIcon } from "@radix-ui/react-icons"; 4 | 5 | export default function AccordionDemo() { 6 | const data = [ 7 | { title: "Is it accessible", content: "Yes, it is accessible" }, 8 | { title: "Is it static", content: "Yes, it is static" }, 9 | { title: "Is it fast", content: "Yes, it is fast" }, 10 | ]; 11 | 12 | return ( 13 |
14 | 15 | {data.map((item: any, index) => ( 16 | 17 | 18 | 19 |

20 | {item.title} 21 |

22 | 23 |
24 |
25 | 26 |

27 | {item.content} 28 |

29 |
30 |
31 | ))} 32 |
33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /components/Employee.tsx: -------------------------------------------------------------------------------- 1 | 2 | import { 3 | Avatar, 4 | Badge, 5 | Box, 6 | Card, 7 | Flex, 8 | Heading, 9 | Text 10 | } from "@radix-ui/themes"; 11 | 12 | export default function Employee() { 13 | return ( 14 | <> 15 | 16 | 17 | 18 | 27 | 28 | 34 | BONG CHA 35 | Marketing Manager 36 | 37 | 38 | Active 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Phone: 49 | 50 | 51 | +x (xxx) xxx-xxxx 52 | 53 | 54 | 55 | 56 | 57 | 58 | Email: 59 | 60 | 61 | abc@example.com 62 | 63 | 64 | 65 | 66 | 67 | 68 | Department: 69 | 70 | 71 | Marketing 72 | 73 | 74 | 75 | 76 | 77 | 78 | Gender: 79 | 80 | 81 | Female 82 | 83 | 84 | 85 | 86 | 87 | 88 | ); 89 | } 90 | -------------------------------------------------------------------------------- /components/TextAnimation.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import { motion } from "framer-motion"; 3 | 4 | export function TextAnimation({ text }: { text: string }) { 5 | const words = `${text}`; 6 | const letters = words.split(""); 7 | 8 | const pullupVariant = { 9 | initial: { y: 100, opacity: 0 }, 10 | animate: (i: any) => ({ 11 | y: 0, 12 | opacity: 1, 13 | transition: { 14 | delay: i * 0.05, // Delay each letter's animation by 0.05 seconds 15 | }, 16 | }), 17 | }; 18 | 19 | return ( 20 |
21 | {letters.map((letter, i) => ( 22 | 30 | {letter === " " ?   : letter} 31 | 32 | ))} 33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {} 3 | 4 | module.exports = nextConfig 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@radix-ui/react-accordion": "^1.1.2", 13 | "@radix-ui/react-icons": "^1.3.0", 14 | "@radix-ui/themes": "^2.0.3", 15 | "framer-motion": "^10.17.4", 16 | "next": "14.0.4", 17 | "react": "^18", 18 | "react-dom": "^18" 19 | }, 20 | "devDependencies": { 21 | "@types/node": "^20", 22 | "@types/react": "^18", 23 | "@types/react-dom": "^18", 24 | "autoprefixer": "^10.0.1", 25 | "eslint": "^8", 26 | "eslint-config-next": "14.0.4", 27 | "postcss": "^8", 28 | "tailwindcss": "^3.3.0", 29 | "typescript": "^5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rehan-Ul-Haq/Introduction-to-Radix-UI/d3fbce5089c63bdc8f2ad53fe91e46271c11d034/public/profile.png -------------------------------------------------------------------------------- /public/united states.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'tailwindcss' 2 | 3 | const config: Config = { 4 | content: [ 5 | './pages/**/*.{js,ts,jsx,tsx,mdx}', 6 | './components/**/*.{js,ts,jsx,tsx,mdx}', 7 | './app/**/*.{js,ts,jsx,tsx,mdx}', 8 | ], 9 | theme: { 10 | extend: { 11 | backgroundImage: { 12 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 13 | 'gradient-conic': 14 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', 15 | }, 16 | }, 17 | }, 18 | plugins: [], 19 | } 20 | export default config 21 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | --------------------------------------------------------------------------------