Google Antigravity Directory

The #1 directory for Google Antigravity prompts, rules, workflows & MCP servers. Optimized for Gemini 3 agentic development.

Resources

PromptsMCP ServersAntigravity RulesGEMINI.md GuideBest Practices

Company

Submit PromptAntigravityAI.directory

Popular Prompts

Next.js 14 App RouterReact TypeScriptTypeScript AdvancedFastAPI GuideDocker Best Practices

Legal

Privacy PolicyTerms of ServiceContact Us
Featured on FazierFeatured on WayfindioAntigravity AI - Featured on Startup FameFeatured on Wired BusinessFeatured on Twelve ToolsListed on Turbo0Featured on findly.toolsFeatured on Aura++That App ShowAI ToolzShinyLaunchMillion Dot HomepageSolver ToolsFeatured on FazierFeatured on WayfindioAntigravity AI - Featured on Startup FameFeatured on Wired BusinessFeatured on Twelve ToolsListed on Turbo0Featured on findly.toolsFeatured on Aura++That App ShowAI ToolzShinyLaunchMillion Dot HomepageSolver Tools

© 2026 Antigravity AI Directory. All rights reserved.

The #1 directory for Google Antigravity IDE

This website is not affiliated with, endorsed by, or associated with Google LLC. "Google" and "Gemini" are trademarks of Google LLC.

Antigravity AI Directory
PromptsMCPBest PracticesUse CasesLearn
Home
Prompts
Ark UI Component Patterns

Ark UI Component Patterns

Master Ark UI headless component patterns for Google Antigravity IDE accessible applications

Ark UIComponentsAccessibilityReact
by Antigravity AI
⭐0Stars
.antigravity
# Ark UI Component Patterns for Google Antigravity IDE

Build accessible UI components with Ark UI using Google Antigravity IDE. This guide covers headless component patterns, state machines, and accessibility features.

## Dropdown Menu Component

```typescript
// src/components/ui/menu.tsx
import { Menu } from "@ark-ui/react/menu";
import { Portal } from "@ark-ui/react/portal";
import { cn } from "@/lib/utils";

interface MenuItemProps {
  value: string;
  label: string;
  icon?: React.ReactNode;
  shortcut?: string;
  disabled?: boolean;
}

export function DropdownMenu({
  trigger,
  items,
  onSelect,
  align = "end",
}: {
  trigger: React.ReactNode;
  items: MenuItemProps[];
  onSelect?: (value: string) => void;
  align?: "start" | "center" | "end";
}) {
  return (
    <Menu.Root onSelect={(details) => onSelect?.(details.value)} positioning={{ placement: `bottom-${align}` }}>
      <Menu.Trigger asChild>{trigger}</Menu.Trigger>
      <Portal>
        <Menu.Positioner>
          <Menu.Content className={cn("z-50 min-w-[180px] rounded-md border bg-popover p-1 shadow-md animate-in fade-in-0")}>
            {items.map((item) => (
              <Menu.Item
                key={item.value}
                value={item.value}
                disabled={item.disabled}
                className={cn("flex cursor-pointer items-center rounded-sm px-2 py-1.5 text-sm hover:bg-accent")}
              >
                {item.icon && <span className="mr-2 h-4 w-4">{item.icon}</span>}
                <span className="flex-1">{item.label}</span>
                {item.shortcut && <span className="ml-auto text-xs text-muted-foreground">{item.shortcut}</span>}
              </Menu.Item>
            ))}
          </Menu.Content>
        </Menu.Positioner>
      </Portal>
    </Menu.Root>
  );
}
```

## Dialog Component

```typescript
// src/components/ui/dialog.tsx
import { Dialog } from "@ark-ui/react/dialog";
import { Portal } from "@ark-ui/react/portal";
import { X } from "lucide-react";
import { cn } from "@/lib/utils";

export function CustomDialog({
  open,
  onOpenChange,
  trigger,
  title,
  description,
  children,
  footer,
}: {
  open?: boolean;
  onOpenChange?: (open: boolean) => void;
  trigger?: React.ReactNode;
  title: string;
  description?: string;
  children: React.ReactNode;
  footer?: React.ReactNode;
}) {
  return (
    <Dialog.Root open={open} onOpenChange={(e) => onOpenChange?.(e.open)}>
      {trigger && <Dialog.Trigger asChild>{trigger}</Dialog.Trigger>}
      <Portal>
        <Dialog.Backdrop className="fixed inset-0 z-50 bg-black/50 animate-in fade-in-0" />
        <Dialog.Positioner className="fixed inset-0 z-50 flex items-center justify-center p-4">
          <Dialog.Content className="relative w-full max-w-md rounded-lg bg-background shadow-lg animate-in fade-in-0 zoom-in-95">
            <div className="flex flex-col space-y-1.5 p-6">
              <Dialog.Title className="text-lg font-semibold">{title}</Dialog.Title>
              {description && <Dialog.Description className="text-sm text-muted-foreground">{description}</Dialog.Description>}
            </div>
            <div className="p-6 pt-0">{children}</div>
            {footer && <div className="flex justify-end gap-2 border-t p-6">{footer}</div>}
            <Dialog.CloseTrigger className="absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100">
              <X className="h-4 w-4" />
              <span className="sr-only">Close</span>
            </Dialog.CloseTrigger>
          </Dialog.Content>
        </Dialog.Positioner>
      </Portal>
    </Dialog.Root>
  );
}
```

## Combobox with Search

```typescript
// src/components/ui/combobox.tsx
import { Combobox } from "@ark-ui/react/combobox";
import { Portal } from "@ark-ui/react/portal";
import { Check, ChevronsUpDown } from "lucide-react";
import { useState, useMemo } from "react";

export function SearchableCombobox({
  items,
  value,
  onChange,
  placeholder = "Select...",
}: {
  items: Array<{ value: string; label: string }>;
  value?: string;
  onChange?: (value: string) => void;
  placeholder?: string;
}) {
  const [inputValue, setInputValue] = useState("");

  const filteredItems = useMemo(() => {
    if (!inputValue) return items;
    return items.filter((item) => item.label.toLowerCase().includes(inputValue.toLowerCase()));
  }, [items, inputValue]);

  return (
    <Combobox.Root
      items={filteredItems}
      value={value ? [value] : []}
      onValueChange={(details) => onChange?.(details.value[0])}
      onInputValueChange={(details) => setInputValue(details.inputValue)}
    >
      <Combobox.Control className="relative">
        <Combobox.Input placeholder={placeholder} className="flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm" />
        <Combobox.Trigger className="absolute right-2 top-2.5">
          <ChevronsUpDown className="h-4 w-4 opacity-50" />
        </Combobox.Trigger>
      </Combobox.Control>
      <Portal>
        <Combobox.Positioner>
          <Combobox.Content className="z-50 max-h-60 w-full overflow-auto rounded-md border bg-popover shadow-md">
            {filteredItems.map((item) => (
              <Combobox.Item key={item.value} item={item} className="flex cursor-pointer items-center px-2 py-1.5 hover:bg-accent">
                <Combobox.ItemIndicator className="mr-2"><Check className="h-4 w-4" /></Combobox.ItemIndicator>
                <Combobox.ItemText>{item.label}</Combobox.ItemText>
              </Combobox.Item>
            ))}
          </Combobox.Content>
        </Combobox.Positioner>
      </Portal>
    </Combobox.Root>
  );
}
```

## Best Practices for Google Antigravity IDE

When using Ark UI with Google Antigravity, leverage the headless architecture for full styling control. Use state machine props for complex interactions. Implement proper ARIA attributes automatically. Let Gemini 3 generate accessible component variants.

Google Antigravity excels at building custom design systems on top of Ark UI primitives.

When to Use This Prompt

This Ark UI prompt is ideal for developers working on:

  • Ark UI applications requiring modern best practices and optimal performance
  • Projects that need production-ready Ark UI code with proper error handling
  • Teams looking to standardize their ark ui development workflow
  • Developers wanting to learn industry-standard Ark UI patterns and techniques

By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their ark ui implementations.

How to Use

  1. Copy the prompt - Click the copy button above to copy the entire prompt to your clipboard
  2. Paste into your AI assistant - Use with Claude, ChatGPT, Cursor, or any AI coding tool
  3. Customize as needed - Adjust the prompt based on your specific requirements
  4. Review the output - Always review generated code for security and correctness
💡 Pro Tip: For best results, provide context about your project structure and any specific constraints or preferences you have.

Best Practices

  • ✓ Always review generated code for security vulnerabilities before deploying
  • ✓ Test the Ark UI code in a development environment first
  • ✓ Customize the prompt output to match your project's coding standards
  • ✓ Keep your AI assistant's context window in mind for complex requirements
  • ✓ Version control your prompts alongside your code for reproducibility

Frequently Asked Questions

Can I use this Ark UI prompt commercially?

Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.

Which AI assistants work best with this prompt?

This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.

How do I customize this prompt for my specific needs?

You can modify the prompt by adding specific requirements, constraints, or preferences. For Ark UI projects, consider mentioning your framework version, coding style, and any specific libraries you're using.

Related Prompts

💬 Comments

Loading comments...