๐ Integrate AIOHA with Your React App from Scratch (Vite + Tailwind + DaisyUI)
Hey Hive fam! ๐
Are you building a React app and wondering "How the heck do I add Hive login with AIOHA?" ๐ตโ๐ซ
Well, youโre in for a treat! Because in this post, Iโll walk you through integrating the @aioha package into a React project from scratchโwith sprinkles of Tailwind, DaisyUI, and good vibes. ๐๐ป
๐งฐ Project Setup
๐จ Step 1: Create Your Vite + React + TypeScript App
npm create vite@latest vite-react-aioha-ts -- --template react-ts
cd vite-react-aioha-ts
npm install
๐ Step 2: Add TailwindCSS
npm install tailwindcss @tailwindcss/vite
npm install -D postcss autoprefixer
Edit vite.config.ts:
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [react(), tailwindcss()],
});
๐ธ Screenshot for visual learners:
๐ธ Add DaisyUI (Because UI should never be boring!)
npm i -D daisyui@latest
๐ฆ Install AIOHA
pnpm i @aioha/react-ui @aioha/aioha
Now weโre getting serious! ๐
โ๏ธ Integrate AIOHA in App.tsx
๐งฝ Clean up App.tsx (yes, delete the fluff).
๐ธ Here's how mine looks:
๐ค Add Hive User Avatar Button Component
Create a file: HiveUserAvatarButton.tsx
๐งโ๐จ Use DaisyUI Avatar Component
Copy JSX from DaisyUI Docs and paste into your component.
Shorthand tip: Type
rafcein your file to scaffold the component โก
๐ช Combine DaisyUI + AIOHA
In HiveUserAvatarButton.tsx, do the following:
- Import AIOHA methods
- Add a button to open login modal
- Use AIOHA popup (copied from official docs)
๐ฏ Final result:
๐ Plug the Button into App.tsx
Import and use your shiny new <HiveUserAvatarButton /> wherever needed.
๐ Debug Like a Pro (in VS Code)
- Click on Run & Debug
- Choose "Web App (Chrome)"
- Edit the launch fileโset port to
5173 - Run the app with:
npm run dev
...then hit F5 to debug inside Chrome! ๐ต๏ธโโ๏ธ
โจ Polish & Final Touches
๐ Fix: Avatar isnโt rounded?
Add overflow-hidden to fix that:
<div className="avatar overflow-hidden">...</div>
๐ซ Fix: CSS conflicts with AIOHA
Some popup buttons werenโt displaying properly due to boilerplate styles.
I removed unnecessary button CSS and boom ๐ฅโitโs fixed!
๐งช Try Out Account Switching
Logged in as @shaktimaaan for testing. Here's the login view and switch-user popup:
Dear
@techcoderx โ consider adding avatars in switch-user list? ๐๐
๐ฅณ Wrap-Up
Weโve successfully:
โ
Created a modern React + Vite + Tailwind setup
โ
Integrated AIOHA login + popup
โ
Styled it with DaisyUI
โ
Fixed common issues
โ
Debugged like a pro in VS Code
If you found this helpful, donโt forget to upvote ๐งก
Your support keeps me coding and caffeinated! โ
More power to Hive & its awesome community! ๐๐ฅ
๐ Final Note
Since English isnโt my first language, I asked ChatGPT/AI to help optimize this post to make it more readable and viewer-friendly.
I hope this isnโt against any downvoting rules ๐
But if it is, feel free to let me know and Iโll be more cautious next time.
๐ My Contributions to โฆ๏ธ Hive Ecosystem
| Contribution | To | Hive | Ecosystem |
|---|---|---|---|
| Hive Witness Node | Hive API Node (in progress) | 3Speak Video Encoder Node Operator (highest number of nodes) | 3Speak Mobile App Developer |
| 3Speak Podcast App Developer | 3Speak Shorts App Developer | 3Speak Support & Maintenance Team | Distriator Developer |
| CheckinWithXYZ | Hive Inbox | HiFind | Hive Donate App |
| Contributed to HiveAuth Mobile App | Ecency โ 3Speak Integration | Ecency โ InLeo Integration | Ecency โ Actifit Integration |
| Hive Stats App | Vote for Witness App | HiveFlutterKit | New 3Speak App |
๐ Support Back
โค๏ธ Appreciate my work? Consider supporting @threespeak &
@sagarkothari88! โค๏ธ
| Vote | For | Witness |
|---|---|---|
| sagarkothari88 | ||
| threespeak |
Leave ๐ Integrate AIOHA with Your React App from Scratch (Vite + Tailwind + DaisyUI) to:
Read more #hive posts
Best Posts From Sagar Kothari
We have not curated any of sagarkothari88's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Sagar Kothari
- HiveReactKit Development Update: Improved Translation Engine, Version History & Advanced Post Inspection
- HiveSuite Development Update: Stable Hive Node Control, Advanced Media Viewer & Exchange Directory
- HiveSuite Dev Update: Exchanges Directory & Media Experience
- HiveReactKit Dev Update: Translation Controls & Wallet Trxns UX
- HiveSuite Dev Update: Persistent Nav & Scroll Restoration
- HiveSuite Dev Update: Market Prices Popup & Persistent Nav Ex
- HiveReactKit Dev Update: Image Preview, Translation & Wallet Enhancements
- HiveReactKit v1.2.5: Scroll Restoration Magic โจ #opensource #hive
- HiveSuite Can Now Publish to ANY Hive App ๐ #opensource #hive
- Re-Snaps, Smarter Replies & Bulletproof Node Routing ๐ #hive #opensource