Skip to content

Commit 458b48b

Browse files
Merge pull request #132 from Vinishbhaskar/main
refactor(docs): enhance component descriptions for clarity and access…
2 parents 3b7da99 + 0b10b48 commit 458b48b

26 files changed

+290
-177
lines changed

apps/docs/content/components/alert-dialog.mdx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: React Alert Dialog Components
3-
description: A modal dialog that interrupts the user with important content and expects a response.
3+
description: A React alert dialog component built with Tailwind CSS. Show confirmation modals for actions like delete or logout with accessible dialogs, focus control, and keyboard support.
44
---
55

66
import AlertDialogCustomPreview from "@/components/preview/alert-dialog/alert-dialog-custom-preview";
@@ -11,9 +11,11 @@ import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
1111

1212
# Alert Dialog
1313

14-
Alert Dialogs are used to display critical information that requires user confirmation or action before proceeding. They interrupt the user's workflow to ensure important messages are seen and acted upon.
14+
The React Alert Dialog component shows a modal that asks users to confirm an important action. It is used for actions like deleting data, logging out, or making permanent changes.
1515

16-
This Alert Dialog component is built with React Aria Components and styled using Tailwind CSS, providing a highly accessible and customizable experience.
16+
It blocks the screen until the user takes action, such as confirming or canceling. For example, users must confirm before deleting an account or removing a file.
17+
18+
Built with React Aria Components and styled using Tailwind CSS. It supports keyboard navigation, focus management, and accessible modal interactions.
1719

1820
<ComponentPreview
1921
codeSnippet={getFileContent(
@@ -215,7 +217,9 @@ See [Modal](https://react-aria.adobe.com/Modal) reference for more information.
215217

216218
## Accessibility
217219

218-
- **Role**: Uses `role="alertdialog"` to ensure screen readers treat it as an interruptive modal.
219-
- **Focus Management**: Automatically handles focus entrapment and returns focus to the trigger upon closing.
220-
- **Keyboard Navigation**: Supports `Escape` key to close the dialog and `Enter` to trigger actions.
221-
- **Aria Labels**: Titles and descriptions are automatically linked to the dialog container for context.
220+
- **Focus management:** The alert dialog keeps focus within it while open and returns focus to the trigger when it closes.
221+
- **Keyboard support:** Users can press the `Escape` key to close the dialog and press `Enter` to confirm the primary action.
222+
- **Trigger behavior:** Users can open the alert dialog using a trigger and interact with actions using the mouse or keyboard.
223+
- **Screen reader support:** Screen readers announce the dialog as an alert, so users understand that immediate action is required.
224+
- **ARIA labeling:** Use `AlertDialogTitle` and `AlertDialogDescription` to describe the purpose and impact of the action clearly.
225+
- **Action clarity:** Provide clear labels for actions like confirm and cancel so users understand the outcome before proceeding.

apps/docs/content/components/aspect-ratio.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: React Aspect Ratio Components
3-
description: A React component for maintaining a desired aspect ratio for content like images, videos, and embeds. Supports responsive layouts with Tailwind CSS variants.
3+
description: A React aspect ratio component built with Tailwind CSS. Keep images, videos, and embeds in a fixed ratio with responsive scaling and no layout shift.
44
---
55

66
import AspectRatioCustomPreview from "@/components/preview/aspect-ratio/aspect-ratio-custom-preview";
@@ -12,9 +12,11 @@ import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
1212

1313
# Aspect Ratio
1414

15-
The Aspect Ratio component helps you maintain a consistent aspect ratio for content, particularly useful for responsive images, videos, and embedded content. It ensures that content maintains desired proportions across different screen sizes.
15+
The React Aspect Ratio component keeps an element’s width and height in a fixed ratio. It is useful for images, videos, and embeds that need to keep the same shape across different screen sizes.
1616

17-
This component is built with React and styled using Tailwind CSS, offering predefined aspect ratio variants as well as support for custom ratios.
17+
It adjusts the height based on the container width. So, the content scales correctly, and the layout does not shift during loading or resizing.
18+
19+
Built with React and styled using Tailwind CSS. It supports predefined aspect ratios and custom values for flexible layouts.
1820

1921
<ComponentPreview
2022
codeSnippet={getFileContent(
@@ -123,7 +125,7 @@ The AspectRatio component works seamlessly with responsive images. Use `object-c
123125

124126
## Accessibility
125127

126-
- **Semantic HTML**: The component uses a standard `<div>` element that can be enhanced with ARIA attributes as needed.
127-
- **Image Alt Text**: When using images, always provide descriptive `alt` text for screen readers.
128-
- **Focus Management**: The component forwards refs, allowing you to manage focus programmatically when needed.
129-
- **Responsive Design**: Aspect ratios are maintained across all screen sizes, ensuring consistent presentation for all users.
128+
- **Semantic structure:** The component uses a standard `<div>`. Add semantic elements inside it when needed, such as `<img>`, `<video>`, or `<iframe>`.
129+
- **Alt text for images:** Always provide a clear `alt` attribute when using images so screen readers can understand the content.
130+
- **Focus handling:** The component forwards refs, so you can manage focus if the content inside is interactive.
131+
- **Responsive behavior:** The aspect ratio stays consistent across screen sizes, so content does not shift or break layout.

apps/docs/content/components/card.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: React Card Components
3-
description: A React Card component that lets users display content in a structured and visually appealing way. Used for grouping related information, such as articles, profiles, or product details.
3+
description: A React card component built with Tailwind CSS. Create UI cards for products, blogs, dashboards, and profiles with header, content, and footer sections.
44
---
55

66
import CardArticlePreview from "@/components/preview/card/card-article-preview";
@@ -16,9 +16,11 @@ import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
1616

1717
# Card
1818

19-
Cards are flexible containers used to group related content and actions. They are commonly used for displaying articles, user profiles, product details, and summary information in a dashboard.
19+
The React Card component is a container for grouping related content and actions. It helps you organize information in a clear and structured way.
2020

21-
This Card component is built with React and styled using Tailwind CSS, offering a clean and modern design. It includes subcomponents for header, title, description, content, and footer sections to structure information effectively.
21+
You can use it to display content such as articles, user profiles, product details, or dashboard summaries. For example, a card can show a title, description, and buttons in one place.
22+
23+
Built with React and styled with Tailwind CSS, it includes sections like header, content, and footer to help you easily structure your layout.
2224

2325
<ComponentPreview
2426
codeSnippet={getFileContent("/src/components/preview/card/card-preview.tsx")}
@@ -246,6 +248,7 @@ The footer of the card.
246248

247249
## Accessibility
248250

249-
- **Semantic Structure**: Use `CardTitle` (which renders a div by default, but can be customized) for headings to seek user attention.
250-
- **Grouping**: Cards naturally group related content. For complex cards, ensure the `CardTitle` properly describes the card's purpose.
251-
- **Keyboard Navigation**: Ensure any interactive elements within the card (buttons, links in `CardFooter` or `CardContent`) are keyboard accessible.
251+
- **Semantic structure:** Use `CardTitle` for headings and structure content clearly so users can understand what the card represents.
252+
- **Content grouping:** The card groups related content and actions together, making it easier to scan and understand.
253+
- **Keyboard support:** Ensure any interactive elements inside the card (such as buttons or links in `CardFooter` or `CardContent`) are accessible using the keyboard.
254+
- **Screen reader support:** Provide clear text for titles, descriptions, and actions so screen readers can describe the card content properly.

apps/docs/content/components/carousel.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: React Carousel Components
3-
description: A powerful, flexible carousel component built with Embla Carousel. Supports horizontal/vertical orientation, custom plugins, and full API control.
3+
description: A React carousel component built with Tailwind CSS. Create image sliders, card carousels, and testimonial sliders with smooth scrolling, navigation controls, and responsive layouts.
44
---
55

66
import CarouselApiPreview from "@/components/preview/carousel/carousel-api-preview";
@@ -13,7 +13,11 @@ import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
1313

1414
# Carousel
1515

16-
A carousel component allows users to scroll through a collection of items, such as images, cards, or testimonials, in a space-efficient manner. Built on top of Embla Carousel, it provides a smooth, accessible, and highly customizable experience.
16+
The React Carousel component lets users scroll through a list of items, such as images, cards, or testimonials. It shows one or more items at a time and allows users to move between them.
17+
18+
It helps save space while still displaying multiple pieces of content. For example, you can use a carousel for product images, customer reviews, or featured content.
19+
20+
Built on top of Embla Carousel and styled with Tailwind CSS. It supports smooth scrolling and keyboard navigation, and it works well across different screen sizes.
1721

1822
<ComponentPreview
1923
codeSnippet={getFileContent(
@@ -183,9 +187,9 @@ See the [Embla Cacrousel Guides](https://www.embla-carousel.com/guides/) for mor
183187

184188
## Accessibility
185189

186-
- Use the [Embla Carousel Accessibility](https://www.embla-carousel.com/plugins/accessibility/) plugin for best accessibility support.
187-
- Built with keyboard navigation support (Arrow keys automatically scroll items).
188-
- Uses `role="region"` with `aria-roledescription="carousel"` for the outer container.
189-
- Each slide has `role="group"` and `aria-roledescription="slide"`.
190-
- Buttons include `sr-only` text for screen readers ("Previous slide", "Next slide").
191-
- Properly handles `disabled` states when the carousel cannot scroll further.
190+
- **Keyboard support:** Users can navigate between slides using `Arrow` keys.
191+
- **Screen reader support:** Navigation buttons include hidden text like “Previous slide” and “Next slide” so screen readers can announce them clearly.
192+
- **ARIA roles:** The carousel uses roles like `region` (carousel) and `group` (slide) to help screen readers understand the structure.
193+
- **Slide structure:** Each slide is treated as a separate group so users can identify slide boundaries.
194+
- **Navigation states:** Navigation buttons are `disabled` when there are no more slides to scroll.
195+
- **Accessibility plugins:** You can use the Embla accessibility plugin to enhance support for screen readers and interactions.

apps/docs/content/components/chart.mdx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: React Chart Components
3-
description: Beautiful and responsive chart components built on top of Recharts. Supports line, area, bar, and pie charts with custom tooltips and legends.
3+
description: A React chart component built with Tailwind CSS and Recharts. Create line, bar, area, and pie charts with responsive layouts, tooltips, and legends.
44
---
55

66
import ChartBarPreview from "@/components/preview/chart/chart-bar-preview";
@@ -13,7 +13,11 @@ import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
1313

1414
# Chart
1515

16-
React Chart components provide a beautiful, Tailwind-styled wrapper around the popular [Recharts](https://recharts.org/) library. They enable developers to build responsive and customizable data visualizations with ease, featuring custom styled tooltips, legends, and axis formatting.
16+
The React Chart component helps you build charts and data visualizations in your app. It works with the Recharts library and adds Tailwind CSS styling for a clean and consistent look.
17+
18+
You can use it to display data as line, bar, area, or pie charts. For example, you can show sales data, user growth, or performance metrics in a visual format.
19+
20+
Built with React and [Recharts](https://recharts.org/), it supports responsive charts, custom tooltips, legends, and flexible styling using Tailwind CSS.
1721

1822
<ComponentPreview
1923
codeSnippet={getFileContent(
@@ -174,11 +178,12 @@ Extends Recharts `DefaultLegendContentProps`.
174178
| `hideIndicator` | `boolean` | `false` | Whether to hide the color indicator shape next to legend items. |
175179
| `className` | `string` | - | Additional CSS classes for the legend container. |
176180

177-
## Accessibility
178-
179181
The Chart components are designed with accessibility in mind, ensuring that data visualizations are perceivable and navigable.
180182

181-
- **Focus Management**: The `ChartContainer` includes keyboard-accessible styles for the underlying Recharts wrapper, providing clear visual indicators when the component receives focus.
182-
- **Dynamic Indicators**: Customizable indicators (`dot`, `line`, `square`) help differentiate data series, making them easier to identify for users with visual impairments.
183-
- **ARIA Support**: Leverages Recharts' built-in ARIA support for SVG elements, providing semantic roles and labels to assistive technologies.
184-
- **Screen Readers**: Descriptive tooltips and legends ensure that data values are correctly announced when interacted with.
183+
## Accessibility
184+
185+
- **Focus management:** The chart can receive focus and shows clear visual indicators when it is active.
186+
- **Screen reader support:** Tooltips and legends help screen readers describe data values.
187+
- **Data clarity:** Use clear labels, legends, and axis titles so users can easily understand the data.
188+
- **Visual distinction:** Different colors and indicator styles (dot, line, square) help users distinguish between data series.
189+
- **ARIA support:** The chart uses accessible SVG elements and roles provided by Recharts.

apps/docs/content/components/collapsible.mdx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: React Collapsible Components
3-
description: A React collapsible component for showing and hiding a single section of content. Built on React Aria Disclosure for full accessibility and keyboard support, with a composable API inspired by shadcn/ui.
3+
description: A React collapsible component built with Tailwind CSS. Show or hide content with expandable sections, toggle panels, with simple and accessible interactions.
44
---
55

66
import CollapsibleControlledPreview from "@/components/preview/collapsible/collapsible-controlled-preview";
@@ -15,9 +15,11 @@ import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
1515

1616
# Collapsible
1717

18-
A Collapsible is a single expandable section. Use it wherever content should be progressively revealed without a page transition — order summaries, stack traces, DNS settings, build logs, environment variables, and more.
18+
The React Collapsible component lets users show or hide content by clicking a trigger. It is used to expand and collapse sections without leaving the page.
1919

20-
This component is built on top of **React Aria's `Disclosure`** primitive, giving you managed focus, correct ARIA attributes, and keyboard interaction for free.
20+
It helps keep the UI clean by hiding details until needed. For example, users can click to view order details, logs, or settings only when required.
21+
22+
This component is built on top of **React Aria's `Disclosure`** primitive and styled using Tailwind CSS. It gives built-in focus management, proper ARIA attributes, and keyboard interaction out of the box.
2123

2224
<ComponentPreview
2325
codeSnippet={getFileContent(
@@ -216,9 +218,9 @@ The panel is hidden from the accessibility tree when collapsed. React Aria handl
216218

217219
## Accessibility
218220

219-
- **Semantics** — The trigger is a `<button>` inside a heading element (`h3` by default). This creates the correct heading hierarchy for screen readers.
220-
- **ARIA attributes** `aria-expanded` and `aria-controls` are automatically managed by React Aria. No manual wiring required.
221-
- **Keyboard support** — Press `Space` or `Enter` on the focused trigger to expand or collapse the panel.
222-
- **Focus management** — Focus styles are visible when navigating by keyboard (`focus-visible`).
223-
- **Disabled state** When `isDisabled` is set, the trigger receives `disabled` and is removed from the tab order.
224-
- **Heading level** — Use the `level` prop on `CollapsibleTrigger` to match the heading hierarchy of the surrounding page content.
221+
- **Keyboard support:** Users can press `Enter` or `Space` on the trigger to expand or collapse the content.
222+
- **Focus management:** The trigger can receive focus, and focus styles appear when navigating with the keyboard.
223+
- **ARIA behavior:** The component automatically manages expanded (`aria-expanded`) and collapsed states so screen readers know when content is visible.
224+
- **Semantic structure:** The trigger is rendered as a button within a heading, helping screen readers understand the content hierarchy.
225+
- **Content visibility:** When collapsed, the content is hidden from assistive technologies and becomes available when expanded.
226+
- **Disabled state:** When `disabled`, the trigger cannot be focused or activated.

apps/docs/content/components/combobox.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: React Combobox Components
3-
description: A Combobox component that combines a text input with a listbox, allowing users to filter options and select a value. It supports sections, multi-selection, and accessibility features.
3+
description: A React combobox component built with Tailwind CSS. Create searchable dropdowns with input filtering, single or multi-select options, and accessible keyboard navigation.
44
---
55

66
import ComboboxAvatarPreview from "@/components/preview/combobox/combobox-avatar-preview";
@@ -20,7 +20,11 @@ import { Tab, Tabs } from "fumadocs-ui/components/tabs";
2020

2121
# Combobox
2222

23-
React Combobox components combine a text input with a listbox, allowing users to filter options and select a value from a list. They are often used for search-driven selection, large sets of options, and other layouts where users need to filter through data to find their choice.
23+
The React Combobox component combines an input field with a dropdown list, allowing users to search and select an option. It lets users type to filter results and quickly find what they need.
24+
25+
It is useful when you have a large list of options. For example, users can search for a country, user, or category instead of scrolling through a long list. It also supports selecting multiple options with MultiCombobox, with selected items displayed as tags.
26+
27+
Built with React and styled using Tailwind CSS. It supports filtering, keyboard navigation, and accessible selection patterns.
2428

2529
<ComponentPreview
2630
codeSnippet={getFileContent(
@@ -352,7 +356,8 @@ The `Key` type supports `string` and `number`. See [React Aria's Combobox](https
352356

353357
## Accessibility
354358

355-
- **Keyboard Navigation**: Supports arrow keys to navigate options, Enter/Space to select, and Escape to close.
356-
- **Filtering**: Type to filter the list of options dynamically.
357-
- **Screen Readers**: Follows W3C ARIA ComboBox design pattern with proper descriptions and state announcements.
358-
- **Focus Management**: Maintains focus within the input while navigating the listbox.
359+
- **Keyboard support:** Users can navigate options using `Arrow` keys, select an option with `Enter`, and close the list with `Escape`.
360+
- **Search and filtering:** As users type in the input, the list updates to show matching results.
361+
- **Focus management:** Focus stays on the input while users navigate the list.
362+
- **Selection behavior:** Supports single and multiple selection depending on configuration.
363+
- **Label and description:** Provide a label and optional description so users understand the purpose of the input.

0 commit comments

Comments
 (0)