Skip to content

docs(guides): add framework usage examples for Vite, Next.js, and Remix#1959

Merged
kotAPI merged 2 commits into
mainfrom
fix/issue-1842-framework-usage-guide
Jun 13, 2026
Merged

docs(guides): add framework usage examples for Vite, Next.js, and Remix#1959
kotAPI merged 2 commits into
mainfrom
fix/issue-1842-framework-usage-guide

Conversation

@kotAPI

@kotAPI kotAPI commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a framework usage guide with minimal setup examples for Vite, Next.js App Router, and Remix.
  • Links the guide from the usage docs and guides navigation.

Closes #1842.

Test plan

  • Snippets use @radui/ui per-component imports and optional theme CSS.
  • Verify the page renders at /docs/guides/framework-usage.

Made with Cursor

Summary by CodeRabbit

  • Documentation
    • Added a new "Framework Usage" guide covering Vite, Next.js App Router, and Remix with installation notes, import guidance, and code examples.
    • Updated site navigation to include the "Framework Usage" section.
    • Added an introductory link from the getting-started guide to the framework-specific documentation.

Closes #1842.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 81910ab

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 Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e829c892-9b54-4795-a004-2d1bd7a0a359

📥 Commits

Reviewing files that changed from the base of the PR and between 6a84c06 and 81910ab.

📒 Files selected for processing (2)
  • docs/app/docs/docsNavigationSections.tsx
  • docs/app/docs/first-steps/usage/content.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/app/docs/first-steps/usage/content.mdx
  • docs/app/docs/docsNavigationSections.tsx

📝 Walkthrough

Walkthrough

This PR adds a new “Framework usage” docs guide (MDX) with setup examples for Vite, Next.js App Router, and Remix, wires the guide into a docs page with SEO metadata, registers the guide in the site navigation, and cross-links it from the first-steps usage guide.

Changes

Framework Usage Guide

Layer / File(s) Summary
Framework-usage guide content and page infrastructure
docs/app/docs/guides/framework-usage/content.mdx, docs/app/docs/guides/framework-usage/page.tsx, docs/app/docs/guides/framework-usage/seo.ts
Adds the Framework usage MDX (shared setup, Vite, Next.js App Router, Remix examples, comparison table). Wires the MDX into a docs page via createDocsPage(Content) and exports guide SEO metadata via generateSeoMetadata.
Navigation entry and cross-link
docs/app/docs/docsNavigationSections.tsx, docs/app/docs/first-steps/usage/content.mdx
Registers "Framework Usage" under Guides (after "SSR & No-JS Fallback") and adds a pointer in the first-steps usage guide linking to the new framework guide.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • rad-ui/ui#1967: Also adds new guide pages and navigation entries using createDocsPage(Content) + seo.ts pattern.
  • rad-ui/ui#901: Changes docs navigation/selection logic tied to pathname, related to navigation rendering.
  • rad-ui/ui#1064: Introduces improved SEO utilities used by the new guide's seo.ts metadata.

Suggested labels

automerge

"A rabbit found a new docs glade today,
Vite, Next, and Remix all ready to play,
Install and import, wrap with Theme so neat,
Client bounds and SSR make the setup complete,
Hop on, read the guide — code with a skip and beat!" 🐇

🚥 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 clearly and concisely describes the main change: adding framework usage examples (Vite, Next.js, Remix) to the documentation guides section.
Linked Issues check ✅ Passed All acceptance criteria from issue #1842 are met: working examples for Next.js App Router, Remix, and Vite are provided; setup covers only necessary consumer needs; framework-specific considerations are documented; examples are structured for validation.
Out of Scope Changes check ✅ Passed All changes directly support the framework usage guide objective: navigation updates, introductory link, framework setup documentation, page configuration, and SEO metadata are all scoped to issue #1842.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-1842-framework-usage-guide

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

@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: 1

🤖 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/app/docs/guides/framework-usage/content.mdx`:
- Around line 39-60: The Theme wrappers shown alongside the import of
'`@radui/ui/themes/default.css`' are missing the classNamespace prop so the CSS
selectors (rad-ui-*) won't match; update each Theme usage (e.g., the Theme
component in the Vite App.tsx example, the Theme in Next providers.tsx, and the
Theme in the Remix route component) to include classNamespace="rad-ui" (e.g.,
<Theme classNamespace="rad-ui" appearance="light" accentColor="indigo">) so
generated class names align with the provided stylesheet.
🪄 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: 557e262c-de5a-441f-8c1f-ebfaf34d5c39

📥 Commits

Reviewing files that changed from the base of the PR and between b05c1b2 and 6a84c06.

📒 Files selected for processing (5)
  • docs/app/docs/docsNavigationSections.tsx
  • docs/app/docs/first-steps/usage/content.mdx
  • docs/app/docs/guides/framework-usage/content.mdx
  • docs/app/docs/guides/framework-usage/page.tsx
  • docs/app/docs/guides/framework-usage/seo.ts

Comment on lines +39 to +60
import '@radui/ui/themes/default.css'

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
)
```

```tsx
// src/App.tsx
import Theme from '@radui/ui/Theme'
import Button from '@radui/ui/Button'

export default function App() {
return (
<Theme appearance="light" accentColor="indigo">
<Button>Get started</Button>
</Theme>
)
}
```

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="docs/app/docs/guides/framework-usage/content.mdx"
test -f "$FILE" || { echo "Missing $FILE"; exit 1; }

echo "== file: $FILE =="
sed -n '1,220p' "$FILE" | nl -ba | sed -n '1,220p'

echo
echo "== occurrences of `@radui/ui/themes/default.css` in $FILE =="
rg -n "`@radui/ui/themes/default`\.css" "$FILE" || true

echo
echo "== occurrences of classNamespace in $FILE =="
rg -n "classNamespace" "$FILE" || true

echo
echo "== occurrences of <Theme " in $FILE =="
rg -n "<Theme\b" "$FILE" || true

echo
echo "== show relevant Theme snippets blocks (around 39-60, 71-111, 123-159) =="
python3 - <<'PY'
import itertools,sys
path="docs/app/docs/guides/framework-usage/content.mdx"
ranges=[(30,75),(65,120),(115,175)]
for a,b in ranges:
    print(f"\n--- {path}:{a}-{b} ---")
    with open(path,'r',encoding='utf-8') as f:
        for i,line in enumerate(f, start=1):
            if a<=i<=b:
                print(f"{i:4d}: {line.rstrip()}")
PY

echo
echo "== locate any other files referencing classNamespace for rad-ui theme =="
rg -n "classNamespace=\"rad-ui\"|classNamespace" docs/app/docs -S || true

echo
echo "== locate Theme component docs/usage in repo (if present) =="
rg -n "function App\(" docs/app/docs -S || true

Repository: rad-ui/ui

Length of output: 175


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="docs/app/docs/guides/framework-usage/content.mdx"
test -f "$FILE" || { echo "Missing $FILE"; exit 1; }

echo "== file: $FILE =="
python3 - <<PY
path="$FILE"
with open(path,'r',encoding='utf-8') as f:
    for i,line in enumerate(f, start=1):
        if i<=220:
            print(f"{i:4d}: {line.rstrip()}")
PY

echo
echo "== occurrences of `@radui/ui/themes/default.css` in $FILE =="
rg -n "`@radui/ui/themes/default`\.css" "$FILE" || true

echo
echo "== occurrences of classNamespace in $FILE =="
rg -n "classNamespace" "$FILE" || true

echo
echo "== occurrences of <Theme\\b in $FILE =="
rg -n "<Theme\\b" "$FILE" || true

echo
echo "== show relevant Theme snippets blocks (around 39-60, 71-111, 123-159) =="
python3 - <<'PY'
path="docs/app/docs/guides/framework-usage/content.mdx"
ranges=[(35,70),(70,120),(120,170)]
with open(path,'r',encoding='utf-8') as f:
    lines=list(f)
for a,b in ranges:
    print(f"\n--- {path}:{a}-{b} ---")
    for i in range(a-1,b):
        if 0<=i<len(lines):
            print(f"{i+1:4d}: {lines[i].rstrip()}")
PY

echo
echo "== locate any other files referencing classNamespace for rad-ui theme =="
rg -n "classNamespace=\"rad-ui\"|classNamespace" docs/app/docs -S || true

echo
echo "== check for rad-ui Theme component usage examples =="
rg -n "<Theme\\b" docs/app/docs -S || true

Repository: rad-ui/ui

Length of output: 12558


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show classNamespace guidance in first-steps usage
FILE="docs/app/docs/first-steps/usage/content.mdx"
test -f "$FILE" || { echo "Missing $FILE"; exit 1; }

python3 - <<'PY'
path="docs/app/docs/first-steps/usage/content.mdx"
start=40
end=140
with open(path,'r',encoding='utf-8') as f:
    lines=f.readlines()
for i in range(start-1,end):
    if i < len(lines):
        print(f"{i+1:4d}: {lines[i].rstrip()}")
PY

echo "== grep for 'default Rad UI CSS' and 'generated class names' phrases =="
rg -n "default Rad UI CSS|generated class names|class names|match the selectors" docs/app/docs/first-steps/usage/content.mdx -S || true

echo
echo "== Theme docs example_1.tsx =="
FILE2="docs/app/docs/components/theme/docs/example_1.tsx"
test -f "$FILE2" && cat -n "$FILE2" | sed -n '1,120p' || true

echo
echo "== Theme component docs usage in theme anatomy etc (small) =="
FILE3="docs/app/docs/components/theme/docs/anatomy.tsx"
test -f "$FILE3" && cat -n "$FILE3" | sed -n '1,120p' || true

Repository: rad-ui/ui

Length of output: 5113


Add classNamespace="rad-ui" to each Theme wrapper used with @radui/ui/themes/default.css.

In docs/app/docs/guides/framework-usage/content.mdx (Vite, Next.js App Router, and Remix), the examples import/link @radui/ui/themes/default.css, but the <Theme> components omit classNamespace. The Theme docs state that the default theme stylesheet expects generated namespaced classes (e.g. rad-ui-*), and Theme does not add them by default—so the rendered components won’t match the CSS selectors as described. Add classNamespace="rad-ui" to the <Theme> in each snippet (Vite App.tsx, Next providers.tsx, Remix route component).

🤖 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/guides/framework-usage/content.mdx` around lines 39 - 60, The
Theme wrappers shown alongside the import of '`@radui/ui/themes/default.css`' are
missing the classNamespace prop so the CSS selectors (rad-ui-*) won't match;
update each Theme usage (e.g., the Theme component in the Vite App.tsx example,
the Theme in Next providers.tsx, and the Theme in the Remix route component) to
include classNamespace="rad-ui" (e.g., <Theme classNamespace="rad-ui"
appearance="light" accentColor="indigo">) so generated class names align with
the provided stylesheet.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

This report compares the PR with the base branch. "Δ" shows how the PR affects each metric.

Metric PR Δ
Statements 75.68% +0.00%
Branches 59.08% +0.00%
Functions 61.75% +0.00%
Lines 77.22% +0.00%

Coverage improved or stayed the same. Great job!

Run npm run coverage:ci locally for detailed reports and target untested areas to raise these numbers.

@kotAPI kotAPI merged commit ce2adee into main Jun 13, 2026
9 of 10 checks passed
@kotAPI kotAPI deleted the fix/issue-1842-framework-usage-guide branch June 13, 2026 12:21
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.

Add examples for framework usage (Next.js, Remix, Vite).

1 participant