Skip to content

Commit

Permalink
feat: integrate PrimeReact components and update styling with Tailwin…
Browse files Browse the repository at this point in the history
…d CSS
  • Loading branch information
Ism1tha committed Jan 28, 2025
1 parent 7cab383 commit eb4cbe6
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 11 deletions.
108 changes: 100 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"dependencies": {
"@tailwindcss/vite": "^4.0.0",
"primereact": "^10.9.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwindcss": "^4.0.0",
Expand Down
14 changes: 13 additions & 1 deletion resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
@import "tailwindcss";
@layer tailwind-base, primereact, tailwind-utilities;

/* IMPORTANT: In "styled" mode you must add the PrimeReact Theme here. Do NOT include in "unstyled" mode */
@import 'primereact/resources/themes/lara-light-blue/theme.css' layer(primereact);

@layer tailwind-base {
@tailwind base;
}

@layer tailwind-utilities {
@tailwind components;
@tailwind utilities;
}
9 changes: 8 additions & 1 deletion resources/ts/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import React from "react";
import { Button } from 'primereact/button';
import { useEffect } from "react";

const App: React.FC = () => {
return "Hello, World from React!";
return (
<div className="p-4">
<h1 className="text-2xl font-bold">Hello, World from React and Tailwind CSS!</h1>
<Button label="Click Me" onClick={() => alert('Hello, World!')} />
</div>
);
};

export default App;
5 changes: 4 additions & 1 deletion resources/ts/main.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { PrimeReactProvider } from 'primereact/api';

const rootElement = document.getElementById("app");
if (rootElement) {
const root = ReactDOM.createRoot(rootElement); // This is correct for React 18+
root.render(
<React.StrictMode>
<App />
<PrimeReactProvider>
<App />
</PrimeReactProvider>
</React.StrictMode>
);
}

0 comments on commit eb4cbe6

Please sign in to comment.