DesignAccordion

An expandable/collapsible content panel with corner decoration and glow effects. Matches the FAQ section style on the landing page.

Basic Usage

Default accordion with single item expanded at a time. Click on a header to expand/collapse. Features corner dots, left/right borders, and mouse-follow glow effect on hover.

What is xAIcreator and how does it help with Twitter marketing?

xAIcreator is a comprehensive Twitter monitoring and content optimization platform. It tracks trending users and tweets, provides AI-powered content rewriting, and offers analytics to help you create viral content and grow your Twitter presence effectively.

How does the AI content rewriting feature work?

Our AI analyzes successful tweets and helps you create engaging content by suggesting improvements to your writing style, hashtags, and posting times. It learns from viral content patterns to maximize your reach and engagement.

Can I monitor multiple Twitter accounts and competitors?

Yes, you can monitor multiple Twitter accounts including your own and competitors. Track their posting frequency, engagement rates, and content strategies to stay ahead in your niche.

What kind of analytics does xAIcreator provide?

xAIcreator provides comprehensive analytics including engagement metrics, follower growth trends, best posting times, content performance analysis, and competitor benchmarking to help you make data-driven decisions.

Controlled State

Track expanded index externally using onExpandedChange. Current expanded index: 0

Push Notifications

Get real-time notifications when important events happen, such as mentions, replies, or when your tracked keywords appear in tweets.

Content Scheduling

Schedule your tweets for optimal posting times. Our AI suggests the best times based on your audience's activity patterns.

Advanced Analytics

Deep dive into your Twitter performance with detailed charts, growth tracking, and actionable insights to improve your strategy.

Single Accordion Item

Use DesignAccordionSingle for standalone expandable sections.

Click to expand this section

This is a standalone accordion item. It can be used independently when you only need one expandable section, such as additional information or help text.

Controlled State Example

This accordion item uses controlled state. The parent component manages whether it's expanded or collapsed.

Current state: collapsed

FAQ Section

Use for frequently asked questions

Props:
{ items: "AccordionItem[]" }

What is xAIcreator and how does it help with Twitter marketing?

xAIcreator is a comprehensive Twitter monitoring and content optimization platform. It tracks trending users and tweets, provides AI-powered content rewriting, and offers analytics to help you create viral content and grow your Twitter presence effectively.

How does the AI content rewriting feature work?

Our AI analyzes successful tweets and helps you create engaging content by suggesting improvements to your writing style, hashtags, and posting times. It learns from viral content patterns to maximize your reach and engagement.

Single Item

Standalone expandable section

Props:
{ title: "string", children: "ReactNode" }

View more details

Additional information displayed when expanded.

Usage Example

import { DesignAccordion, DesignAccordionSingle } from "@/components/ui/design-accordion";

// Accordion with multiple items
const items = [
  { id: "1", title: "Question 1", content: "Answer 1" },
  { id: "2", title: "Question 2", content: "Answer 2" },
];

<DesignAccordion
  items={items}
  defaultExpandedIndex={0}
/>

// With controlled state
const [expandedIndex, setExpandedIndex] = useState(0);

<DesignAccordion
  items={items}
  defaultExpandedIndex={expandedIndex}
  onExpandedChange={setExpandedIndex}
/>

// Single standalone item
<DesignAccordionSingle title="Click to expand">
  Content that can be expanded or collapsed.
</DesignAccordionSingle>

// Controlled single item
const [expanded, setExpanded] = useState(false);

<DesignAccordionSingle
  title="Controlled accordion"
  expanded={expanded}
  onExpandedChange={setExpanded}
>
  Controlled content.
</DesignAccordionSingle>

Design Specifications

Spacing
  • Padding: 24px
  • Content margin-top: 16px (expanded)
  • Gap between items: 24px
Typography
  • Title: 20px, font-weight 500
  • Content: 16px, line-height 161.8%
  • Letter-spacing: -0.6px (title)
Visual Effects
  • Corner dots: 4×4px
  • Border: 1px solid (left/right)
  • Glow: radial-gradient 600×600px
Animation
  • Duration: 300ms
  • Easing: cubic-bezier(0.28, 0.11, 0.32, 1)
  • Properties: height, opacity, transform

API Reference - DesignAccordion

PropTypeDefaultDescription
itemsAccordionItem[]requiredArray of items with id, title, and content
defaultExpandedIndexnumber0Initially expanded item index
onExpandedChange(index: number) => void-Callback when expanded index changes
classNamestring-Additional CSS classes

API Reference - DesignAccordionSingle

PropTypeDefaultDescription
titlestringrequiredHeader text for the accordion
childrenReactNoderequiredContent shown when expanded
defaultExpandedbooleanfalseInitially expanded state
expandedboolean-Controlled expanded state
onExpandedChange(expanded: boolean) => void-Callback when state changes
classNamestring-Additional CSS classes

AccordionItem Type

interface AccordionItem {
  /** Unique identifier for the item */
  id: string;
  /** The title/question displayed in the header */
  title: string;
  /** The content/answer displayed when expanded */
  content: React.ReactNode;
}