===============
LIBRARY RULES
===============
From library maintainers:
- Import components from their dedicated paths: import { Button } from '@neynar/ui/button'
- Import themes as CSS: import '@neynar/ui/themes/purple-dawn'
- Base styles required: @import '@neynar/ui/styles' in your CSS file
- Use ColorModeInitializer in
for SSR-safe dark mode
- All components have data-slot attributes for CSS targeting
- Use the render prop (not asChild) for component polymorphism
- Compound components export multiple parts from the same path
- Use cn() utility from '@neynar/ui/utils' for class merging
### Quick Start: Basic App Structure with @neynar/ui Components
Source: https://github.com/neynarxyz/ui/blob/main/.llm/index.llm.md
Demonstrates how to set up a basic React application using components from the @neynar/ui library. It includes importing a button, card components, and applying a theme. This example assumes a standard React project setup.
```tsx
import { Button } from "@neynar/ui/button";
import { Card, CardHeader, CardContent } from "@neynar/ui/card";
import "@neynar/ui/themes/purple-dawn";
export function App() {
return (
Welcome
);
}
```
--------------------------------
### InputGroup Examples with Icon Addons
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/input-group.llm.md
Provides three distinct examples of using InputGroup with icon addons. The first shows an icon at the start, the second an icon at the end, and the third demonstrates placing icons on both sides of the input field for enhanced user guidance or actions.
```tsx
// Icon at start
// Icon at end
// Both sides
```
--------------------------------
### Basic Sidebar Implementation
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/sidebar.llm.md
An example of a basic sidebar setup using Neynar UI components. It includes a provider, sidebar structure, content area, and a trigger for collapsing/expanding. This snippet illustrates the fundamental layout of a sidebar.
```tsx
import { SidebarProvider, Sidebar, SidebarContent, SidebarInset, SidebarTrigger } from "@neynar/ui/sidebar"
import { HomeIcon } from "lucide-react"
function App() {
return (
Home
Dashboard
Content
)
}
```
--------------------------------
### Tailwind CSS v4 Setup for Next.js
Source: https://github.com/neynarxyz/ui/blob/main/README.md
Guide for configuring Tailwind CSS v4 within a Next.js project. This involves installing the required npm packages and setting up the postcss.config.js file.
```bash
npm install tailwindcss @tailwindcss/postcss
```
```javascript
// postcss.config.js
export default { plugins: { "@tailwindcss/postcss": {} } };
```
--------------------------------
### Basic Alert Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/alert.llm.md
A simple example of how to use the Alert component with an icon, title, and description. This demonstrates the default styling and structure.
```tsx
Heads up!
You can add components to your app using the CLI.
```
--------------------------------
### Alert with Primary Action Button Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/alert.llm.md
An example demonstrating how to use the AlertAction component with a primary action button, such as a 'View Migration Guide' button. It includes an icon, title, description, and an action button.
```tsx
API v1 Deprecation Notice
The v1 API endpoints will be deprecated on March 31, 2025. Please migrate to
v2 endpoints to avoid service disruption.
```
--------------------------------
### Package.json Exports Map Example for @neynar/ui
Source: https://github.com/neynarxyz/ui/blob/main/.llm/contributing.llm.md
This JSON snippet illustrates the structure of the `package.json` exports map for the @neynar/ui package. It shows how individual components are exposed with their corresponding type definitions and JavaScript module paths, managed by a build script.
```json
{
"./button": {
"types": "./dist/components/ui/button.d.ts",
"import": "./dist/components/ui/button.js"
}
}
```
--------------------------------
### LLM Documentation Template for @neynar/ui
Source: https://github.com/neynarxyz/ui/blob/main/.llm/contributing.llm.md
This Markdown template is used for generating documentation for components within the @neynar/ui package, intended for AI assistants. It includes sections for import statements, usage examples, and a table detailing component props.
```markdown
# ComponentName
One sentence description.
## Import
```tsx
import { Component } from "@neynar/ui/component"
```
## Usage
```tsx
Content
```
## Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| variant | "default" \| "secondary" | "default" | Visual style |
## Examples
### With variant
```tsx
Secondary
```
```
--------------------------------
### Basic Tooltip Usage Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/tooltip.llm.md
A practical example of a basic tooltip implementation. It uses a Button as the trigger and displays simple text content within the TooltipContent.
```tsx
This is a tooltip
```
--------------------------------
### Install @neynar/ui and Tailwind CSS
Source: https://context7.com/neynarxyz/ui/llms.txt
Installs the @neynar/ui package and its required peer dependencies, tailwindcss and @tailwindcss/vite, using npm.
```bash
# Install the package
npm install @neynar/ui
# Install required peer dependencies
npm install tailwindcss @tailwindcss/vite
```
--------------------------------
### Input with Helper Text Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/input.llm.md
An example showing an Input component paired with helper text, providing additional guidance or information to the user.
```tsx
Choose a unique username
```
--------------------------------
### Button Examples: Basic Variants
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/button.llm.md
Provides examples of different visual button variants including default, outline, and destructive. These demonstrate the primary styling options available for the Button component.
```tsx
```
--------------------------------
### HoverCard Example: Simple Text Preview
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/hover-card.llm.md
A basic example demonstrating how to use HoverCard for a simple text preview. A link acts as the trigger, and hovering over it reveals a concise definition or explanation in the HoverCardContent.
```tsx
Typography is the art and science of arranging type to make written
language clear, visually appealing, and effective.
{" "}in design.
```
--------------------------------
### Basic Drawer Usage Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/drawer.llm.md
A simple implementation of the Drawer component, showcasing a trigger button and basic content within the drawer. This example is suitable for straightforward use cases.
```tsx
Drawer TitleThis is a description.
Your content here.
```
--------------------------------
### Calendar with Dropdown Navigation Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/calendar.llm.md
Demonstrates using dropdowns for month and year navigation. This example sets 'captionLayout' to 'dropdown' and specifies a year range for the dropdowns.
```tsx
function CalendarWithDropdown() {
const [date, setDate] = useState()
return (
)
}
```
--------------------------------
### Basic InputGroup Anatomy with Addons and Button
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/input-group.llm.md
Demonstrates the fundamental structure of an InputGroup, featuring an addon with an icon at the start, an input field, and another addon containing a button at the end. This example showcases how to integrate interactive elements alongside standard input fields.
```tsx
```
--------------------------------
### Neynar UI Package Installation
Source: https://github.com/neynarxyz/ui/blob/main/README.md
These commands show how to install the @neynar/ui package using different package managers: npm, pnpm, and yarn. This is the initial step to integrate the component library into a project.
```bash
# npm
npm install @neynar/ui
# pnpm
pnpm add @neynar/ui
# yarn
yarn add @neynar/ui
```
--------------------------------
### Label Component with Basic Input Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/label.llm.md
A practical example of using the Label component to label a text input field. It includes basic styling for spacing.
```tsx
```
--------------------------------
### Basic Dialog Example (React/TypeScript)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/dialog.llm.md
A fundamental example of a Dialog component in use. It includes a trigger button, content with a header, description, and footer containing both a cancel and a confirm button. This showcases a common dialog pattern.
```tsx
```
--------------------------------
### Basic Sheet Usage Example - TypeScript/React
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/sheet.llm.md
A practical example of implementing the Sheet component for displaying settings. It includes a SheetTrigger that opens a SheetContent with a header, title, description, and a placeholder for settings content.
```tsx
}>
Open Settings
Settings
Manage your account settings and preferences
{/* Settings content */}
```
--------------------------------
### Basic Collapsible Usage Example (TypeScript)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/collapsible.llm.md
A simple example of a Collapsible component with default open state. It includes a trigger with styling and content that slides open. This demonstrates the core functionality for creating expandable sections.
```tsx
Click to toggle
Hidden content that slides open
```
--------------------------------
### Basic Avatar Usage Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/avatar.llm.md
A simple example showcasing the basic usage of the Avatar component. It includes an AvatarImage with a source URL and alt text, and an AvatarFallback displaying initials.
```tsx
DW
```
--------------------------------
### Set up React Application Entry Point
Source: https://context7.com/neynarxyz/ui/llms.txt
Configures the main entry point for a React application using ReactDOM to render the root component. It imports necessary modules and the application's CSS.
```typescript
// src/main.tsx - Application entry point
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
ReactDOM.createRoot(document.getElementById('root')!).render(
);
```
--------------------------------
### Building a Keyboard Shortcuts Help Panel
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/kbd.llm.md
Provides an example of creating a dynamic help panel that lists keyboard shortcuts and their descriptions using Kbd and KbdGroup components. This component is useful for providing users with quick reference to available shortcuts.
```tsx
function ShortcutsHelp() {
const shortcuts = [
{
keys: K,
description: "Open command palette"
},
{
keys: S,
description: "Save changes"
},
{
keys: Esc,
description: "Close dialog"
}
]
return (
{shortcuts.map((shortcut, idx) => (
{shortcut.description}
{shortcut.keys}
))}
)
}
```
--------------------------------
### Data Slot Convention Example for @neynar/ui
Source: https://github.com/neynarxyz/ui/blob/main/.llm/contributing.llm.md
This example demonstrates the mandatory `data-slot` attribute convention for root elements of components in @neynar/ui. It shows its application in both single and compound component structures, crucial for internal tooling and styling.
```tsx
// Single component
// Compound component
```
--------------------------------
### Vite HTML Setup for Color Mode Initialization
Source: https://context7.com/neynarxyz/ui/llms.txt
A manual script embedded in the index.html file for Vite projects to initialize the color mode system. This script reads the 'color-mode' or 'theme' cookie, determines the user's preference (light, dark, or system), and applies the appropriate class ('dark') to the root HTML element, while also setting the 'colorScheme' style to prevent FOUC.
```html
My App
```
--------------------------------
### Basic Field Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/field.llm.md
A simple illustration of a Field component with a label and an input element. This serves as a starting point for creating form inputs.
```tsx
Username
```
--------------------------------
### Basic Context Menu Example in React
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/context-menu.llm.md
Demonstrates the fundamental structure of a Context Menu with trigger and content, including common actions like Edit, Copy, and a destructive Delete option. This example uses React and JSX.
```tsx
Right-click here
Edit
Copy
Delete
```
--------------------------------
### Basic List Item Example (TypeScript/React)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/item.llm.md
A practical example of creating an outlined list item with an icon, title, description, and an action button. This showcases the `variant` and `size` props for visual styling and layout.
```tsx
API KeyProduction key created 3 months ago
```
--------------------------------
### Carousel with Loop Mode Enabled (TypeScript)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/carousel.llm.md
This example showcases how to enable infinite looping for the carousel. The `opts` prop is used to pass Embla carousel options, specifically setting `loop` to `true` and `align` to `start`.
```tsx
{items.map((item, index) => (
{item.content}
))}
```
--------------------------------
### Button Component Examples with Variants and Sizes
Source: https://context7.com/neynarxyz/ui/llms.txt
Demonstrates the usage of the @neynar/ui Button component, showcasing various predefined variants (default, outline, ghost, destructive, etc.) and size options (xs, sm, default, lg). Includes examples of icon buttons, buttons with inline icons, custom render elements, disabled states, and invalid states using ARIA attributes.
```typescript
import { Button } from "@neynar/ui/button";
import { PlusIcon, SettingsIcon } from "lucide-react";
function ButtonExamples() {
return (
{/* Basic variants */}
{/* Sizes */}
{/* Icon buttons */}
{/* Button with inline icon */}
{/* Custom element with button styles */}
}>
Go to Dashboard
{/* Disabled state */}
{/* Invalid state with aria-invalid */}
);
}
```
--------------------------------
### Story Template for @neynar/ui Components
Source: https://github.com/neynarxyz/ui/blob/main/.llm/contributing.llm.md
This template is used for creating Storybook stories for @neynar/ui components. It defines the metadata for the story, including the title, component, and tags, and provides examples for different states or variants of the component.
```tsx
import type { Meta, StoryObj } from "@storybook/react"
import { Component } from "../component"
const meta: Meta = {
title: "UI/Component",
component: Component,
tags: ["autodocs"],
}
export default meta
type Story = StoryObj
export const Default: Story = {
args: { children: "Example" },
}
export const Variants: Story = {
render: () => (
DefaultSecondary
),
}
```
--------------------------------
### Basic Pagination Structure and Usage
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/pagination.llm.md
Demonstrates the fundamental structure of the Pagination component, including the root container, content wrapper, and individual page items. This example shows how to create a simple pagination with previous, next, and a few page links.
```tsx
123
```
--------------------------------
### Tailwind CSS v4 Setup for Vite
Source: https://github.com/neynarxyz/ui/blob/main/README.md
Instructions for setting up Tailwind CSS v4 with Vite, a popular build tool for modern JavaScript projects. It involves installing the necessary packages and configuring the vite.config.ts file.
```bash
npm install tailwindcss @tailwindcss/vite
```
```typescript
// vite.config.ts
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({ plugins: [react(), tailwindcss()] });
```
--------------------------------
### Designing a Common Shortcuts Grid
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/kbd.llm.md
Demonstrates how to arrange common keyboard shortcuts in a grid layout using KbdGroup. This example shows shortcuts like Save, Copy, Paste, and Undo, making them easily scannable for users.
```tsx
SaveS
CopyC
PasteV
UndoZ
```
--------------------------------
### Basic Link Navigation Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/navigation-menu.llm.md
Shows a simple implementation of the NavigationMenu with basic links for primary navigation. Each NavigationMenuItem contains a NavigationMenuLink to a specific page.
```tsx
HomeAboutContact
```
--------------------------------
### Basic Usage of Neynar UI Code Component (TSX)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/code.llm.md
Provides a basic example of using the Code component to display a command-line instruction, such as installing a package. This demonstrates the component's ability to render distinct code blocks.
```tsx
npm install @neynar/ui
```
--------------------------------
### First Light Theme Setup (TypeScript)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/theming.llm.md
Shows how to set up the 'First Light' theme in a React application. It involves importing the theme styles and the `FirstLightFilters` component, which should be added once in the root layout to enable the wobbly SVG filter effect.
```tsx
import "@neynar/ui/themes/first-light"
import { FirstLightFilters } from "@neynar/ui/first-light"
// Add once in your root layout
export function Layout({ children }) {
return (
<>
{children}
>
)
}
```
--------------------------------
### Icon Sizing with CSS Utility (TypeScript/React)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/contributing.llm.md
Shows how icons automatically size within a Button component using a CSS utility class targeting SVG elements that do not have an explicit size class. The example demonstrates an icon inheriting a default size.
```tsx
// Icons auto-size via [&_svg:not([class*='size-'])]:size-4
```
--------------------------------
### Forwarding Refs (TypeScript/React)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/contributing.llm.md
Explains that Base UI automatically handles ref forwarding, eliminating the need for explicit `forwardRef` wrappers in custom component implementations. The example shows a simple component that uses a primitive component and inherits ref forwarding.
```tsx
// Base UI handles ref forwarding automatically
// No need for forwardRef wrapper
function Component(props: ComponentProps) {
return
}
```
--------------------------------
### Command Palette with Custom Empty State
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/command.llm.md
Demonstrates how to customize the empty state of the command palette. Instead of a simple text message, this example displays a more informative message with additional details and styling, guiding the user on what to do when no search results are found.
```tsx
No results found.
Try a different search term or check the docs.
Getting StartedAPI Reference
```
--------------------------------
### Sidebar with Header and Footer Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/sidebar.llm.md
This example demonstrates how to implement a sidebar with a custom header and footer. The header includes a branding element and user information, while the footer typically contains user profile details. This showcases advanced layout options for the sidebar.
```tsx
NeynarDeveloper Portal
{/* Menu groups */}
JD
John Developerjohn@example.com
```
--------------------------------
### Tabs: Vertical Orientation Example (TypeScript/React)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/tabs.llm.md
Demonstrates how to configure the Tabs component for vertical orientation using the 'orientation' prop. This setup is useful for navigation layouts where tabs are positioned alongside content. It requires the Tabs, TabsList, TabsTrigger, and TabsContent components.
```tsx
Profile
Account
Notifications
Profile settingsAccount securityNotification preferences
```
--------------------------------
### Component Template for @neynar/ui
Source: https://github.com/neynarxyz/ui/blob/main/.llm/contributing.llm.md
This template provides a boilerplate for creating new UI components within the @neynar/ui package. It includes setup for variants using `class-variance-authority`, integrates with Base UI primitives, and handles class merging with `cn`. It enforces the `data-slot` convention and conditionally includes `"use client"`.
```tsx
// Add "use client" ONLY if component uses hooks
import { Primitive } from "@base-ui/react/primitive"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const componentVariants = cva("base-classes", {
variants: {
variant: {
default: "...",
secondary: "...",
},
},
defaultVariants: {
variant: "default",
},
})
type ComponentProps = Primitive.Props & VariantProps
/**
* Brief description.
*
* @example
* ```tsx
* Content
* ```
*/
function Component({ className, variant, ...props }: ComponentProps) {
return (
)
}
export { Component, componentVariants, type ComponentProps }
```
--------------------------------
### Basic Select Component Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/select.llm.md
Demonstrates the fundamental usage of the Select component with a predefined default value. It includes a trigger and content with selectable items.
```tsx
```
--------------------------------
### Basic Single Value Slider Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/slider.llm.md
An example of a basic Slider used for controlling volume, demonstrating a single value selection.
```tsx
function VolumeControl() {
return (
)
}
```
--------------------------------
### HoverCard Example: User Profile Preview
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/hover-card.llm.md
An example showcasing a HoverCard used to display a user's profile information. It includes an Avatar, user details, follow button, and follower/following counts, demonstrating a rich preview scenario.
```tsx
DR
Dan Romero
@dwr
Building Farcaster and Warpcast. Previously VP Eng at Coinbase.
124.5K{" "}
followers
428{" "}
following
```
--------------------------------
### Basic Table Example with Data (TypeScript/React)
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/table.llm.md
A practical example showcasing a functional table with headers, body rows, and a footer. It includes sample invoice data, status, and amounts, demonstrating how to populate the table cells.
```tsx
```
--------------------------------
### Date Input Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/input.llm.md
An example of a date input field, providing a native date picker interface for selecting dates.
```tsx
```
--------------------------------
### ColorModeToggle Examples
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/color-mode.llm.md
Provides examples of using the ColorModeToggle component with different configurations. These examples showcase an icon-only toggle, a toggle with a visible label, a small ghost button variant, and its integration within a header component. The component allows users to switch between system, light, and dark modes.
```tsx
// Icon-only (default)
// With label
// Small ghost button
// In a header
```
--------------------------------
### Next.js Color Mode Setup with @neynar/ui/color-mode
Source: https://context7.com/neynarxyz/ui/llms.txt
Integrates the ColorModeInitializer component into the root layout of a Next.js application. This component handles the initial setup of the color mode system, preventing flashes of unstyled content (FOUC) by applying the correct theme class before hydration.
```typescript
import {
ColorModeInitializer
} from "@neynar/ui/color-mode";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
{children}
);
}
```
--------------------------------
### Import Patterns for @neynar/ui Components
Source: https://github.com/neynarxyz/ui/blob/main/.llm/index.llm.md
Illustrates the recommended import pattern for individual components and utility functions from the @neynar/ui library. Each component has its own entry point, ensuring efficient bundle sizes. The `cn` utility is commonly used for conditional class name merging.
```tsx
import { Button } from "@neynar/ui/button";
import { Dialog, DialogTrigger, DialogContent } from "@neynar/ui/dialog";
import { Input } from "@neynar/ui/input";
import { cn } from "@neynar/ui/utils";
```
--------------------------------
### Basic Text Input Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/input.llm.md
A simple example of a text input field integrated with a Label component, commonly used for form elements.
```tsx
```
--------------------------------
### Controlled Drawer State Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/drawer.llm.md
Illustrates how to manage the open/close state of a Drawer component programmatically using the `open` and `onOpenChange` props. This is useful for scenarios where the drawer's visibility needs to be controlled by application logic.
```tsx
function ControlledDrawer() {
const [open, setOpen] = useState(false)
return (
<>
Controlled Drawer
>
)
}
```
--------------------------------
### Calendar with Custom Button Variant Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/calendar.llm.md
Demonstrates customizing the appearance of navigation buttons using the 'buttonVariant' prop. This example sets the variant to 'outline'.
```tsx
function StyledCalendar() {
const [date, setDate] = useState()
return (
)
}
```
--------------------------------
### Calendar with Week Numbers Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/calendar.llm.md
An example of enabling ISO week number display in the Calendar component. This is achieved by setting the 'showWeekNumber' prop to true.
```tsx
function CalendarWithWeeks() {
const [date, setDate] = useState()
return (
)
}
```
--------------------------------
### Basic Switch Usage Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/switch.llm.md
Demonstrates the simplest way to use the Switch component, typically paired with a Label for accessibility. It requires importing both Switch and Label components.
```tsx
import { Switch } from "@neynar/ui/switch"
import { Label } from "@neynar/ui/label"
function Example() {
return (
)
}
```
--------------------------------
### Textarea with Validation Error Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/textarea.llm.md
An example demonstrating a Textarea with custom validation logic. It uses `aria-invalid` and displays an error message below the textarea if validation fails.
```tsx
import { useState } from "react"
import { Label } from "@neynar/ui/label"
function FeedbackForm() {
const [feedback, setFeedback] = useState("")
const [error, setError] = useState("")
const validate = () => {
if (feedback.length < 10) {
setError("Feedback must be at least 10 characters")
} else {
setError("")
}
}
return (
)
}
```
--------------------------------
### Alert with Description Only Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/alert.llm.md
This example shows an Alert component used with only an icon and a description, omitting the title. This is useful for simple informational messages.
```tsx
Your changes have been saved automatically.
```
--------------------------------
### NavigationMenu Anatomy Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/navigation-menu.llm.md
Demonstrates the basic structure of the NavigationMenu component, including a trigger for a mega menu and a direct link. This illustrates how to nest menu items and content.
```tsx
Products
{/* Mega menu content */}
Pricing
```
--------------------------------
### Basic Line Chart Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/chart.llm.md
Provides a complete example of a basic LineChart using ChartContainer, including sample data, configuration, and essential Recharts components.
```tsx
import { Line, LineChart, XAxis, YAxis } from "recharts"
const data = [
{ month: "Jan", value: 2400 },
{ month: "Feb", value: 1398 },
{ month: "Mar", value: 9800 },
]
const config = {
value: {
label: "Revenue",
color: "var(--chart-1)",
},
} satisfies ChartConfig
} />
```
--------------------------------
### Dialog with Complete Workflow (TypeScript)
Source: https://context7.com/neynarxyz/ui/llms.txt
This code snippet demonstrates how to implement a dialog with a full workflow for creating a new user using @neynar/ui components. It includes state management for form inputs and dialog visibility. It also shows a simpler uncontrolled dialog example.
```typescript
import {
Dialog,
DialogTrigger,
DialogContent,
DialogHeader,
DialogTitle,
DialogDescription,
DialogFooter,
DialogClose
} from "@neynar/ui/dialog";
import { Button } from "@neynar/ui/button";
import { Input } from "@neynar/ui/input";
import { useState } from "react";
function CreateUserDialog() {
const [open, setOpen] = useState(false);
const [username, setUsername] = useState("");
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
// Submit logic here
console.log("Creating user:", username);
setOpen(false);
};
return (
);
}
// Uncontrolled dialog with default open state
function SimpleDialog() {
return (
);
}
```
--------------------------------
### Success Alert Example
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/alert.llm.md
An example demonstrating the 'success' variant of the Alert component, used for positive outcomes or confirmations. It includes an icon, title, and description.
```tsx
Plan Upgrade Successful
Your account has been upgraded to the Pro plan. Your new rate limits and
features are now active.
```
--------------------------------
### Vertical ButtonGroup with Icons Example - TypeScript
Source: https://github.com/neynarxyz/ui/blob/main/.llm/components/button-group.llm.md
Presents a vertical ButtonGroup used for a list of actions, each with an icon and text. This example uses 'secondary' variant buttons.
```tsx
```