Skip to content

fix(separator): replace self-stretch with h-full for vertical alignment#11036

Open
sergioperezcheco wants to merge 1 commit into
shadcn-ui:mainfrom
sergioperezcheco:fix/separator-vertical-alignment-11027
Open

fix(separator): replace self-stretch with h-full for vertical alignment#11036
sergioperezcheco wants to merge 1 commit into
shadcn-ui:mainfrom
sergioperezcheco:fix/separator-vertical-alignment-11027

Conversation

@sergioperezcheco

Copy link
Copy Markdown

Summary

The vertical Separator in Base UI and Radix styles uses data-vertical:self-stretch, which sets align-self: stretch. This overrides the parent flex container's items-center alignment, causing the separator to stick to the top of the row instead of being vertically centered.

This is visible in sidebar headers, breadcrumbs, toolbars, and anywhere a fixed-height vertical separator sits in an items-center flex row — exactly the pattern used throughout the docs/blocks examples (e.g. data-[orientation=vertical]:h-4).

Root Cause

align-self: stretch on a flex child that already has a fixed height (e.g. h-4) causes the child to align to flex-start (top) instead of being centered by the parent's items-center.

The new-york-v4 style already uses data-vertical:h-full instead of self-stretch and does not have this problem.

Fix

Replace data-vertical:self-stretch with data-vertical:h-full in both Base UI and Radix separator components, matching the working new-york-v4 implementation:

File Change
bases/base/ui/separator.tsx data-vertical:self-stretchdata-vertical:h-full
bases/radix/ui/separator.tsx data-vertical:self-stretchdata-vertical:h-full

The button-group.tsx files also use self-stretch but in a different context (cn-button-group-separator with explicit data-vertical:h-auto), so they are intentionally left unchanged.

Verification

Confirmed by the issue reporter: removing self-stretch so align-self falls back to auto recenters the separator perfectly. The h-full approach is already proven in new-york-v4.

Closes #11027

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

@sergioperezcheco is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@sergioperezcheco sergioperezcheco force-pushed the fix/separator-vertical-alignment-11027 branch 3 times, most recently from 3ceeb31 to 0b142e3 Compare June 30, 2026 16:57
The vertical Separator's data-vertical:self-stretch class set
align-self: stretch, which overrides the parent flex container's
items-center alignment. This caused the separator to stick to the top
of the row instead of being vertically centered — visible in sidebar
headers, breadcrumbs, toolbars, and anywhere a fixed-height vertical
separator sits in an items-center flex row.

The new-york-v4 style already uses data-vertical:h-full (which does not
override align-self), so this change aligns the Base UI and Radix
separators with that behavior.

Affected files:
- apps/v4/registry/bases/base/ui/separator.tsx
- apps/v4/registry/bases/radix/ui/separator.tsx

Closes shadcn-ui#11027
@sergioperezcheco sergioperezcheco force-pushed the fix/separator-vertical-alignment-11027 branch from 0b142e3 to 02474b1 Compare June 30, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant