Skip to content
AntFabric Corev1.0.0local

UI kit (AntFabric UI)

Every screen, core or plugin, imports its components from one name: @antfabric/ui-kit on the web, desktop and App Admin, @antfabric/ui-kit/native on the phone. Behind that name is AntFabric UI, the design system for the whole product. The kit is part of core (libs/ui-kit), not a plugin: the shell, App Admin and every app are built on it, so every instance has it and no instance file lists it.

libs/ui-kit @antfabric/ui-kit
src/index.ts React: AntFabric UI + core's extras '@antfabric/ui-kit'
src/data.ts tables, KPIs, charts (recharts) '@antfabric/ui-kit/data'
src/native.ts React Native: AntFabric UI + extras '@antfabric/ui-kit/native'
src/native-data.ts the phone's data components '@antfabric/ui-kit/native/data'
src/react, src/native the extras (rich text, fonts, renamed types)
src/core rich-text parsing shared by both
package.json depends on @antfabric-ui/core, /react, /react-native
  • Import @antfabric/ui-kit only. Lint rejects @antfabric-ui/* in plugins: core’s name keeps working when the library renames or moves something.
  • /data is a separate entry so screens without tables or charts never load recharts.
  • An instance’s look comes from its branding (colours, logo) and navigation layout, not from a different kit. Plugins’ platform.ui range is checked against this package’s version.
  • Older instance files may still list af.antfabric-ui (the kit was a plugin until 16 November 2026). The build skips that line and says it can go.

AntFabric UI publishes @antfabric-ui/core, @antfabric-ui/react and @antfabric-ui/react-native to its GitLab package registry when its owner tags a release. There is no release yet, so the packages are built from the library’s repository and kept as tarballs in vendor/antfabric-ui/ (the library’s own CONSUMING.md describes this). See vendor/antfabric-ui/README.md to refresh them.

When the registry has a release:

  1. Add an .npmrc scope line for @antfabric-ui with a GITLAB_TOKEN (read_package_registry); CI uses CI_JOB_TOKEN once the library’s owner allows this project.
  2. Change the three file: versions in libs/ui-kit/package.json to the release.
  3. Remove the @antfabric-ui/core override from pnpm-workspace.yaml and delete vendor/.

Core takes each release on purpose, in one merge request; plugins get it when they update core.

  1. In libs/ui-kit/package.json, set the three @antfabric-ui/* versions to the release (until then: refresh the tarballs and record the library commit in vendor/antfabric-ui/README.md).
  2. pnpm install, then pnpm nx run-many -t typecheck lint test and look at the web, App Admin and phone screens.
  3. Renamed or removed exports: keep the old name working in src/react/index.ts or src/native/index.ts for one core release, and say so in the merge request.
  4. A breaking release raises libs/ui-kit‘s version (its major for a break), which plugins’ platform.ui ranges are checked against.
Export Why
RichText, FormatToolbar, formatSelection, parseRichText, … The chat’s formatted text; AntFabric UI has no rich-text renderer
fonts (native) The Figtree files for useFonts, from @antfabric-ui/core/fonts/
Os, Presence, Identity, NavDestination, TabItem, SegmentedItem, KitPlatform Names core already used, aliased to AntFabric UI’s (OS, AvatarPresence, …)
brandVars, tokensCss, resolveTokens, formatShortcut, initials Re-exported from @antfabric-ui/core

The rail and the sidebar (see Navigation layouts) are drawn by libs/app-shell/src/layouts/column.tsx, and the top bar by top.tsx (with AntFabric UI’s Menu for “More”), from AntFabric UI’s basic pieces (Icon, IconButton, Badge, Avatar). AntFabric UI’s own NavRail is its chat product’s rail: fixed destinations (Assistant, Channels…), its own logo and workspace switcher, Search and “Report a bug”. Its WebTopBar is the same product’s browser bar (back and forward, search, open the desktop app, help) with no menu entries. Core needs plugins’ entries and the instance’s name, so it draws its own.

Differences that matter when writing screens

Section titled “Differences that matter when writing screens”
  • Props are the documented ones plus style. No className or DOM attributes.
  • A field shows its error only with invalid: <TextField error="…" invalid />.
  • A form dialog’s confirm button carries its shortcut in its accessible name (“Sign out Ctrl+Enter”). Tests match it with /^Sign out/.
  • The page background and margin are the shell’s: ShellRoot paints surface.page and resets html/body, which AntFabric UI leaves alone.
  • InlineBanner announces politely (role="status"), never as an alert.
  • The phone’s ListItem has no long press. Wrap it in a Pressable that carries onPress and onLongPress (see the phone inbox).
  • Tests: jsdom lacks matchMedia and ResizeObserver, which the kit uses. Test setup files call installDomShims() from @antfabric/sdk-web/testing. The phone’s Jest transforms @antfabric-ui/* and the chart packages.
Question What core does now
NavRail keys are a fixed union; could they be string, with the logo, search and bug report optional? Draws its own column from basic pieces
Phone ListItem: onLongPress and titleLines? Wraps rows in a Pressable; titles are one line
An error InlineBanner as role="alert"? Keeps status
A release tag, so we install from the registry Vendored tarballs
Satoshi (headlines) is not packed for licence reasons; may AntFabric’s apps ship it? Headlines fall back to Figtree / the system font