Skip to content

Conversation

@hasegawa-101
Copy link
Contributor

@hasegawa-101 hasegawa-101 commented Dec 4, 2025

📝 Description

Added support for labelPlacement="outside-top" to
NumberInput, Select, DateInput, TimeInput, DatePicker, and DateRangePicker components to align with the Input component's behavior.

⛳️ Current behavior (updates)

These components do not support labelPlacement="outside-top"

🚀 New behavior

The following components now correctly render the label above the input field when labelPlacement="outside-top" is passed, matching the styling and behavior of the Input component:

  • NumberInput
  • Select
  • DateInput
  • TimeInput
  • DatePicker
  • DateRangePicker

This ensures consistent API and visual behavior across all form components when using
HeroUIProvider or individual props.

スクリーンショット 2025-12-05 3 52 23

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

Summary by CodeRabbit

  • New Features

    • Added an "outside-top" label placement option across inputs and pickers (NumberInput, DateInput, TimeInput, DatePicker, DateRangePicker, Select).
  • Documentation

    • Updated docs, API tables, examples, and interactive previews to include and explain outside-top and its behavior with placeholders.
  • Theme / System

    • Theme and provider configuration expanded to recognize outside-top as a valid label placement.
  • Tests

    • Added provider-context tests verifying labelPlacement inheritance and prop precedence, including outside-top.

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

@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2025

🦋 Changeset detected

Latest commit: 5d3b34d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
@heroui/number-input Patch
@heroui/select Patch
@heroui/date-input Patch
@heroui/date-picker Patch
@heroui/system Patch
@heroui/theme Patch
@heroui/react Patch
@heroui/accordion Patch
@heroui/alert Patch
@heroui/autocomplete Patch
@heroui/button Patch
@heroui/calendar Patch
@heroui/checkbox Patch
@heroui/drawer Patch
@heroui/dropdown Patch
@heroui/form Patch
@heroui/input-otp Patch
@heroui/input Patch
@heroui/listbox Patch
@heroui/menu Patch
@heroui/modal Patch
@heroui/navbar Patch
@heroui/popover Patch
@heroui/radio Patch
@heroui/slider Patch
@heroui/snippet Patch
@heroui/spinner Patch
@heroui/table Patch
@heroui/tabs Patch
@heroui/toast Patch
@heroui/tooltip Patch
@heroui/aria-utils Patch
@heroui/framer-utils Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Dec 4, 2025

@hasegawa-101 is attempting to deploy a commit to the HeroUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

Adds support for a new labelPlacement value "outside-top" across hooks, provider types, theme variants, components (NumberInput, Input, Select, Date/Time/Picker family), stories, docs, tests, and a changeset; introduces isOutsideTop on NumberInput and renames/adjusts label-placement hook exports.

Changes

Cohort / File(s) Summary
Changeset
/.changeset/fresh-crews-grow.md
Adds patch changeset documenting packages affected by the new outside-top labelPlacement.
NumberInput: component & hook
packages/components/number-input/src/number-input.tsx, packages/components/number-input/src/use-number-input.ts
Added public isOutsideTop prop and returned flag; updated outside-label detection and label rendering to treat outside-top as an outside placement.
NumberInput: theme, stories & docs
packages/core/theme/src/components/number-input.ts, packages/components/number-input/stories/number-input.stories.tsx, apps/docs/content/components/number-input/label-placements.raw.jsx, apps/docs/content/docs/components/number-input.mdx
Added outside-top theme variant; extended story controls/examples and docs to include outside-top.
System hooks & provider types
packages/core/system/src/hooks/use-label-placement.ts, packages/core/system/src/hooks/index.ts, packages/core/system/src/index.ts, packages/core/system/src/provider-context.ts
Renamed/added useInputLabelPlacement (accepts outside-top), removed/adjusted barrel exports, and extended ProviderContextProps labelPlacement type to include outside-top.
Input/select/date/time hooks & usages
packages/components/input/src/use-input.ts, packages/components/select/src/use-select.ts, packages/components/date-input/src/use-date-input.ts, packages/components/date-input/src/use-time-input.ts, packages/components/date-picker/src/use-date-range-picker.ts
Switched to the updated hook and updated shouldLabelBeOutside checks to treat outside-top as an outside placement across Input, Select, Date/Time, and DateRangePicker.
Themes: date-input & select
packages/core/theme/src/components/date-input.ts, packages/core/theme/src/components/select.ts
Added outside-top labelPlacement variants with layout/slot class definitions.
Stories / Docs: various components
apps/docs/content/components/*/label-placements.raw.jsx, apps/docs/content/docs/components/*.mdx, packages/components/*/stories/*.stories.tsx
Added outside-top to story arg options, added rendered examples, and updated documentation API tables/explanations to include outside-top.
Tests: provider context coverage
packages/components/{autocomplete,date-input,input,select,date-picker,number-input}/__tests__/*.test.tsx
Added tests verifying HeroUIProvider labelPlacement inheritance and prop precedence, including outside-top scenarios; imported HeroUIProvider where needed.
Package manifest
packages/components/date-input/package.json
Bumped @heroui/theme peer dependency minimum to >=2.4.23.
Docs layouts (examples)
apps/docs/content/components/*/label-placements.raw.jsx (autocomplete, date, date-picker, date-range-picker, select, time-input, etc.)
Added outside-top examples and adjusted example layouts (responsive grid / stacking) for several docs pages.

Sequence Diagram(s)

sequenceDiagram
    participant App as Consumer App
    participant Provider as HeroUIProvider
    participant Comp as Component (Input/NumberInput/Select/Date*)
    participant Hook as useInputLabelPlacement / use-*-hook
    participant Theme as Theme variants

    App->>Provider: Wrap with labelPlacement="outside-top"
    Comp->>Hook: call hook(props, context)
    Hook->>Provider: read global labelPlacement
    Hook-->>Comp: return isLabelOutside / isOutsideTop flag
    Comp->>Theme: request slot classes for labelPlacement
    Theme-->>Comp: return variant classes (outside-top)
    Comp->>Comp: render label outside-top (flex-col, label spacing)
    Note over Comp: Stories/docs/tests reflect the new placement
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to hook export/rename and barrel index changes (packages/core/system/src/hooks/*, src/index.ts) for consumer breakage.
  • Verify NumberInput isOutsideTop propagation and conditional rendering in packages/components/number-input/src/*.
  • Confirm theme variant classnames/slot mappings for outside-top across number-input, date-input, and select theme files.
  • Review new tests for correct expectations and potential duplication; ensure imports of HeroUIProvider align with updated exports.

Possibly related PRs

Suggested reviewers

  • jrgarciadev
  • wingkwong

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
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.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main feature addition of supporting 'outside-top' label placement across multiple form components.
Description check ✅ Passed The description covers the required sections: closes linked issues, provides clear description of changes, explains current vs new behavior, and confirms non-breaking status.
Linked Issues check ✅ Passed The PR successfully implements the requirements from both linked issues: adds 'outside-top' support to NumberInput, Select, DateInput, TimeInput, DatePicker, DateRangePicker components, and enables global configuration via HeroUIProvider.
Out of Scope Changes check ✅ Passed All changes align with the stated objectives. The PR includes necessary refactoring (useInputLabelPlacement hook consolidation), theme updates, tests, and documentation—all directly supporting the feature implementation.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ec6f62 and 5d3b34d.

📒 Files selected for processing (1)
  • apps/docs/content/docs/components/autocomplete.mdx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/docs/content/docs/components/autocomplete.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Continuous Release
  • GitHub Check: Build
  • GitHub Check: ESLint
  • GitHub Check: Tests
  • GitHub Check: TypeScript

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 4, 2025

Open in StackBlitz

@heroui/accordion

npm i https://pkg.pr.new/@heroui/accordion@5964

@heroui/alert

npm i https://pkg.pr.new/@heroui/alert@5964

@heroui/autocomplete

npm i https://pkg.pr.new/@heroui/autocomplete@5964

@heroui/avatar

npm i https://pkg.pr.new/@heroui/avatar@5964

@heroui/badge

npm i https://pkg.pr.new/@heroui/badge@5964

@heroui/breadcrumbs

npm i https://pkg.pr.new/@heroui/breadcrumbs@5964

@heroui/button

npm i https://pkg.pr.new/@heroui/button@5964

@heroui/calendar

npm i https://pkg.pr.new/@heroui/calendar@5964

@heroui/card

npm i https://pkg.pr.new/@heroui/card@5964

@heroui/checkbox

npm i https://pkg.pr.new/@heroui/checkbox@5964

@heroui/chip

npm i https://pkg.pr.new/@heroui/chip@5964

@heroui/code

npm i https://pkg.pr.new/@heroui/code@5964

@heroui/date-input

npm i https://pkg.pr.new/@heroui/date-input@5964

@heroui/date-picker

npm i https://pkg.pr.new/@heroui/date-picker@5964

@heroui/divider

npm i https://pkg.pr.new/@heroui/divider@5964

@heroui/drawer

npm i https://pkg.pr.new/@heroui/drawer@5964

@heroui/dropdown

npm i https://pkg.pr.new/@heroui/dropdown@5964

@heroui/form

npm i https://pkg.pr.new/@heroui/form@5964

@heroui/image

npm i https://pkg.pr.new/@heroui/image@5964

@heroui/input

npm i https://pkg.pr.new/@heroui/input@5964

@heroui/input-otp

npm i https://pkg.pr.new/@heroui/input-otp@5964

@heroui/kbd

npm i https://pkg.pr.new/@heroui/kbd@5964

@heroui/link

npm i https://pkg.pr.new/@heroui/link@5964

@heroui/listbox

npm i https://pkg.pr.new/@heroui/listbox@5964

@heroui/menu

npm i https://pkg.pr.new/@heroui/menu@5964

@heroui/modal

npm i https://pkg.pr.new/@heroui/modal@5964

@heroui/navbar

npm i https://pkg.pr.new/@heroui/navbar@5964

@heroui/number-input

npm i https://pkg.pr.new/@heroui/number-input@5964

@heroui/pagination

npm i https://pkg.pr.new/@heroui/pagination@5964

@heroui/popover

npm i https://pkg.pr.new/@heroui/popover@5964

@heroui/progress

npm i https://pkg.pr.new/@heroui/progress@5964

@heroui/radio

npm i https://pkg.pr.new/@heroui/radio@5964

@heroui/ripple

npm i https://pkg.pr.new/@heroui/ripple@5964

@heroui/scroll-shadow

npm i https://pkg.pr.new/@heroui/scroll-shadow@5964

@heroui/select

npm i https://pkg.pr.new/@heroui/select@5964

@heroui/skeleton

npm i https://pkg.pr.new/@heroui/skeleton@5964

@heroui/slider

npm i https://pkg.pr.new/@heroui/slider@5964

@heroui/snippet

npm i https://pkg.pr.new/@heroui/snippet@5964

@heroui/spacer

npm i https://pkg.pr.new/@heroui/spacer@5964

@heroui/spinner

npm i https://pkg.pr.new/@heroui/spinner@5964

@heroui/switch

npm i https://pkg.pr.new/@heroui/switch@5964

@heroui/table

npm i https://pkg.pr.new/@heroui/table@5964

@heroui/tabs

npm i https://pkg.pr.new/@heroui/tabs@5964

@heroui/toast

npm i https://pkg.pr.new/@heroui/toast@5964

@heroui/tooltip

npm i https://pkg.pr.new/@heroui/tooltip@5964

@heroui/user

npm i https://pkg.pr.new/@heroui/user@5964

@heroui/react

npm i https://pkg.pr.new/@heroui/react@5964

@heroui/system

npm i https://pkg.pr.new/@heroui/system@5964

@heroui/system-rsc

npm i https://pkg.pr.new/@heroui/system-rsc@5964

@heroui/theme

npm i https://pkg.pr.new/@heroui/theme@5964

@heroui/use-aria-accordion

npm i https://pkg.pr.new/@heroui/use-aria-accordion@5964

@heroui/use-aria-accordion-item

npm i https://pkg.pr.new/@heroui/use-aria-accordion-item@5964

@heroui/use-aria-button

npm i https://pkg.pr.new/@heroui/use-aria-button@5964

@heroui/use-aria-link

npm i https://pkg.pr.new/@heroui/use-aria-link@5964

@heroui/use-aria-modal-overlay

npm i https://pkg.pr.new/@heroui/use-aria-modal-overlay@5964

@heroui/use-aria-multiselect

npm i https://pkg.pr.new/@heroui/use-aria-multiselect@5964

@heroui/use-aria-overlay

npm i https://pkg.pr.new/@heroui/use-aria-overlay@5964

@heroui/use-callback-ref

npm i https://pkg.pr.new/@heroui/use-callback-ref@5964

@heroui/use-clipboard

npm i https://pkg.pr.new/@heroui/use-clipboard@5964

@heroui/use-data-scroll-overflow

npm i https://pkg.pr.new/@heroui/use-data-scroll-overflow@5964

@heroui/use-disclosure

npm i https://pkg.pr.new/@heroui/use-disclosure@5964

@heroui/use-draggable

npm i https://pkg.pr.new/@heroui/use-draggable@5964

@heroui/use-form-reset

npm i https://pkg.pr.new/@heroui/use-form-reset@5964

@heroui/use-image

npm i https://pkg.pr.new/@heroui/use-image@5964

@heroui/use-infinite-scroll

npm i https://pkg.pr.new/@heroui/use-infinite-scroll@5964

@heroui/use-intersection-observer

npm i https://pkg.pr.new/@heroui/use-intersection-observer@5964

@heroui/use-is-mobile

npm i https://pkg.pr.new/@heroui/use-is-mobile@5964

@heroui/use-is-mounted

npm i https://pkg.pr.new/@heroui/use-is-mounted@5964

@heroui/use-measure

npm i https://pkg.pr.new/@heroui/use-measure@5964

@heroui/use-pagination

npm i https://pkg.pr.new/@heroui/use-pagination@5964

@heroui/use-real-shape

npm i https://pkg.pr.new/@heroui/use-real-shape@5964

@heroui/use-ref-state

npm i https://pkg.pr.new/@heroui/use-ref-state@5964

@heroui/use-resize

npm i https://pkg.pr.new/@heroui/use-resize@5964

@heroui/use-safe-layout-effect

npm i https://pkg.pr.new/@heroui/use-safe-layout-effect@5964

@heroui/use-scroll-position

npm i https://pkg.pr.new/@heroui/use-scroll-position@5964

@heroui/use-ssr

npm i https://pkg.pr.new/@heroui/use-ssr@5964

@heroui/use-theme

npm i https://pkg.pr.new/@heroui/use-theme@5964

@heroui/use-update-effect

npm i https://pkg.pr.new/@heroui/use-update-effect@5964

@heroui/use-viewport-size

npm i https://pkg.pr.new/@heroui/use-viewport-size@5964

@heroui/aria-utils

npm i https://pkg.pr.new/@heroui/aria-utils@5964

@heroui/dom-animation

npm i https://pkg.pr.new/@heroui/dom-animation@5964

@heroui/framer-utils

npm i https://pkg.pr.new/@heroui/framer-utils@5964

@heroui/react-rsc-utils

npm i https://pkg.pr.new/@heroui/react-rsc-utils@5964

@heroui/react-utils

npm i https://pkg.pr.new/@heroui/react-utils@5964

@heroui/shared-icons

npm i https://pkg.pr.new/@heroui/shared-icons@5964

@heroui/shared-utils

npm i https://pkg.pr.new/@heroui/shared-utils@5964

@heroui/stories-utils

npm i https://pkg.pr.new/@heroui/stories-utils@5964

@heroui/test-utils

npm i https://pkg.pr.new/@heroui/test-utils@5964

commit: 5d3b34d

@hasegawa-101 hasegawa-101 marked this pull request as ready for review December 4, 2025 18:53
Copy link
Contributor

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

🧹 Nitpick comments (2)
packages/core/theme/src/components/number-input.ts (2)

213-217: Consider adding size-based compound variants for "outside-top".

Both "outside" (lines 802-841) and "outside-left" (lines 843-866) have compound variants that adjust stepperButton sizing based on the size prop. The "outside-top" placement should likely have similar adjustments for consistency.

Consider adding compound variants similar to these:

+    // outside-top & size
+    {
+      labelPlacement: "outside-top",
+      size: "sm",
+      class: {
+        stepperButton: "before:h-4",
+      },
+    },
+    {
+      labelPlacement: "outside-top",
+      size: "md",
+      class: {
+        stepperButton: "before:h-4",
+      },
+    },
+    {
+      labelPlacement: "outside-top",
+      size: "lg",
+      class: {
+        stepperButton: "min-4 w-4 h-4 before:h-6",
+      },
+    },

213-217: Consider adding text truncation support for "outside-top".

The compound variant at lines 868-873 adds text truncation styles for labelPlacement: ["inside", "outside"]. Labels in the "outside-top" placement may also benefit from text truncation to handle long labels gracefully.

Consider updating the compound variant to include "outside-top":

     {
-      labelPlacement: ["inside", "outside"],
+      labelPlacement: ["inside", "outside", "outside-top"],
       class: {
         label: ["pe-2", "max-w-full", "text-ellipsis", "overflow-hidden"],
       },
     },
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b89ba08 and 8faaff9.

📒 Files selected for processing (7)
  • .changeset/fresh-crews-grow.md (1 hunks)
  • apps/docs/content/components/number-input/label-placements.raw.jsx (1 hunks)
  • apps/docs/content/docs/components/number-input.mdx (2 hunks)
  • packages/components/number-input/src/number-input.tsx (3 hunks)
  • packages/components/number-input/src/use-number-input.ts (4 hunks)
  • packages/components/number-input/stories/number-input.stories.tsx (3 hunks)
  • packages/core/theme/src/components/number-input.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-25T17:08:46.283Z
Learnt from: adbjo
Repo: heroui-inc/heroui PR: 5846
File: packages/components/tabs/src/tabs.tsx:156-157
Timestamp: 2025-10-25T17:08:46.283Z
Learning: In packages/components/tabs/src/tabs.tsx, the renderTabs useMemo dependency array intentionally includes `variant` and `isVertical` to prevent potential side-effects, even though they might appear redundant based on static analysis.

Applied to files:

  • packages/components/number-input/src/use-number-input.ts
🧬 Code graph analysis (1)
packages/components/number-input/stories/number-input.stories.tsx (1)
packages/components/number-input/src/index.ts (1)
  • NumberInput (10-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: ESLint
  • GitHub Check: Continuous Release
  • GitHub Check: TypeScript
  • GitHub Check: Build
🔇 Additional comments (13)
.changeset/fresh-crews-grow.md (1)

1-6: LGTM!

The changeset correctly documents the new feature and references the related issue.

apps/docs/content/docs/components/number-input.mdx (2)

68-68: LGTM!

Documentation text correctly updated to include the new "outside-top" placement option.


376-376: LGTM!

API table correctly updated with the new labelPlacement option.

apps/docs/content/components/number-input/label-placements.raw.jsx (1)

4-4: LGTM!

The new placement option is correctly added to the examples array.

packages/components/number-input/stories/number-input.stories.tsx (2)

44-44: LGTM!

Storybook controls correctly updated to include the new placement option.


112-112: LGTM!

Examples for the new "outside-top" placement are correctly added to both sections.

Also applies to: 131-136

packages/components/number-input/src/use-number-input.ts (4)

216-219: LGTM!

The logic correctly includes "outside-top" in the shouldLabelBeOutside check and computes isOutsideTop appropriately.

Also applies to: 225-225


228-233: LGTM!

The isLabelOutside condition correctly accounts for the new isOutsideTop flag.


609-609: LGTM!

The new isOutsideTop flag is correctly exposed in the hook's return value.


7-7: Verify NumberInput component compatibility with useInputLabelPlacement.

The useInputLabelPlacement hook is an officially documented HeroUI hook introduced in v2.8.0 for managing label placement in form inputs. Verify that this hook provides compatible functionality for the NumberInput component's label placement needs, particularly in the context of lines 202-205 where this hook is also applied.

packages/components/number-input/src/number-input.tsx (3)

25-25: LGTM!

The isOutsideTop flag is correctly destructured from the hook.


110-110: LGTM!

The rendering logic correctly prevents the label from appearing inside the input wrapper when either isOutsideLeft or isOutsideTop is true.


143-143: LGTM!

The rendering logic correctly places the label at the component's top level when either isOutsideLeft or isOutsideTop is true, ensuring proper layout for both placement options.

@vercel
Copy link

vercel bot commented Dec 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
heroui Ready Ready Preview Comment Dec 9, 2025 5:49am
heroui-sb Ready Ready Preview Comment Dec 9, 2025 5:49am

@hasegawa-101 hasegawa-101 changed the title feat(number-input): add support for "outside-top" label placementFeat/number input outside top feat(number-input): add support for "outside-top" label placement Dec 6, 2025
@wingkwong wingkwong self-assigned this Dec 6, 2025
@hasegawa-101 hasegawa-101 changed the title feat(number-input): add support for "outside-top" label placement feat: add support for "outside-top" label placement Dec 6, 2025
Copy link
Contributor

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

🧹 Nitpick comments (2)
apps/docs/content/docs/components/number-input.mdx (1)

68-77: Improve note structure to reduce repetition.

The documentation clearly explains the new "outside-top" placement option and its behavior. However, all three notes starting at line 72 begin with the identical phrase "Note: If the", which creates stylistic repetition. Consider rewording to vary the structure.

For example:

> **Note**: If the `label` is not passed, the `labelPlacement` property will be `outside` by default.

> **Note**: When `labelPlacement` is set to `outside`, the label appears outside only if a placeholder is provided.

> **Note**: When using `outside-top` or `outside-left`, the label is always displayed outside, regardless of placeholder presence.
apps/docs/content/docs/components/select.mdx (1)

100-100: Documentation complete, but consider improving note structure.

The labelPlacement documentation is thorough and well-integrated, with helpful behavioral notes. However, the static analysis tool flagged three consecutive sentences beginning with "> Note:" (lines 104, 106, 108), which impacts readability. Consider rephrasing one note to vary the sentence structure—for example, converting line 106 to a conditional statement or merging related notes.

Suggested refactor for improved readability:

 > **Note**: If the `label` is not passed, the `labelPlacement` property will be `outside` by default.
-
-> **Note**: If the `labelPlacement` is `outside`, `label` is outside only when a placeholder is provided.
-
-> **Note**: If the `labelPlacement` is `outside-top` or `outside-left`, `label` is outside even if a placeholder is not provided.
+
+When `labelPlacement` is `outside`, the label only appears if a placeholder is provided. For `outside-top` or `outside-left`, the label appears regardless of placeholder presence.

Also applies to: 106-108, 483-483

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffb094a and 7d27178.

📒 Files selected for processing (7)
  • apps/docs/content/docs/components/date-input.mdx (2 hunks)
  • apps/docs/content/docs/components/date-picker.mdx (2 hunks)
  • apps/docs/content/docs/components/date-range-picker.mdx (2 hunks)
  • apps/docs/content/docs/components/input.mdx (1 hunks)
  • apps/docs/content/docs/components/number-input.mdx (2 hunks)
  • apps/docs/content/docs/components/select.mdx (2 hunks)
  • apps/docs/content/docs/components/time-input.mdx (2 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/components/select.mdx

[style] ~108-~108: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ly when a placeholder is provided. > Note: If the labelPlacement is `outside-...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

apps/docs/content/docs/components/number-input.mdx

[style] ~76-~76: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ly when a placeholder is provided. > Note: If the labelPlacement is `outside-...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: ESLint
  • GitHub Check: Continuous Release
  • GitHub Check: Build
  • GitHub Check: TypeScript
  • GitHub Check: Tests
🔇 Additional comments (7)
apps/docs/content/docs/components/date-input.mdx (1)

63-63: Documentation updates are accurate and consistent.

The prose description and API table type definition both correctly add outside-top as a valid labelPlacement option for DateInput. The updates align with the PR objectives to support the new placement across form components.

Also applies to: 373-373

apps/docs/content/docs/components/number-input.mdx (1)

380-380: API documentation is complete and accurate.

The labelPlacement type has been properly updated to include the new "outside-top" option alongside existing placements.

apps/docs/content/docs/components/date-range-picker.mdx (2)

83-83: Documentation update is accurate and clear.

The descriptive text correctly lists all four labelPlacement options. No issues identified.


480-484: API type definition is consistent and complete.

The updated labelPlacement type correctly reflects all supported options, matching the descriptive text above. The default value ("inside") remains appropriate.

apps/docs/content/docs/components/date-picker.mdx (1)

62-62: Documentation updated consistently for "outside-top" labelPlacement.

Both the main description and API table have been updated to reflect the new labelPlacement option. However, consider whether DatePicker should include the behavioral notes present in Input and Select components (e.g., label visibility depends on placeholder and labelPlacement combination). This clarification helps users understand when labels appear.

Also applies to: 410-410

apps/docs/content/docs/components/input.mdx (1)

78-78: Comprehensive documentation update for Input labelPlacement.

The documentation correctly adds "outside-top" to the description, API type, and includes helpful behavioral notes explaining when labels appear based on the labelPlacement and placeholder combination. These clarifications align well with the feature's goal of providing consistent label behavior across form components.

Also applies to: 86-86, 356-356

apps/docs/content/docs/components/time-input.mdx (1)

92-98: Documentation updated for "outside-top" labelPlacement.

The section header, description, and API table type have been updated to include the new labelPlacement option. Like DatePicker, TimeInput lacks the behavioral clarification notes present in Input and Select (explaining when labels appear based on labelPlacement and placeholder). Consider adding these notes for consistency and user clarity.

Also applies to: 284-284

Copy link
Contributor

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

🧹 Nitpick comments (5)
packages/components/autocomplete/__tests__/autocomplete.test.tsx (1)

865-895: Consider adding test coverage for the new "outside-top" labelPlacement.

The tests correctly verify labelPlacement inheritance and precedence with the provider context. However, since this PR introduces support for labelPlacement="outside-top" (per PR objectives), consider adding a test case that explicitly verifies the new placement option works correctly when set via HeroUIProvider and when set directly on the component.

packages/components/select/__tests__/select.test.tsx (1)

1710-1763: Consider adding test coverage for the new "outside-top" labelPlacement.

The tests correctly verify labelPlacement inheritance and precedence using DOM slot selectors. This approach differs from the Autocomplete tests (which use CSS class checks), but is appropriate for Select's structure. However, consider adding test cases for the new labelPlacement="outside-top" option introduced in this PR.

packages/components/date-input/__tests__/time-input.test.tsx (1)

448-480: Consider adding test coverage for the new "outside-top" labelPlacement.

The tests correctly verify labelPlacement inheritance and prop precedence using data-slot selectors, which is consistent with the DateInput test approach. Since this PR adds support for labelPlacement="outside-top" to TimeInput (per PR objectives), consider adding explicit test cases for the new placement option.

packages/components/input/__tests__/input.test.tsx (1)

671-701: Consider adding test coverage for the new "outside-top" labelPlacement.

The tests correctly verify labelPlacement inheritance and precedence using CSS class checks (similar to Autocomplete). The regex pattern /translate-y.*100%/ is appropriate for detecting the "outside" placement. Consider adding test cases for the new labelPlacement="outside-top" option if Input supports it.

packages/components/date-input/__tests__/date-input.test.tsx (1)

342-374: Consider adding test coverage for the new "outside-top" labelPlacement.

The tests correctly verify labelPlacement inheritance and prop precedence using data-slot selectors, consistent with TimeInput. Since this PR adds support for labelPlacement="outside-top" to DateInput (per PR objectives), consider adding explicit test cases that verify the new placement option works correctly both when inherited from HeroUIProvider and when set directly on the component.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d27178 and b17a50e.

📒 Files selected for processing (5)
  • packages/components/autocomplete/__tests__/autocomplete.test.tsx (2 hunks)
  • packages/components/date-input/__tests__/date-input.test.tsx (2 hunks)
  • packages/components/date-input/__tests__/time-input.test.tsx (2 hunks)
  • packages/components/input/__tests__/input.test.tsx (2 hunks)
  • packages/components/select/__tests__/select.test.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
packages/components/date-input/__tests__/date-input.test.tsx (1)
packages/core/system/src/provider.tsx (1)
  • HeroUIProvider (52-114)
packages/components/select/__tests__/select.test.tsx (1)
packages/core/system/src/provider.tsx (1)
  • HeroUIProvider (52-114)
packages/components/input/__tests__/input.test.tsx (2)
packages/core/system/src/provider.tsx (1)
  • HeroUIProvider (52-114)
packages/components/input/src/index.ts (1)
  • Input (12-12)
packages/components/date-input/__tests__/time-input.test.tsx (1)
packages/core/system/src/provider.tsx (1)
  • HeroUIProvider (52-114)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Continuous Release
  • GitHub Check: TypeScript
  • GitHub Check: ESLint
  • GitHub Check: Build

Copy link
Member

@wingkwong wingkwong left a comment

Choose a reason for hiding this comment

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

  1. Select > Label Placement. The example is overlapping.
image
  1. Update possible values in label placement in https://heroui-6nl930day-heroui.vercel.app/docs/api-references/heroui-provider

Copy link
Contributor

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/docs/content/docs/components/autocomplete.mdx (1)

544-548: API table for labelPlacement is missing outside-top

The descriptive docs and examples show outside-top as a valid labelPlacement, but the API row still lists only inside | outside | outside-left. This will confuse consumers checking the API reference.

Recommend updating the type string to include outside-top:

{
   attribute: "labelPlacement",
-  type: "inside | outside | outside-left",
+  type: "inside | outside | outside-left | outside-top",
   description: "The position of the label.",
   default: "inside"
 },
🧹 Nitpick comments (1)
apps/docs/content/components/number-input/label-placements.raw.jsx (1)

4-35: NumberInput label placements demo correctly adds outside-top (optional layout cleanup)

The example now covers all four placements, including outside-top, and the two-column layout on md+ screens reads well.

If you want to keep layout consistent with the Autocomplete/Select examples and avoid mixing flex and grid display classes, you could simplify the root container:

-  return (
-    <div className="flex flex-col gap-8 md:grid md:grid-cols-2">
+  return (
+    <div className="grid grid-cols-1 gap-8 md:grid-cols-2">

Current code is perfectly valid; this is just for consistency and slightly cleaner Tailwind usage.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1aee65f and 4ec6f62.

📒 Files selected for processing (5)
  • apps/docs/content/components/autocomplete/label-placements.raw.jsx (2 hunks)
  • apps/docs/content/components/number-input/label-placements.raw.jsx (2 hunks)
  • apps/docs/content/components/select/label-placements.raw.jsx (2 hunks)
  • apps/docs/content/docs/api-references/heroui-provider.mdx (1 hunks)
  • apps/docs/content/docs/components/autocomplete.mdx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
apps/docs/content/components/autocomplete/label-placements.raw.jsx (2)
apps/docs/content/components/number-input/label-placements.raw.jsx (1)
  • placements (4-4)
apps/docs/content/components/select/label-placements.raw.jsx (1)
  • placements (20-20)
apps/docs/content/components/number-input/label-placements.raw.jsx (2)
apps/docs/content/components/autocomplete/label-placements.raw.jsx (1)
  • placements (32-32)
apps/docs/content/components/select/label-placements.raw.jsx (1)
  • placements (20-20)
apps/docs/content/components/select/label-placements.raw.jsx (5)
apps/docs/content/components/autocomplete/label-placements.raw.jsx (1)
  • placements (32-32)
apps/docs/content/components/number-input/label-placements.raw.jsx (1)
  • placements (4-4)
apps/docs/content/components/date-input/label-placements.raw.jsx (1)
  • placements (5-5)
apps/docs/content/components/date-picker/label-placements.raw.jsx (1)
  • placements (4-4)
apps/docs/content/components/date-range-picker/label-placements.raw.jsx (1)
  • placements (4-4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Continuous Release
  • GitHub Check: TypeScript
  • GitHub Check: Build
🔇 Additional comments (6)
apps/docs/content/docs/components/autocomplete.mdx (1)

103-110: Docs text correctly reflects new outside-top placement

The label placements paragraph now matches the new supported values (inside, outside, outside-left, outside-top) and aligns with the examples.

apps/docs/content/docs/api-references/heroui-provider.mdx (1)

148-153: HeroUIProvider labelPlacement docs aligned with new outside-top value

The description and possible values now correctly include outside-top, matching the component-level support introduced elsewhere in the PR.

apps/docs/content/components/autocomplete/label-placements.raw.jsx (1)

32-70: Autocomplete label placements example fully updated for outside-top

The placements array and both “Without placeholder” / “With placeholder” sections now include outside-top, and the responsive grid layout is consistent with the other component demos. Looks good.

apps/docs/content/components/select/label-placements.raw.jsx (3)

20-20: LGTM! Consistent addition of "outside-top" placement.

The addition of "outside-top" to the placements array correctly implements the PR's core objective and matches the pattern used across other form components (autocomplete, number-input, date-input, etc.).


23-23: Improved responsive layout for four placement options.

The switch to a responsive grid layout (two columns on medium+ screens) effectively accommodates the fourth placement option while maintaining a clean, organized presentation. The increased gap (4 → 8) is appropriate for grid spacing.


24-26: Consistent spacing improvements.

The increased gap spacing (gap-2 → gap-4) in both "Without placeholder" and "With placeholder" sections provides better visual separation between the four Select components, improving readability of the documentation examples.

Also applies to: 41-43

@hasegawa-101
Copy link
Contributor Author

Stacked them vertically so they don't get cut off
スクリーンショット 2025-12-11 2 03 46

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.

[BUG] - HeroUIProvider doesn't support labelPlacement "outside-top" [BUG] - NumberInput labelPlacement missing "outside-top"

2 participants