agentleFS
open-metadataopen-metadata/OpenMetadata/openmetadata-ui-core-components/CLAUDE.md

OpenMetadata / openmetadata-ui-core-components

CLAUDE.md15k starsChanged 3 months agoApache-2.0View on GitHub

Shared UI component library for OpenMetadata, built on UntitledUI design system patterns with React Aria Components as the accessibility foundation. All public components must be exported from src/components/index.ts. Add new exports there when creating components. All Tailwind classes use the tw: prefix: tw:flex, tw:bg-primary, tw:text-sm, etc. This is mandatory to scope styles and prevent collisions with the main app's existing Less/Ant Design CSS. Theme colors are defined as CSS custom properties in src/styles/globals.css with light and dark mode variant

Trending

Less talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 0 mentionsApr 2026: 10 mentionsMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 8 mentionsSep 2026: 4 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the open-metadata/OpenMetadata repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about open-metadata/OpenMetadata

The biggest 5 of 40 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 40

Talked about on GitHub, Bluesky and Hacker News (40 times).

On GitHub · 29

24 more on GitHub

On Bluesky · 10

5 more on Bluesky

On Hacker News · 1

The file

We split this CLAUDE.md into the rules it gives an agent

11 rules. About 0 are common, 0 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All public components must be exported from src/components/index.ts.

    line 80
  2. Very specific:

    All Tailwind classes use the tw: prefix: tw:flex, tw:bg-primary, tw:text-sm, etc.

    line 86
  3. Very specific:

    Use sortCx({}) to define style variant objects (enables Tailwind IntelliSense sorting)

    line 99
  4. Very specific:

    Use cx() (from tailwind-merge) to merge class names with conflict resolution

    line 100
  5. Very specific:

    Use isReactComponent() to type-guard icon props that accept both FC and ReactNode

    line 101
  6. Very specific:

    No string literals in user-facing UI: Every string goes through t().

    line 174
  7. Very specific:

    No English fallback in t() calls: Write t('label.close'), not t('label.close', 'Close').

    line 175
  8. Very specific:

    Create the component file in the appropriate directory (base/ for primitives, application/ for composites, foundations/ for design-token …

    line 209
  9. Very specific:

    Use tw: prefix on all Tailwind classes

    line 210
  10. Very specific:

    Use cx() for class merging and sortCx() for style variant maps

    line 211
  11. Very specific:

    Run yarn build to verify compilation

    line 214

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

@openmetadata/ui-core-components

Shared UI component library for OpenMetadata, built on UntitledUI design system patterns with React Aria Components as the accessibility foundation.

Package Overview

  • Package name: @openmetadata/ui-core-components
  • Source root: src/main/resources/ui/src/
  • Build tool: Vite (library mode) with vite-plugin-dts for type declarations
  • Styling: Tailwind CSS v4 with tw: prefix to avoid conflicts with the main app's Less/Ant Design styles
  • Component foundation: react-aria-components (NOT Ant Design)
  • Icons: @untitledui/icons

Development Commands

cd openmetadata-ui-core-components/src/main/resources/ui
yarn build              # Production build to dist/
yarn dev                # Watch mode build
yarn type-check         # TypeScript type checking (tsc --noEmit)
yarn storybook          # Launch Storybook on port 6006
yarn clean              # Remove dist/

Architecture

Export Structure (package.json exports)

Import pathDescription
@openmetadata/ui-core-componentsMain entry - re-exports everything
@openmetadata/ui-core-components/componentsAll UI components
@openmetadata/ui-core-components/colorsColor utilities
@openmetadata/ui-core-components/utilscx, sortCx, utilities
@openmetadata/ui-core-components/styles.cssCompiled CSS (must be imported by consumers)

Source Directory Layout

src/
├── components/
│   ├── base/              # Primitive building blocks
│   │   ├── avatar/        # Avatar, AvatarLabelGroup, AvatarProfilePhoto
│   │   ├── badges/        # Badge, BadgeGroup
│   │   ├── buttons/       # Button, CloseButton, ButtonUtility, SocialButton
│   │   ├── button-group/  # ButtonGroup
│   │   ├── checkbox/      # Checkbox
│   │   ├── dropdown/      # Dropdown
│   │   ├── form/          # Form, HookForm
│   │   ├── input/         # Input, InputGroup, Label, HintText
│   │   ├── select/        # Select, MultiSelect, Combobox, Popover
│   │   ├── slider/        # Slider
│   │   ├── tags/          # Tags
│   │   ├── textarea/      # Textarea
│   │   ├── toggle/        # Toggle
│   │   └── tooltip/       # Tooltip
│   ├── application/       # Composite/application-level components
│   │   ├── date-picker/   # DatePicker, DateRangePicker, Calendar
│   │   ├── modals/        # ModalOverlay, Modal, Dialog, DeleteModal
│   │   ├── pagination/    # Pagination
│   │   ├── slideout-menus/ # SlideoutMenu
│   │   ├── table/         # Table
│   │   └── tabs/          # Tabs
│   └── foundations/        # Design tokens as components
│       ├── dot-icon.tsx
│       ├── featured-icon.tsx  # FeaturedIcon (light, outline themes)
│       └── payment-icons/
├── styles/
│   ├── globals.css        # Shared Tailwind-facing CSS entry (tokens, typography, shared styles)
│   └── typography.css     # Typography prose rules
├── colors/                # Color generation utilities
├── utils/                 # cx, sortCx, isReactComponent
├── types/                 # Shared TypeScript types
├── constants/             # Button constants, etc.
└── hooks/                 # Shared hooks

Component Export Registration

All public components must be exported from src/components/index.ts. Add new exports there when creating components.

Key Conventions

Tailwind CSS Prefix

All Tailwind classes use the tw: prefix: tw:flex, tw:bg-primary, tw:text-sm, etc. This is mandatory to scope styles and prevent collisions with the main app's existing Less/Ant Design CSS.

CSS Custom Properties (Design Tokens)

Theme colors are defined as CSS custom properties in src/styles/globals.css with light and dark mode variants. Components reference these semantic tokens:

  • Backgrounds: bg-primary, bg-secondary, bg-error-secondary, bg-error-solid
  • Text: text-primary, text-secondary, text-tertiary, text-fg-error-primary
  • Featured icon: text-featured-icon-light-fg-{brand,error,gray,success,warning}
  • Utility colors: border-utility-{brand,error,gray,success,warning}-{50-900}

Style Patterns

  • Use sortCx({}) to define style variant objects (enables Tailwind IntelliSense sorting)
  • Use cx() (from tailwind-merge) to merge class names with conflict resolution
  • Use isReactComponent() to type-guard icon props that accept both FC and ReactNode

Borders: never use ring-* — use border or outline

tw:ring-* compiles to a box-shadow, and WebKit does not pixel-snap box-shadows — a ring used as a border thins out and can vanish entirely in Safari at non-100% zoom. border and outline are snapped and never degrade. The library was migrated off rings; do not reintroduce them.

SituationUse
Edge may occupy layout space (static container)tw:border tw:border-<token>
Edge must be layout-neutral and the element's outline is freetw:outline-1 tw:-outline-offset-1 tw:outline-<token>
Element's outline is already the focus ring (any focusable control)borderAfter from @/utils/tailwindClasses

border consumes layout, so on content-sized controls it adds 2px of height and makes them grow on focus (1px → 2px). That is why controls use outline.

import { borderAfter } from '@/utils/tailwindClasses';

// host needs `tw:relative`; colour via `tw:after:outline-<token>`
cx('tw:relative', borderAfter, 'tw:after:outline-primary',
   isDisabled && 'tw:disabled:after:outline-disabled_subtle')

borderAfter2 is the 2px variant. Note ::before is already used by button.tsx and social-button.tsx for their inner gradient — hence ::after.

Converting a ring: ring-inset → -outline-offset-N; no ring-inset → offset 0 (a non-inset ring draws outward). Getting this wrong shifts the edge by 1px.

Gotchas:

  • tw:outline-hidden erases an outline border — remove it from any element whose border is an outline. Unlayered LESS (outline: none) beats Tailwind utilities and will kill it.
  • tw:transition-shadow won't animate an outline — use tw:transition-[outline-color,outline-width]. Plain tw:transition covers outline-color but not outline-width.
  • Keep tw:shadow-* — a real drop shadow, not the ring.
  • Consumers overriding a border must match where it's drawn: ::after for Button/ButtonUtility/Tab, the element for Input/Select/Badge/Card.

There are no remaining ring-* usages and the ESLint rule has no allow-list. Even ring-offset-* halos convert: the offset gap uses --tw-ring-offset-color (default #fff), so when the ring colour is also white the two merge into one (ring + offset)px band — ring-2 ring-white ring-offset-2 is exactly outline-4 outline-white. Where the colours differ, outline-offset-N matches the geometry with a transparent gap. Consumer focus rings on Button are usually pure duplicates of its built-in focus-visible:outline-2 focus-visible:outline-offset-2 — delete rather than convert.

Full rationale, measurements, and the anti-pattern table: openmetadata-ui/src/main/resources/ui/docs/colors.md §2.3.1.

Button Color Variants

The Button component supports these color values:

  • primary, secondary, tertiary, link-gray, link-color
  • primary-destructive, secondary-destructive, tertiary-destructive, link-destructive

i18n — core namespace

The library owns its own translations. Everything lives under a flat label.* bucket inside the core i18next namespace. Use the wrapper hook:

import { useCoreTranslation } from '@/i18n/useCoreTranslation';
const { t } = useCoreTranslation();
<button aria-label={t('label.close')}>×</button>;

Rules (enforced by yarn check-i18n-all — CI hard-fail, precommit hook):

  1. No string literals in user-facing UI. Every string goes through t().
  2. No English fallback in t() calls. Write t('label.close'), not t('label.close', 'Close'). The library eagerly loads all 20 language bundles at boot, so a missing key is a real bug — the raw key rendering is the signal.
  3. Keys are flat under label.* (with message.* for messages). No per-component nesting.
  4. After adding a key to src/locale/languages/en-us.json, run yarn i18n to sync the 19 sibling files with placeholders, then replace every placeholder with a real translation. Gate 4 (check-translations-not-english) fails if any non-en-us value is identical to its en-us source. Legitimate loanwords (French "Page", Dutch "Records") go in scripts/translation-allowlist.json per language.

Dark Mode

Dark mode uses a custom variant: @custom-variant dark (&:where(.dark-mode, .dark-mode *)). Toggle by adding .dark-mode class to a parent element.

Externalized Dependencies (Vite rollup)

These are externalized in the build and must be provided by the consuming app:

  • react, react-dom, react/jsx-runtime
  • @untitledui/icons
  • react-aria, react-aria-components, react-stately
  • react-hook-form
  • tailwind-merge
  • input-otp
  • @react-aria/utils, @react-stately/utils, @react-types/shared
  • @internationalized/date
  • tailwindcss-react-aria-components

Adding New Components

  1. Create the component file in the appropriate directory (base/ for primitives, application/ for composites, foundations/ for design-token components)
  2. Use tw: prefix on all Tailwind classes
  3. Use cx() for class merging and sortCx() for style variant maps
  4. Build on react-aria-components for accessibility
  5. Export from src/components/index.ts
  6. Run yarn build to verify compilation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.