### Badge Component Examples (React/TypeScript) Source: https://context7.com/tremorlabs/tremor/llms.txt Shows how to use the Tremor Raw Badge component for displaying labels and status information. Examples include different color variants, badges with custom content including icons, and using the `badgeVariants` helper for styling custom elements. ```tsx import { Badge } from "./components/Badge/Badge" // Status badges Active Completed Failed Pending Inactive // Badge with custom content ✓ Verified // Using badgeVariants for custom elements import { badgeVariants } from "./components/Badge/Badge" Custom styled badge ``` -------------------------------- ### Select Component Examples (React/TypeScript) Source: https://context7.com/tremorlabs/tremor/llms.txt Demonstrates the Select component for creating dropdown menus. Features keyboard navigation, search, grouping, and supports controlled states and error handling. Built on Radix UI. ```tsx import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, SelectGroup, SelectGroupLabel, } from "./components/Select/Select" // Basic select // Controlled select with error state const [value, setValue] = useState("") // Grouped select // Disabled select ``` -------------------------------- ### Card Component Examples (React/TypeScript) Source: https://context7.com/tremorlabs/tremor/llms.txt Illustrates the usage of the Tremor Raw Card component for grouping related content. Examples cover basic card usage, applying custom styling via the `className` prop, and polymorphic rendering using the `asChild` prop with semantic HTML elements. ```tsx import { Card } from "./components/Card/Card" // Basic card

Revenue

$12,345

// Card with custom styling

Dashboard Metrics

View your key performance indicators

// Card as child component (polymorphic)
Custom Semantic Card

Using semantic HTML with Card styling

``` -------------------------------- ### BarChart Component Examples (React/TypeScript) Source: https://context7.com/tremorlabs/tremor/llms.txt Demonstrates the BarChart component for creating interactive charts. Supports stacked, percentage, and vertical layouts, custom tooltips, value formatting, and event handling. Built on Recharts. ```tsx import { BarChart } from "./components/BarChart/BarChart" const salesData = [ { month: "Jan 23", revenue: 2890, expenses: 2338 }, { month: "Feb 23", revenue: 2756, expenses: 2103 }, { month: "Mar 23", revenue: 3322, expenses: 2194 }, { month: "Apr 23", revenue: 3470, expenses: 2108 }, ] // Basic bar chart // Advanced configuration with formatting and labels `$${value.toLocaleString()}`} xAxisLabel="Month of Year" yAxisLabel="Amount (USD)" showLegend={true} showGridLines={true} legendPosition="center" /> // Stacked bar chart with interactions { console.log("Clicked bar:", value) }} enableLegendSlider={true} /> // Percentage stacked chart // Custom tooltip { if (!active || !payload) return null return (

{label}

${payload[0].value}

) }} /> // Vertical layout ``` -------------------------------- ### Button Component Examples (React/TypeScript) Source: https://context7.com/tremorlabs/tremor/llms.txt Demonstrates the usage of the Tremor Raw Button component, including basic variants, loading states, disabled states, and polymorphic rendering using the `asChild` prop. It also shows how to use the `buttonVariants` helper for custom elements. ```tsx import { Button } from "./components/Button/Button" // Basic usage with variants // Loading state with custom text // Disabled state // Polymorphic rendering as anchor tag // Using buttonVariants helper for custom elements import { buttonVariants } from "./components/Button/Button" API Reference ``` -------------------------------- ### Input Component Examples (React/TypeScript) Source: https://context7.com/tremorlabs/tremor/llms.txt Showcases the Input component for various form field types. Supports text, email, password with visibility toggle, search, number inputs, disabled states, and custom styling. ```tsx import { Input } from "./components/Input/Input" // Basic text input // Email input with error state // Password input with visibility toggle // Search input with icon // Number input without stepper controls // Disabled input // Custom styled input ``` -------------------------------- ### Basic and Advanced Table Component in React Source: https://context7.com/tremorlabs/tremor/llms.txt Demonstrates the usage of a semantic and accessible Table component for displaying tabular data. Includes examples for basic tables, tables with captions, and responsive tables with custom styling. This component is built with React and TypeScript. ```tsx import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRoot, TableRow, TableCaption, } from "./components/Table/Table" // Basic table Name Email Status John Doe john@example.com Active Jane Smith jane@example.com Pending
// Table with caption and footer Q4 2023 Sales Report Product Revenue Product A $12,345 Product B $8,900
// Responsive table with custom styling Column 1 Column 2 Data 1 Data 2
``` -------------------------------- ### Accessible Dialog Component in React with Radix UI Source: https://context7.com/tremorlabs/tremor/llms.txt Implements a modal dialog component using Radix UI, featuring overlay, accessibility, and flexible content layout. Examples cover basic dialogs, controlled dialogs with forms, and dialogs for destructive actions. Requires Button and Input components for interaction. ```tsx import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DialogClose, } from "./components/Dialog/Dialog" import { Button } from "./components/Button/Button" // Basic dialog Confirm Action Are you sure you want to proceed with this action? // Controlled dialog with form const [open, setOpen] = useState(false) New User Enter user details below
{ e.preventDefault() setOpen(false) }}>
// Dialog with destructive action Delete Account This action cannot be undone. All your data will be permanently removed. ``` -------------------------------- ### Utility Function for Smart Class Merging in React Source: https://context7.com/tremorlabs/tremor/llms.txt Provides a utility function 'cx' for intelligently merging Tailwind CSS classes, handling conflicts and conditional application. This function is useful for dynamic styling in React components. It takes multiple class strings or objects as arguments. ```tsx import { cx } from "./utils/cx" // Merge Tailwind classes intelligently const buttonClasses = cx( "px-4 py-2 rounded-md", "bg-blue-500 hover:bg-blue-600", isActive && "bg-blue-700", className ) // Handles conflicting Tailwind classes correctly cx("px-4 px-2") // Result: "px-2" (later value wins) cx("bg-red-500", "bg-blue-500") // Result: "bg-blue-500" // Conditional class application cx( "base-class", condition && "conditional-class", { "active": isActive, "disabled": isDisabled, } ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.