Files
supabase/packages/ui
Joshen Lim ab60ab2684 Fix ProjectLayout side nav width changes after opening and closing inline SQL Editor (#52623)
## Context

Happens in the ProjectLayout when the side navigation menu's width can
be resized (Table Editor / SQL Editor)

On those pages, if you were to toggle the inline SQL Editor with Cmd+E,
the side navigation menu's width will change to fit the max width once
the inline SQL Editor is closed, and its happening due to the library's
default behaviour for handling nested resizable groups.

The fix was to bump `react-resizable-panel` to `4.7.x` which introduced
a new property `groupResizeBehaviour` and allows us to set that prop's
value as `preseve-pixel-size` for the `ProjectLayout` since we use pixel
values in this context for the panel widths. Same fix also applied for
`FilterSideBar` which is used in Unified Logs
2026-11-03 14:00:59 +08:00
..
2026-11-02 11:13:44 +02:00

packages/ui

Supabase's shared React component library. Built on Radix UI primitives and shadcn/ui, styled with Tailwind CSS, and used across all Supabase apps.

Usage

Import from the 'ui' package alias:

import { Badge, Button, Input } from 'ui'

Some of the components have the _Shadcn_ suffix. These components should be preferred, they're in a process of replacing the other ones.

Utilities

// deep object merge (used for themes)
import { clipboard, cn, mergeDeep } from 'ui' // Tailwind class merging (shadcn-ui/cn)

// copy-to-clipboard helper

Styling conventions

  • Tailwind only — no inline styles or CSS modules.
  • Prefer shadcn semantic pairs (bg-card text-card-foreground, bg-muted text-muted-foreground, bg-tertiary text-tertiary-foreground) over hardcoded colors. Legacy utilities such as text-foreground-light and border-default are compatibility aliases only.
  • Control surface roles (bg-field, bg-control-raised, border-control-hover; CSS --control aliases raised) live in build/css/source/semantic.css. Prefer those over inventing fills. Legacy bg-control is still the accent wash alias.
  • Themes set the core --hue (or the split --surface-hue / --primary-hue), --chroma, --surface, --foreground-lightness, and --contrast inputs, plus their --muted-foreground-level and --tertiary-foreground-level hierarchy. Semantic colors are derived from them in OKLCH; --contrast: 1 is the baseline and the supported adjustment range is 0.75 to 1.25.
  • The workspace root owns the actual tailwind.config.js. The file in this package is a stub for IntelliSense only.