Skip to Content

ai-components

npm version License: MIT

Pre-wrapped UI components that leverage AI generation capabilities, as well as a dynamic component generator.

Installation

npm install ai-components # or pnpm add ai-components # or yarn add ai-components

Features

  • 🧩 Pre-wrapped UI Components: Ready-to-use UI components with AI-generated content
  • 🔄 Real-time Streaming: Stream AI-generated content for immediate feedback
  • 🎨 ShadCN UI Integration: Beautiful UI components built with ShadCN and Tailwind CSS
  • 🔌 Dynamic Component Generation: Generate custom UI components based on descriptions

Usage

Pre-wrapped Components

import { Hero, FAQs, Pricing } from 'ai-components' // Hero component with AI-generated content <Hero model='gpt-4o' prompt='Generate a hero section for a SaaS product' /> // FAQs with custom title and count <FAQs title='Common Questions' count={3} prompt='Generate FAQs about our product' /> // Pricing component with manual tiers <Pricing tiers={[ { name: 'Basic', price: '$9/mo', description: 'For individuals', features: ['Feature 1', 'Feature 2'], cta: { text: 'Get Started', link: '/signup' } }, // More tiers... ]} />

Dynamic Component Generator

import { Component } from 'ai-components' // Generate a custom component based on a description ;<Component description='Create a notification banner with a dismiss button' contextProps={{ message: 'New feature available!', type: 'info', }} />

Available Components

ComponentDescription
HeroHero section with title, subtitle, and CTA
FAQsFrequently asked questions with expandable answers
PricingPricing tables with multiple tiers
FeaturesFeature list/grid with icons and descriptions
TestimonialsCustomer testimonials with avatars
CTACall-to-action section with buttons
ComponentDynamic component generator based on descriptions

Dependencies