Skip to content

Conversation

@Bridgetamana
Copy link

@Bridgetamana Bridgetamana commented Dec 6, 2025

This PR adds the input group component same way as shadcn's
Input Group - 8bitcn_ui - Google Chrome 12_6_2025 3_14_22 PM
Input Group - 8bitcn_ui - Google Chrome 12_6_2025 3_14_30 PM

Summary by CodeRabbit

  • New Features

    • Composable Input Group with normal and retro 8‑bit styling.
    • Six subcomponents: group wrapper, addon, text, button, input, and textarea.
    • Addon alignment variants (prefix/suffix/inline/block) and button size/variant options.
  • Documentation

    • New docs page with installation, usage, and multiple interactive examples.
  • Chores

    • Registry entry and components index updated to include the new Input Group.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 6, 2025

@Bridgetamana is attempting to deploy a commit to the 8bitcn Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Walkthrough

Adds two InputGroup component sets (standard and 8‑bit) with six composable subcomponents, documentation pages with examples, and a registry entry registering the 8‑bit input group component.

Changes

Cohort / File(s) Summary
Input Group Components
components/ui/input-group.tsx, components/ui/8bit/input-group.tsx
New composable input-group modules exporting InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, and InputGroupTextarea. Provide variant-driven styling, alignment variants, font (normal/retro) options, and integration with existing Input, Textarea, and Button components.
Documentation: Input Group
content/docs/components/input-group.mdx
New MDX docs page with frontmatter, installation/usage sections, and multiple ComponentPreview examples showing icon/text/button addons and textarea variants.
Documentation: Index
content/docs/components/index.mdx
Added an "Input Group" tile linking to the new docs page, placed after the Input tile and before Input OTP.
Registry
registry.json
Added input-group registry item (type: registry:component) for "8-bit Input Group", referencing components/ui/8bit/input-group.tsx and declaring dependencies on input, textarea, and button.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus areas:
    • components/ui/input-group.tsx — variant definitions, prop typings, slot attributes, and interaction with Input/Textarea/Button
    • components/ui/8bit/input-group.tsx — retro font variant mappings and class-variance rules
    • InputGroupButton — size/variant mapping to shared Button API and forwarded props
    • InputGroupAddon — alignment variants and border/placement classes
    • content/docs/components/input-group.mdx — example correctness and import paths

Suggested reviewers

  • TheOrcDev

Poem

🐰✨ I stitched new groups with buttons and text,
Pixels crisp and borders next,
Addons hop in, inputs snug and bright —
A floppy-eared dev celebrates tonight! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Feat/input group' is vague and generic, using branch naming convention rather than clearly describing the main change, making it difficult for developers scanning history to understand the primary contribution. Revise the title to be more descriptive of the actual change, such as 'Add Input Group component with composable subcomponents' or 'Introduce Input Group UI component with variant support'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfb6a68 and 471ffb3.

📒 Files selected for processing (1)
  • content/docs/components/index.mdx (1 hunks)
🔇 Additional comments (1)
content/docs/components/index.mdx (1)

111-114: Documentation entry correctly added and properly positioned.

The new "Input Group" component tile is well-placed alphabetically between "Input" and "Input OTP", follows the established grid pattern exactly, and the description "Input with addons and actions" clearly conveys the component's purpose. The href path is consistent with the site's routing convention.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e457732 and 861be71.

📒 Files selected for processing (4)
  • components/ui/8bit/input-group.tsx (1 hunks)
  • components/ui/input-group.tsx (1 hunks)
  • content/docs/components/input-group.mdx (1 hunks)
  • registry.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{ts,tsx,js,jsx}: Use explicit types for function parameters and return values when they enhance clarity
Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Keep functions focused and under reasonable cognitive complexity limits
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports

Files:

  • components/ui/input-group.tsx
  • components/ui/8bit/input-group.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{ts,tsx}: Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • components/ui/input-group.tsx
  • components/ui/8bit/input-group.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{jsx,tsx}: Use function components over class components in React
Call hooks at the top level only, never conditionally
Specify all dependencies in hook dependency arrays correctly
Use the key prop for elements in iterables (prefer unique IDs over array indices)
Nest children between opening and closing tags instead of passing as props
Don't define components inside other components
Avoid dangerouslySetInnerHTML unless absolutely necessary
Use proper image components (e.g., Next.js <Image>) over <img> tags
Use Next.js <Image> component for images
Use next/head or App Router metadata API for head elements
Use Server Components for async data fetching instead of async Client Components
Use ref as a prop instead of React.forwardRef in React 19+

Files:

  • components/ui/input-group.tsx
  • components/ui/8bit/input-group.tsx
**/*.{html,jsx,tsx,vue,svelte,astro}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{html,jsx,tsx,vue,svelte,astro}: Use semantic HTML and ARIA attributes for accessibility: provide meaningful alt text for images, use proper heading hierarchy, add labels for form inputs, include keyboard event handlers alongside mouse events, use semantic elements instead of divs with roles
Add rel="noopener" when using target="_blank" on links

Files:

  • components/ui/input-group.tsx
  • components/ui/8bit/input-group.tsx
🧬 Code graph analysis (1)
components/ui/input-group.tsx (2)
components/ui/8bit/input-group.tsx (6)
  • InputGroup (175-175)
  • InputGroupAddon (176-176)
  • InputGroupText (179-179)
  • InputGroupButton (177-177)
  • InputGroupInput (178-178)
  • InputGroupTextarea (180-180)
lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (6)
registry.json (1)

1858-1876: Registering the 8-bit Input Group looks consistent with existing entries.

Name, dependencies, and file targets follow the established 8-bit registry pattern; nothing blocking here.

content/docs/components/input-group.mdx (2)

35-184: Docs cover the main Input Group variants well.

Previews for icon, text, button, and textarea layouts line up with the exposed 8-bit API and show realistic compositions.


62-80: Fix the Usage snippet to use a defined icon.

The snippet uses <SearchIcon /> but doesn't import or define it, which will fail if copy-pasted. For consistency with the rest of the page (which uses lucide-react's Search icon), update the example to import and use Search:

 ```tsx
-import {
-  InputGroup,
-  InputGroupAddon,
-  InputGroupButton,
-  InputGroupInput,
-  InputGroupText,
-  InputGroupTextarea,
-} from "@/components/ui/8bit/input-group";
+import { Search } from "lucide-react";
+import {
+  InputGroup,
+  InputGroupAddon,
+  InputGroupButton,
+  InputGroupInput,
+  InputGroupText,
+  InputGroupTextarea,
+} from "@/components/ui/8bit/input-group";
<InputGroup>
  <InputGroupInput placeholder="Search..." />
  <InputGroupAddon>
-    <SearchIcon />
+    <Search className="size-4" />
  </InputGroupAddon>
</InputGroup>
components/ui/8bit/input-group.tsx (2)

24-172: Retro-specific layout and font handling are cohesive.

Conditional retro font application on the group, input, and textarea plus the addon alignment variants give you flexible 8-bit layouts while keeping props simple.


1-23: Verify React type imports in TypeScript configuration and full file.

The review comment flags a potential missing React import for React.HTMLAttributes. However, verification cannot be completed due to repository access limitations.

The concern may be valid depending on:

  • Whether tsconfig.json configures jsx: "react-jsx" (new JSX transform doesn't require React import) or jsx: "react" (requires explicit import)
  • The actual complete file content, particularly the InputGroupButtonProps definition mentioned but not shown in the code snippet
  • The project's TypeScript strict mode settings

Additionally, the code snippet provided only covers lines 1-18, but the review scope is lines 1-23, so the full context is incomplete.

components/ui/input-group.tsx (1)

1-168: Base Input Group implementation looks solid and idiomatic.

Good use of cva for root/addon variants, thin wrappers around Button, Input, and Textarea, and consistent data-slot attributes for composition—no issues from a typing or layout perspective.

Comment on lines +104 to +113
})

type InputGroupButtonSize = "xs" | "icon-xs" | "sm" | "icon-sm"
type InputGroupButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link"

interface InputGroupButtonProps
extends Omit<React.ComponentProps<typeof Button>, "size"> {
size?: InputGroupButtonSize
variant?: InputGroupButtonVariant
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Match the base input-group implementation by omitting both size and variant from Button props.

InputGroupButtonProps should follow the same pattern as InputGroupProps (defined at line 70) by omitting both "size" and "variant" from Button's props before redefining them with constrained types:

-interface InputGroupButtonProps
-  extends Omit<React.ComponentProps<typeof Button>, "size"> {
+interface InputGroupButtonProps
+  extends Omit<React.ComponentProps<typeof Button>, "size" | "variant"> {
   size?: InputGroupButtonSize
   variant?: InputGroupButtonVariant
 }

This ensures consistent type narrowing across the input-group component hierarchy and prevents type conflicts with the Button component's variant property.

🤖 Prompt for AI Agents
In components/ui/8bit/input-group.tsx around lines 104 to 113,
InputGroupButtonProps currently only omits "size" from
React.ComponentProps<typeof Button>; update it to omit both "size" and "variant"
from Button props (matching InputGroupProps at line 70), then redeclare the
constrained size and variant types as shown so the prop types are narrowed
consistently and avoid conflicts with Button's own variant prop.

@TheOrcDev
Copy link
Owner

Looking good @Bridgetamana !

Can you add please InputGroup component here:
content/docs/components/index.mdx?

"path": "components/ui/8bit/input-group.tsx",
"type": "registry:component",
"target": "components/ui/8bit/input-group.tsx"
"name": "character-sheet",
Copy link
Owner

Choose a reason for hiding this comment

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

This doesn't look good :)

Character sheet going in middle of input group JSON

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.

2 participants