Hydra-AI
New
Version 0.0.17 out now!

Install adaptive UI withhydra-ai

Improve your UX with AI-driven React components.

$
npm i hydra-ai

1. Register Your Components

Define and register your custom components with Hydra AI to enable AI-driven rendering.

app/hydra-client.tsjavascript
import { HydraClient } from "hydra-ai";
import WeatherForecast from "./components/weather-forecast";
import DailyForecast from "./components/daily-forecast";

const hydra = new HydraClient();

hydra.registerComponent("WeatherForecast", WeatherForecast, {
  city: "string",
  country: "string",
  unit: '"celsius" | "fahrenheit"',
});

hydra.registerComponent("DailyForecast", DailyForecast, {
  day: "string",
  temperature: "number",
  condition: '"sunny" | "cloudy" | "rainy" | "snowy"',
});

export default hydra;
app/page.tsxjsx
"use client";

import { ReactElement, useEffect, useState } from "react";
import hydra from "./hydra-client";

export default function Home() {
  const [weatherComponent, setWeatherComponent] = 
    useState<ReactElement | null>(null);

  const generateWeatherForecast = async () => {
    const component = await hydra.generateComponent(
      "Show a 5-day weather forecast for New York"
    );
    setWeatherComponent(component);
  };

  useEffect(() => {
    generateWeatherForecast();
  }, []);

  return (
    <main>
      {weatherComponent}
    </main>
  );
}

2. Use Hydra to Generate Components

Utilize Hydra AI to dynamically generate and render components based on user input or context.

3. Interact with Generated UI

Engage with your Hydra AI components through interactive elements, allowing users to dynamically modify and control the generated UI.

Forecast

Mon72°
Tue68°
Wed65°
Thu70°
Fri75°

Team

From Tinkerers to Founders

MichaelMagán

Co-Founder,
CEO

MichaelMilstead

co-founder,
CTO

Join OurDiscord Community

Connect with developers, share ideas, and get support for Hydra AI.