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

By sagarkothari88 on 7/27/2025

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 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 – 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 @sagarkothari88
threespeak @threespeak

Comments (5)

indiaunited's avatar @indiaunited 7/27/2025

This post has been manually curated by @steemflow from Indiaunited community. Join us on our Discord Server.

Do you know that you can earn a passive income by delegating to @indiaunited. We share more than 100 % of the curation rewards with the delegators in the form of IUC tokens. HP delegators and IUC token holders also get upto 20% additional vote weight.

Here are some handy links for delegations: 100HP, 250HP, 500HP, 1000HP.

image.png

100% of the rewards from this comment goes to the curator for their manual curation efforts. Please encourage the curator @steemflow by upvoting this comment and support the community by voting the posts made by @indiaunited.

sagarkothari88's avatar @sagarkothari88 7/28/2025

Thank you so much @indiaunited & @steemflow for curation. Have a good day.
via Inbox

kgakakillerg's avatar @kgakakillerg 7/29/2025

Can you please stop downvoting me with your alt account @letsusbuyhive tell Dan and Marcus I said hello πŸ‘‹πŸΎπŸ˜

weone's avatar @weone 7/27/2025

Thanks for the nice and simple tutorial 😊

sagarkothari88's avatar @sagarkothari88 7/28/2025

You are welcome @weone

Have a good day
via Inbox

latinowinner's avatar @latinowinner 7/27/2025

it looks like a professional advice

sagarkothari88's avatar @sagarkothari88 7/28/2025

@latinowinner Thank you.

I'll keep up my best
via Inbox

dobro2020's avatar @dobro2020 7/27/2025

I see that your main skills are the backend but it's good see post about thirds integration in hive. I have to develop a tool with the new APIs Docs when i have free time

sagarkothari88's avatar @sagarkothari88 7/28/2025

I think you got it wrong @dobro2020

My main skills are on front-end. I usually write apps in swift. Sometimes I write flutter+dart code. But react is a new journey for me.

For API documentation, I recommend you to use Swagger.

All the best.

Thank you for stopping by.

Have a good day.
via Inbox

dobro2020's avatar @dobro2020 7/28/2025

When You start with react it's a totally Journey because is like css, You can in so much ways and get the same result

aftabirshad's avatar @aftabirshad 7/28/2025

Great!