### Install Tooltip Components
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for tooltip components.
```bash
npm install @zendeskgarden/react-tooltips @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Tables and Theming Packages
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for tables, theming, and styled-components.
```bash
npm install @zendeskgarden/react-tables @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install @zendeskgarden/react-grid
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the grid package and its dependencies.
```bash
npm install @zendeskgarden/react-grid @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install @zendeskgarden/react-theming
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the theming package and its peer dependency, styled-components.
```bash
npm install @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Pagination Components
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for pagination components.
```bash
npm install @zendeskgarden/react-pagination @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Notifications and Theming Packages
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for notifications, theming, and styled-components.
```bash
npm install @zendeskgarden/react-notifications @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install @zendeskgarden/react-tags
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the tags package and its dependencies.
```bash
npm install @zendeskgarden/react-tags @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Tabs, Theming, and Styled Components
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for using the Tabs component.
```bash
npm install @zendeskgarden/react-tabs @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Modals Package
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for modals, theming, and styled-components.
```bash
npm install @zendeskgarden/react-modals @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install @zendeskgarden/react-forms
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for using the forms components.
```bash
npm install @zendeskgarden/react-forms @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Dropdowns Package
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the dropdowns package along with theming and styled-components dependencies.
```bash
npm install @zendeskgarden/react-dropdowns @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Typography and Theming Packages
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for typography and theming using npm.
```bash
npm install @zendeskgarden/react-typography @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install @zendeskgarden/react-buttons
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the buttons package along with its peer dependencies.
```bash
npm install @zendeskgarden/react-buttons @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Accordions, Theming, and Styled Components
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for using Accordion, Stepper, and Timeline components.
```bash
npm install @zendeskgarden/react-accordions @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Avatar Components
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for avatar and status indicator components.
```bash
npm install @zendeskgarden/react-avatars @zendeskgarden/react-theming styled-components
```
--------------------------------
### React Overlay Examples: Modal, Drawer, TooltipDialog
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates the usage of Modal, Drawer, and TooltipDialog components with their respective sub-components. Ensure ThemeProvider is used for theming.
```jsx
import React, { useState, useRef } from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Button } from '@zendeskgarden/react-buttons';
import { Modal, Drawer, TooltipDialog } from '@zendeskgarden/react-modals';
const OverlayExamples = () => {
const [isModalOpen, setModalOpen] = useState(false);
const [isDrawerOpen, setDrawerOpen] = useState(false);
const [isTooltipOpen, setTooltipOpen] = useState(false);
const tooltipRef = useRef(null);
return (
{/* Modal dialog */}
{isModalOpen && (
setModalOpen(false)}>
Confirm ActionAre you sure you want to delete this ticket?
)}
{/* Drawer side panel */}
setDrawerOpen(false)}>
Ticket DetailsDetailed content goes here.
{/* Anchored tooltip dialog */}
setTooltipOpen(false)}
placement="bottom"
>
Quick GuideClick elsewhere to dismiss this dialog.
);
};
```
--------------------------------
### Install Colorpickers Package
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the colorpickers package along with theming and styled-components dependencies.
```bash
npm install @zendeskgarden/react-colorpickers @zendeskgarden/react-theming styled-components
```
--------------------------------
### Install Breadcrumbs and Theming Packages
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for breadcrumbs and theming using npm.
```bash
npm install @zendeskgarden/react-breadcrumbs @zendeskgarden/react-theming styled-components
```
--------------------------------
### Color Picker Components Example
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates the usage of ColorPicker, ColorPickerDialog, ColorSwatch, and ColorSwatchDialog components for color selection.
```jsx
import React, { useState } from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import {
ColorPicker,
ColorPickerDialog,
ColorSwatch,
ColorSwatchDialog
} from '@zendeskgarden/react-colorpickers';
const palette = [
[
{ label: 'Green 800', value: '#0b3b29' },
{ label: 'Green 700', value: '#186146' },
{ label: 'Green 600', value: '#038153' }
],
[
{ label: 'Blue 800', value: '#0f3554' },
{ label: 'Blue 700', value: '#1f73b7' },
{ label: 'Blue 600', value: '#3091ec' }
]
];
const ColorExamples = () => {
const [color, setColor] = useState('#17494D');
return (
{/* Inline full color picker */}
setColor(hex)} />
{/* Popover color picker triggered by a button */}
setColor(hex)}
buttonProps={{ 'aria-label': 'Pick brand color' }}
/>
{/* Discrete palette swatch */}
setColor(value)}
/>
{/* Palette swatch in a popover dialog */}
setColor(value)}
buttonProps={{ 'aria-label': 'Select from palette' }}
/>
);
};
```
--------------------------------
### Install Loaders and Theming Packages
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for using loaders and theming in your React application.
```bash
npm install @zendeskgarden/react-loaders @zendeskgarden/react-theming styled-components
```
--------------------------------
### Story Args and ArgTypes Example
Source: https://github.com/zendeskgarden/react-components/blob/main/docs/demo.md
This example shows how to define story arguments and argument types. It illustrates setting a boolean argument and then renaming it using `argTypes` for better categorization in the Storybook UI.
```js
args={{
hasHint: true
}}
argTypes={{
hasHint: { name: Hint, table: { category: 'Story' } }
}}
```
--------------------------------
### Install Datepickers Package
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the datepickers package along with theming, styled-components, and date-fns dependencies.
```bash
npm install @zendeskgarden/react-datepickers @zendeskgarden/react-theming styled-components date-fns
```
--------------------------------
### Install Draggable and Theming Packages
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Install the necessary packages for using draggable components and theming in your React application.
```bash
npm install @zendeskgarden/react-draggable @zendeskgarden/react-theming styled-components
```
--------------------------------
### React Notification Components Example
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates the usage of Alert, Notification, Well, GlobalAlert, and ToastProvider with custom toast triggers.
```jsx
import React from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Button } from '@zendeskgarden/react-buttons';
import {
Alert,
Notification,
Well,
GlobalAlert,
ToastProvider,
useToast
} from '@zendeskgarden/react-notifications';
// Toast trigger component (must be inside ToastProvider)
const ToastTrigger = () => {
const { addToast } = useToast();
const showToast = (type) =>
addToast(
({ close }) => (
{type.charAt(0).toUpperCase() + type.slice(1)}
This is a {type} notification.
),
{ placement: 'top-end', autoDismiss: true }
);
return (
<>
>
);
};
const NotificationExamples = () => (
{/* Global app-level banner */}
Scheduled maintenance
The system will be unavailable from 2–4 AM UTC.
View details
{/* Inline alert */}
Submission failed
Please correct the errors before continuing.
{/* Well container */}
Secondary content or contextual info displayed in a recessed panel.
{/* Toast system */}
);
```
--------------------------------
### Accordion, Stepper, and Timeline Examples
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates the usage of Accordion for collapsible sections, Stepper for progress indication, and Timeline for chronological events.
```jsx
import React, { useState } from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Accordion, Stepper, Timeline } from '@zendeskgarden/react-accordions';
const AccordionExamples = () => {
const [activeStep, setActiveStep] = useState(1);
return (
{/* Controlled accordion */}
Account settings
Manage your profile, password, and preferences.
Billing
View invoices and update your payment method.
{/* Stepper showing progress */}
Contact infoEnter your name and email.ShippingChoose a delivery address.PaymentConfirm and pay.
{/* Timeline */}
2024-01-15Ticket created by Jane Doe2024-01-16Assigned to support agent2024-01-17Resolved and closed
);
};
```
--------------------------------
### Date Picker Components Example
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates the usage of DatePicker for single date selection and DatePickerRange for selecting a date range.
```jsx
import React, { useState } from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Field, Input } from '@zendeskgarden/react-forms';
import { DatePicker, DatePickerRange } from '@zendeskgarden/react-datepickers';
const DatePickerExamples = () => {
const [date, setDate] = useState(new Date());
const [startDate, setStartDate] = useState(null);
const [endDate, setEndDate] = useState(null);
return (
{/* Single date picker */}
Appointment date setDate(d)}
locale="en-US"
formatDate={d => d.toLocaleDateString('en-US')}
parseDate={str => new Date(str)}
minValue={new Date()}
>
{/* Date range picker */}
From setStartDate(d)}>
To setEndDate(d)}>
);
};
```
--------------------------------
### Grid and Pane Layout Examples
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates a responsive columnar grid and a resizable pane layout using PaneProvider and Pane components. The Pane layout requires specific styling for display and dimensions.
```jsx
import React from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Grid, PaneProvider, Pane } from '@zendeskgarden/react-grid';
const GridExamples = () => (
{/* Responsive columnar grid */}
Main contentSidebar
{/* Resizable pane layout */}
{({ getGridTemplateColumns, getGridTemplateRows }) => (
NavigationMain Content
)}
);
```
--------------------------------
### React Loader Component Examples
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates the usage of various loading indicators including Dots, Inline, Spinner, Progress, and Skeleton. Ensure ThemeProvider is used for proper rendering.
```jsx
import React, { useState, useEffect } from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Dots, Inline, Progress, Skeleton, Spinner } from '@zendeskgarden/react-loaders';
const LoaderExamples = () => {
const [progress, setProgress] = useState(0);
useEffect(() => {
const timer = setInterval(
() => setProgress(p => (p >= 100 ? 0 : p + 10)),
500
);
return () => clearInterval(timer);
}, []);
return (
{/* Animated dot loader */}
{/* Inline loader (fits within text flow) */}
Saving changes
{/* Circular spinner */}
{/* Progress bar */}
{/* Skeleton placeholders */}
);
};
```
--------------------------------
### Implement Tooltip Examples
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Showcases simple, rich, and controlled visibility tooltips. Tooltip content can be plain text or rich JSX. Ensure ThemeProvider is used for styling.
```jsx
import React from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Tooltip } from '@zendeskgarden/react-tooltips';
import { IconButton } from '@zendeskgarden/react-buttons';
import InfoIcon from '@zendeskgarden/svg-icons/src/16/info-stroke.svg';
const TooltipExamples = () => (
{/* Simple tooltip */}
{/* Rich tooltip with title and placement control */}
Keyboard shortcutPress Ctrl+S to save your work at any time.
>
}
placement="end"
type="light"
size="large"
>
{/* Controlled visibility */}
Hover target
);
```
--------------------------------
### Complete Form Example with React
Source: https://context7.com/zendeskgarden/react-components/llms.txt
Demonstrates the usage of various form components including Input, Select, MediaInput, InputGroup, Checkbox, Radio, Toggle, Range, and FileUpload within a React application. Includes state management for form values and validation.
```jsx
import React, { useState } from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import {
Field,
Fieldset,
Input,
Textarea,
Select,
Checkbox,
Radio,
Toggle,
Range,
FileUpload,
InputGroup,
MediaInput,
Tiles,
VALIDATION
} from '@zendeskgarden/react-forms';
import SearchIcon from '@zendeskgarden/svg-icons/src/16/search-stroke.svg';
const FormExamples = () => {
const [value, setValue] = useState('');
const [checked, setChecked] = useState(false);
const [range, setRange] = useState(50);
return (
);
};
```
--------------------------------
### Accordion Uncontrolled Example
Source: https://github.com/zendeskgarden/react-components/blob/main/demo/accordion/accordion.mdx
Demonstrates the uncontrolled usage of the Accordion component. No explicit state management is required.
```javascript
import { Meta, ArgTypes, Canvas, Story, Markdown } from '@storybook/addon-docs/blocks';
import * as Stories from './accordion.stories';
# API
# Demo
## Uncontrolled
```
--------------------------------
### Basic Combobox Example
Source: https://context7.com/zendeskgarden/react-components/llms.txt
A basic Combobox component configured for select-only interaction. Ensure options are provided as children.
```jsx
import React, { useState } from 'react';
import { ThemeProvider } from '@zendeskgarden/react-theming';
import {
Field,
Combobox,
Option,
OptGroup,
Tag,
Menu,
Item,
ItemGroup,
Separator
} from '@zendeskgarden/react-dropdowns';
const OPTIONS = ['Apple', 'Banana', 'Cherry', 'Date', 'Elderberry', 'Fig', 'Grape'];
const DropdownExamples = () => {
const [inputValue, setInputValue] = useState('');
const [selected, setSelected] = useState([]);
const filtered = OPTIONS.filter(opt =>
opt.toLowerCase().includes(inputValue.toLowerCase())
);
return (
{/* Basic combobox (select-only) */}
Choose a fruit
{OPTIONS.map(opt => (
))}
{/* Autocomplete + filtering combobox */}
Search fruits setInputValue(value)}
autocomplete
>
{filtered.length === 0 ? (
) : (
filtered.map(opt => )
)}
{/* Multi-select with tags */}
Select multiple fruits setSelected(selectionValue ?? [])}
renderValue={({ selection }) =>
selection.map(opt => (
{opt.label}
))
}
>
{OPTIONS.map(opt => (
))}
{/* Grouped options */}
Categorized
{/* Menu with item groups and separator */}
);
};
```
--------------------------------
### Accordion Controlled Example
Source: https://github.com/zendeskgarden/react-components/blob/main/demo/accordion/accordion.mdx
Illustrates the controlled usage of the Accordion component, where the active panel is managed by component state.
```javascript
import { Meta, ArgTypes, Canvas, Story, Markdown } from '@storybook/addon-docs/blocks';
import * as Stories from './accordion.stories';
# API
# Demo
## Controlled
```