Skip to content

make the @radui/ui Installation more creative and informative#2100

Open
Gingaaa wants to merge 1 commit into
rad-ui:mainfrom
Gingaaa:anshudeveloper
Open

make the @radui/ui Installation more creative and informative#2100
Gingaaa wants to merge 1 commit into
rad-ui:mainfrom
Gingaaa:anshudeveloper

Conversation

@Gingaaa

@Gingaaa Gingaaa commented Jul 21, 2026

Copy link
Copy Markdown

Modified the UI for Rad UI Installation command, have added multiple commands for different environment setups.

Screenshot 2026-07-20 202530

Summary by CodeRabbit

  • New Features
    • Added tabbed installation commands for pnpm, npm, Yarn, and Bun.
    • Added copy-to-clipboard support for the selected command.
    • Added syntax highlighting and expandable code display for installation snippets.

@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0bba16b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Installation documentation now uses a registered MultipleTabs component to show pnpm, npm, yarn, and bun commands with tab selection, syntax highlighting, copying, and expandable display behavior.

Changes

Installation command tabs

Layer / File(s) Summary
MultipleTabs rendering and command state
docs/components/mdx/MultipleTabs.tsx
Adds tab selection, bash highlighting with fallback text, copy-content preparation, and expandable code rendering.
MDX registration and installation usage
docs/mdx-components.tsx, docs/app/docs/first-steps/installation/content.mdx
Registers MultipleTabs for MDX and replaces the npm-only snippet with commands for four package managers.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant InstallationMDX
  participant useMDXComponents
  participant MultipleTabs
  participant User
  InstallationMDX->>useMDXComponents: Resolve MultipleTabs
  useMDXComponents-->>MultipleTabs: Provide registered component
  MultipleTabs-->>User: Render package-manager command tabs
  User->>MultipleTabs: Select a tab or copy command
  MultipleTabs-->>User: Update command or clipboard content
Loading

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the docs installation UI update and the added multi-package install options, though it is a bit subjective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/app/docs/first-steps/installation/content.mdx (1)

5-8: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Update the heading and text to reflect multi-package manager support.

Since the installation snippet now provides commands for pnpm, npm, yarn, and bun via the MultipleTabs component, the specific references to "npm" in the heading and text are outdated and contradictory. Update the copy to represent all options.

📝 Proposed copy adjustment
-## Install via npm
-
-If you use npm, run the following command to install Rad UI:
+## Install via Package Manager
+
+Run one of the following commands to install Rad UI using your preferred package manager:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/app/docs/first-steps/installation/content.mdx` around lines 5 - 8,
Update the installation section heading and introductory text around the
MultipleTabs component to describe installation with multiple supported package
managers rather than referring specifically to npm. Preserve the existing
command snippet and ensure the copy represents pnpm, npm, yarn, and bun options.
docs/components/mdx/MultipleTabs.tsx (1)

2-3: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove unused import and include useEffect.

The CodeBlock component is imported but never used in this file. Additionally, useEffect is required to fix the missing state update for hasOverflow (detailed in another comment).

♻️ Proposed fix
-import React, { useRef, useState } from 'react';
-import CodeBlock from '`@/components/layout/Documentation/helpers/CodeBlock`';
+import React, { useRef, useState, useEffect } from 'react';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/components/mdx/MultipleTabs.tsx` around lines 2 - 3, Remove the unused
CodeBlock import and add useEffect to the React import in MultipleTabs so the
component can implement the required hasOverflow state update.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/components/mdx/MultipleTabs.tsx`:
- Around line 13-14: Update the className handling in the element-processing
logic to safely access and join an absent properties.className array using
optional chaining, preventing the component from throwing when the AST element
has no classes.
- Around line 29-31: In the MultipleTabs component, add a useEffect tied to
viewportRef and collapsedHeight that measures the referenced viewport’s
scrollHeight against collapsedHeight and updates hasOverflow via setHasOverflow.
Ensure the measurement runs after rendering and preserves the existing
expandable display behavior.

---

Nitpick comments:
In `@docs/app/docs/first-steps/installation/content.mdx`:
- Around line 5-8: Update the installation section heading and introductory text
around the MultipleTabs component to describe installation with multiple
supported package managers rather than referring specifically to npm. Preserve
the existing command snippet and ensure the copy represents pnpm, npm, yarn, and
bun options.

In `@docs/components/mdx/MultipleTabs.tsx`:
- Around line 2-3: Remove the unused CodeBlock import and add useEffect to the
React import in MultipleTabs so the component can implement the required
hasOverflow state update.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 57db41f6-feeb-4093-b3ee-cd6d5b428453

📥 Commits

Reviewing files that changed from the base of the PR and between f296520 and 0bba16b.

📒 Files selected for processing (3)
  • docs/app/docs/first-steps/installation/content.mdx
  • docs/components/mdx/MultipleTabs.tsx
  • docs/mdx-components.tsx

Comment on lines +13 to +14
const { tagName, properties, children } = element;
const className = properties.className.join(' ');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Prevent potential crashes from missing className arrays.

The AST returned by refractor may not always contain a className array for every element. If it's undefined, calling .join(' ') will throw an error and crash the component. Use optional chaining to safely access and join the classes.

🛡️ Proposed fix
         const { tagName, properties, children } = element;
-        const className = properties.className.join(' ');
+        const className = properties?.className?.join(' ') || '';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { tagName, properties, children } = element;
const className = properties.className.join(' ');
const { tagName, properties, children } = element;
const className = properties?.className?.join(' ') || '';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/components/mdx/MultipleTabs.tsx` around lines 13 - 14, Update the
className handling in the element-processing logic to safely access and join an
absent properties.className array using optional chaining, preventing the
component from throwing when the AST element has no classes.

Comment on lines +29 to +31
const [expanded, setExpanded] = useState(false);
const [hasOverflow, setHasOverflow] = useState(false);
const viewportRef = useRef(null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Calculate hasOverflow to enable expandable display behavior.

The setHasOverflow function is never called, meaning hasOverflow is always false. As a result, the expandable code block functionality ("Show more" button, blur effect, and scrollbars) will never render.

Implement a useEffect hook to measure the viewport's scrollHeight against collapsedHeight and update the state.

🐛 Proposed fix to add the missing logic
     const [expanded, setExpanded] = useState(false);
     const [hasOverflow, setHasOverflow] = useState(false);
     const viewportRef = useRef(null);
+
+    useEffect(() => {
+        if (viewportRef.current) {
+            setHasOverflow(viewportRef.current.scrollHeight > 220);
+        }
+    }, [activeTab]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [expanded, setExpanded] = useState(false);
const [hasOverflow, setHasOverflow] = useState(false);
const viewportRef = useRef(null);
const [expanded, setExpanded] = useState(false);
const [hasOverflow, setHasOverflow] = useState(false);
const viewportRef = useRef(null);
useEffect(() => {
if (viewportRef.current) {
setHasOverflow(viewportRef.current.scrollHeight > 220);
}
}, [activeTab]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/components/mdx/MultipleTabs.tsx` around lines 29 - 31, In the
MultipleTabs component, add a useEffect tied to viewportRef and collapsedHeight
that measures the referenced viewport’s scrollHeight against collapsedHeight and
updates hasOverflow via setHasOverflow. Ensure the measurement runs after
rendering and preserves the existing expandable display behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant