gamma logo

1

Support Box

A collapsible support box component with customizable items, dark mode support, and animation.

Installation

pnpm dlx shadcn@latest add @gammaui/support-box

Usage

import { SupportBox } from "@/components/ui/support-box"
<SupportBox
  items={[
    {
      title: "FAQ",
      description: "Frequently Asked Questions",
      icon: "❓",
      onPress: () => console.log("FAQ clicked"),
    },
    {
      title: "Contact Support",
      description: "Reach out to our support team",
      icon: "📞",
      onPress: () => console.log("Contact clicked"),
    },
  ]}
/>

Examples

Collapsed State

The box shows only the title and expands on click.

<SupportBox title="Need Help?" items={supportItems} />

Expanded State

Displays the full menu with interactive items.

<SupportBox
  title="Support"
  items={supportItems}
  expandedWidth={350}
  expandedHeight={400}
/>

Dark Mode Styling

<SupportBox
  items={supportItems}
  containerClassName="bg-gray-900 border-gray-700"
  titleClassName="text-white"
  itemClassName="text-gray-200"
/>

Custom Styling

<SupportBox
  items={supportItems}
  bgColor="bg-blue-50 dark:bg-blue-900"
  borderColor="border-blue-300 dark:border-blue-700"
/>

API Reference

SupportBox

A collapsible support/help box with menu items.

Props

PropTypeDefaultDescription
titlestring"Need Help?"The main title displayed on the box
itemsMenuItem[][]Array of menu items with title, description, icon, onPress
collapsedWidthnumber120Width when collapsed
collapsedHeightnumber40Height when collapsed
expandedWidthnumber300Width when expanded
expandedHeightnumber320Height when expanded
classNamestring""Custom wrapper class
containerClassNamestring'bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700'Box container styling
titleClassNamestring'text-gray-800 dark:text-gray-100'Title text styling
itemClassNamestring'text-gray-800 dark:text-gray-100'Item text styling
bgColorstring""Custom background color
borderColorstring""Custom border color
PropTypeDescription
titlestringItem title
descriptionstringItem description
iconReactNodeItem icon
onPress() => voidClick handler for the item