Sagar Kothari avatar

๐Ÿš€ Integrate AIOHA with Your React App from Scratch (Vite + Tailwind + DaisyUI)

sagarkothari88

Published: 27 Jul 2025 โ€บ Updated: 27 Jul 2025๐Ÿš€ Integrate AIOHA with Your React App from Scratch (Vite + Tailwind + DaisyUI)

๐Ÿš€ Integrate AIOHA with Your React App from Scratch (Vite + Tailwind + DaisyUI)

reactjs + tailwind + vite

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@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:
vite.config.ts


๐ŸŒธ 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:
App.tsx screenshot


๐Ÿ‘ค 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 rafce in your file to scaffold the component โšก

JSX snippet for avatar


๐Ÿช„ Combine DaisyUI + AIOHA

In HiveUserAvatarButton.tsx, do the following:

  1. Import AIOHA methods
  2. Add a button to open login modal
  3. Use AIOHA popup (copied from official docs)

๐ŸŽฏ Final result:
Daisy + AIOHA integration


๐Ÿ”— Plug the Button into App.tsx

Import and use your shiny new <HiveUserAvatarButton /> wherever needed.


๐Ÿž Debug Like a Pro (in VS Code)

  1. Click on Run & Debug
  2. Choose "Web App (Chrome)"
  3. Edit the launch fileโ€”set port to 5173
  4. Run the app with:
npm run dev

...then hit F5 to debug inside Chrome! ๐Ÿ•ต๏ธโ€โ™€๏ธ
VS Code Debug


โœจ Polish & Final Touches

๐ŸŒ€ Fix: Avatar isnโ€™t rounded?

Add overflow-hidden to fix that:

<div className="avatar overflow-hidden">...</div>

Fix overflow


๐Ÿšซ 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!

Remove boilerplate CSS


๐Ÿงช Try Out Account Switching

Logged in as @shaktimaaan for testing. Here's the login view and switch-user popup:

Switch User

Dear techcoderx@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

ContributionToHiveEcosystem
Hive Witness NodeHive API Node (in progress)3Speak Video Encoder Node Operator (highest number of nodes)3Speak Mobile App Developer
3Speak Podcast App Developer3Speak Shorts App Developer3Speak Support & Maintenance TeamDistriator Developer
CheckinWithXYZHive InboxHiFindHive Donate App
Contributed to HiveAuth Mobile AppEcency โ†” 3Speak IntegrationEcency โ†” InLeo IntegrationEcency โ†” Actifit Integration
Hive Stats AppVote for Witness AppHiveFlutterKitNew 3Speak App

๐Ÿ™Œ Support Back

โค๏ธ Appreciate my work? Consider supporting threespeak@threespeak & sagarkothari88@sagarkothari88! โค๏ธ

VoteForWitness
sagarkothari88sagarkothari88@sagarkothari88
threespeakthreespeak@threespeak

Leave ๐Ÿš€ Integrate AIOHA with Your React App from Scratch (Vite + Tailwind + DaisyUI) to:

Written by

App Developer on Hive - Distriator, Check in With XYZ, 3Speak, HiveSuite.app.

Read more #hive posts


Best Posts From Sagar Kothari

More Posts From Sagar Kothari