The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Align Twenty UI documentation (#28522)
Raphaël Bosi16e6cc87a5d2
diff --git a/packages/twenty-docs/README.md b/packages/twenty-docs/README.mdindex 27d208317a2..9e91620966d 100644--- a/packages/twenty-docs/README.md+++ b/packages/twenty-docs/README.md@@ -9,6 +9,7 @@ Visit the documentation at [docs.twenty.com](https://docs.twenty.com)## 📚 ContentThis repository contains:+- **User Guide** (46 pages) - Complete guide for Twenty users- **Developers** (24 pages) - Technical documentation for developers- **UI Library** - Guides, primitives, and components@@ -57,6 +58,7 @@ Your content here...1. Place images in the `/images/` directory2. Reference them in MDX: ``3. Or use Mintlify Frame component:+```mdx<Frame><img src="/images/your-image.png" alt="Description" />@@ -83,6 +85,8 @@ npx nx run twenty-docs:validateRun `npx nx generate:ui twenty-docs` after changing documented component props or theme tokens. Run `npx nx check:ui twenty-docs` to check generated references and compile the UI guide examples against the public entry points. Hand-written pages live under `ui/`; generated snippets live under `snippets/ui/generated/`.+Follow the [twenty-ui documentation guidelines](../twenty-ui/README.md#documentation) for story roles, complete usage examples, state ownership, and composition. Run `npx nx check:ui-stories twenty-docs` to validate preview titles, story references, the first `Display`, and the absence of automated interactions in embedded stories.+UI guides, component pages, and navigation labels use the existing Crowdin translation workflow. Translated pages appear in their locale’s navigation once the corresponding files exist. Generated API and token snippets are shared across locales and maintained by the reference generator.## 🔗 Linksdiff --git a/packages/twenty-docs/developers/extend/apps/layout/front-components.mdx b/packages/twenty-docs/developers/extend/apps/layout/front-components.mdxindex 44a910fd91a..cadcc32a701 100644--- a/packages/twenty-docs/developers/extend/apps/layout/front-components.mdx+++ b/packages/twenty-docs/developers/extend/apps/layout/front-components.mdx@@ -924,11 +924,6 @@ Front components support multiple styling approaches. You can use:Twenty ships its component library as the [`twenty-ui`](https://www.npmjs.com/package/twenty-ui) package. Prefer its controls and theme tokens to give front components the same appearance and interactions as the rest of Twenty. Browse the [shared components](/ui/components/overview) and [primitives](/ui/primitives/overview) for examples, props, and composition APIs.-<Warning>- `twenty-ui` is still in alpha. Its version number follows the Twenty SDK- release cycle. APIs and component behavior may change between releases.-</Warning>-### InstallationNew apps scaffolded with `create-twenty-app` already include `twenty-ui`. For an existing app, add it as a development dependency, pinned to the same version as `twenty-sdk` and `twenty-client-sdk`. For example, if your SDK packages use `2.51.0`:diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdxindex 1c65040d86b..0fbd2c7ac09 100644--- a/packages/twenty-docs/ui/components/overview.mdx+++ b/packages/twenty-docs/ui/components/overview.mdx@@ -19,6 +19,7 @@ Import from `twenty-ui/components/input`.| [IconButton](/ui/components/input/icon-button) | Square or round icon actions built on Button. || [LightIconButton](/ui/components/input/light-icon-button) | Lightweight icon actions with standard or subtle emphasis. || [PhoneCountryPicker](/ui/components/input/phone-country-picker) | Searchable country flags and calling-code selection. |+| [NumberStepper](/ui/components/input/number-stepper) | Compact numeric input with optional step buttons. || [SearchInput](/ui/components/input/search-input) | Search text and optional filter controls. || [CountrySelect](/ui/components/input/country-select) | Searchable country choices, flags, and an explicit empty selection. || [CurrencyPicker](/ui/components/input/currency-picker) | Searchable currency choices with explicit formatting. |diff --git a/packages/twenty-docs/ui/getting-started.mdx b/packages/twenty-docs/ui/getting-started.mdxindex 6a595142556..13226656aff 100644--- a/packages/twenty-docs/ui/getting-started.mdx+++ b/packages/twenty-docs/ui/getting-started.mdx@@ -3,20 +3,14 @@ title: Getting starteddescription: Install Twenty UI in a React application and use its components and themes.----Twenty UI is Twenty's React component library. It provides components, icons, and theme tokens with prebuilt CSS, so your application does not need a CSS-in-JS compiler.--<Note>- Twenty UI is in alpha. Its version follows the Twenty SDK release cycle, and- component APIs can change between releases. In a Twenty app, keep `twenty-ui`,- `twenty-sdk`, and `twenty-client-sdk` on the same version.-</Note>+Twenty UI is Twenty's open-source React UI library. It provides foundational primitives, shared components, icons, and theme tokens with prebuilt CSS, so your application does not need a CSS-in-JS compiler.## Install-For a standalone React application, install the library and its peer dependencies:+For an existing React application, install the library. React 19 is required.```bash-yarn add twenty-ui react@^19 react-dom@^19+yarn add twenty-ui```The [code editor](/ui/components/code-editor/code-editor) has a separate entry point, `twenty-ui/components/code-editor`. Other components do not require Monaco. To use the code editor, install its optional peer dependencies and configure Monaco workers for your bundler before mounting it:@@ -25,7 +19,7 @@ The [code editor](/ui/components/code-editor/code-editor) has a separate entry pyarn add @monaco-editor/react monaco-editor```-If you are building a Twenty app, follow [Using Twenty UI components](/developers/extend/apps/layout/front-components#using-twenty-ui-components). The front component renderer supplies the workspace theme and has a different setup from a standalone browser application.+If you are building a Twenty app, follow [Using Twenty UI components](/developers/extend/apps/layout/front-components#using-twenty-ui-components). The front component renderer supplies the workspace theme and has a different setup from a standalone browser application. Keep `twenty-ui`, `twenty-sdk`, and `twenty-client-sdk` on the same version.## Load styles and provide a theme@@ -53,7 +47,7 @@ The component stylesheet includes a global reset. Review its effect when adding## Override styles-Twenty UI puts every rule of its stylesheets, including the reset, in the `twenty-ui` cascade layer. Styles you write outside a layer, such as a `className`, a CSS module, or a CSS-in-JS rule, override Twenty UI whatever their selector specificity or import order.+Twenty UI puts component styles and the reset in the `twenty-ui` cascade layer. Styles you write outside a layer, such as a `className`, a CSS module, or a CSS-in-JS rule, override those layered rules regardless of selector specificity or import order. Theme stylesheets and the optional editor's global Monaco rules remain unlayered.Global element resets in your application are unlayered too, so they would override Twenty UI components. Declare a layer for them before Twenty UI's stylesheet loads:@@ -90,32 +84,51 @@ layout remain in the application.Each primitive and shared component family has a matching public entry point, such as`twenty-ui/primitives/input` and `twenty-ui/components/settings`. The aggregate-`twenty-ui/components` entry remains available.--| Import | Contents |-| ------------------------------------ | --------------------------------------------------------------------- |-| `twenty-ui/components` | All shared component families except the optional editor |-| `twenty-ui/components/data-display` | Avatar groups, JSON trees, metrics, counters, and icon tiles |-| `twenty-ui/components/feedback` | Callouts, inline banners, and notifications |-| `twenty-ui/components/input` | Button and radio presets, search and image inputs, and country/currency pickers |-| `twenty-ui/components/layout` | Sections, overflowing lists, and icon transitions |-| `twenty-ui/components/navigation` | Dropdowns, menu compositions, and tab actions |-| `twenty-ui/components/settings` | Settings rows and settings-specific compositions |-| `twenty-ui/components/code-editor` | Code editor, editor header, and editor theme helpers |-| `twenty-ui/primitives/accessibility` | Hidden elements |-| `twenty-ui/primitives/data-display` | Avatars, chips, tags, color samples, and status indicators |-| `twenty-ui/primitives/feedback` | Banners, progress bars, and loaders |-| `twenty-ui/primitives/input` | Buttons and form controls |-| `twenty-ui/primitives/layout` | Expansion, separators, direction, and resizing |-| `twenty-ui/primitives/navigation` | Action links, list items, and tabs |-| `twenty-ui/primitives/surfaces` | Cards, dialogs, menus, popovers, and tooltips |-| `twenty-ui/primitives/typography` | Text and headings |-| `twenty-ui/icon` | [Icons and dynamic lookup](/ui/icons) |-| `twenty-ui/testing` | [Storybook decorators and layouts](/ui/testing) |-| `twenty-ui/theme` | Theme provider, hooks, and CSS variable references |+`twenty-ui/primitives` and `twenty-ui/components` entries export their respective families.+The root `twenty-ui` entry re-exports primitives, shared components, icons, theme tokens,+and utilities. Assets, testing helpers, and the optional code editor have separate entry points.++| Import | Contents |+| ------------------------------------ | ------------------------------------------------------------------- |+| `twenty-ui/assets` | Logos and static assets |+| `twenty-ui/components` | All shared component families except the optional editor |+| `twenty-ui/components/data-display` | Avatar groups, command blocks, JSON trees, metrics, and icon tiles |+| `twenty-ui/components/feedback` | Callouts, inline banners, and notifications |+| `twenty-ui/components/input` | Button presets, specialized inputs, pickers, and segmented controls |+| `twenty-ui/components/layout` | Sections, overflowing lists, and icon transitions |+| `twenty-ui/components/navigation` | Dropdowns, menu compositions, and tab actions |+| `twenty-ui/components/settings` | Settings rows with labeled controls |+| `twenty-ui/components/code-editor` | Code editor, editor header, and editor theme helpers |+| `twenty-ui/primitives` | All primitive families |+| `twenty-ui/primitives/accessibility` | Hidden elements and keyboard interaction helpers |+| `twenty-ui/primitives/data-display` | Avatars, badges, chips, tags, color samples, and status indicators |+| `twenty-ui/primitives/feedback` | Banners, progress indicators, loaders, and skeletons |+| `twenty-ui/primitives/input` | Buttons and form controls |+| `twenty-ui/primitives/layout` | Expansion, separators, direction, and resizing |+| `twenty-ui/primitives/navigation` | Breadcrumbs, list items, and tabs |+| `twenty-ui/primitives/surfaces` | Cards, dialogs, popovers, and tooltips |+| `twenty-ui/primitives/typography` | Text, headings, shortcuts, and overflowing text |+| `twenty-ui/icon` | [Icons and dynamic lookup](/ui/icons) |+| `twenty-ui/testing` | [Storybook decorators and layouts](/ui/testing) |+| `twenty-ui/theme` | Theme provider, hooks, and CSS variable references |+| `twenty-ui/utilities` | Hooks and shared utilities |Import individual icons, such as `IconCheck`, from `twenty-ui/icon`. The dynamic icon provider includes the full icon catalog, so reserve it for interfaces that need to look up icons at runtime.+## Responsive hooks++Import `useIsMobile`, `useIsTouchDevice`, and `useMediaQuery` from `twenty-ui/utilities`.++| Hook | Query | Use |+| ---------------------- | ----------------------------------------------------------------- | --------------------------------------------------------- |+| `useIsMobile()` | `MOBILE_MEDIA_QUERY`, up to and including `MOBILE_VIEWPORT` | Choose a compact layout. |+| `useIsTouchDevice()` | `TOUCH_DEVICE_MEDIA_QUERY`, `(hover: none) and (pointer: coarse)` | Choose touch interaction behavior independently of width. |+| `useMediaQuery(query)` | Any media query supported by `window.matchMedia` | Subscribe to a custom media query. |++The query constants come from `twenty-ui/utilities`; `MOBILE_VIEWPORT` comes from `twenty-ui/theme`. Subscriptions share one `MediaQueryList` per query and update when its match changes. Hooks return `false` during server rendering, the first hydration render, and when `window.matchMedia` is unavailable.++In a [Twenty front component](/developers/extend/apps/layout/front-components#current-limitations), width queries follow the widget's box. `useIsMobile` therefore follows the widget width, while `useIsTouchDevice` follows the device's primary input. Use [story overrides](/ui/testing#media-query-overrides) to exercise these states in Storybook.+## Continue- [Theming](/ui/theming): use semantic tokens and scoped overrides.diff --git a/packages/twenty-docs/ui/primitives/overview.mdx b/packages/twenty-docs/ui/primitives/overview.mdxindex af343c0f698..21605300c6d 100644--- a/packages/twenty-docs/ui/primitives/overview.mdx+++ b/packages/twenty-docs/ui/primitives/overview.mdx@@ -6,7 +6,7 @@ description: Foundational controls for building interfaces with Twenty UI.Primitives are the foundational controls in Twenty UI. They include inputs, display elements, navigation, and compound controls such as Select, Popover, and AlertDialog. Each primitive receives data and callbacks from your application.-Import primitives from a family entry point, such as `twenty-ui/primitives/input`. See [Getting started](/ui/getting-started) for installation and theme setup.+Import primitives from a family entry point, such as `twenty-ui/primitives/input`. The aggregate `twenty-ui/primitives` entry also exports every primitive family. See [Getting started](/ui/getting-started) for installation and theme setup.[Components](/ui/components/overview) combine these primitives into shared design presets and reusable app building blocks.@@ -36,16 +36,18 @@ Slots such as `InputGroup.startElement` and `ListItem.actions` accept React node### Popup composition-Some primitives package supporting overlay elements inside their `Popup` part:+Select, Popover, and Autocomplete expose separate `Portal`, `Positioner`, and `Popup` parts:-| Component | Included in `Popup` | Configure on `Popup` |-| --------- | -------------------------------------- | -------------------------------------------------------- |-| `Select` | Portal and positioner | Placement, anchor, and portal container |-| `Popover` | Portal, positioner, and optional arrow | Placement, anchor, portal container, mounting, and arrow |+| Part | Responsibility |+| ------------ | --------------------------------------------------- |+| `Portal` | Destination container and mounting |+| `Positioner` | Placement, anchor, offsets, and collision handling |+| `Popup` | Content, focus behavior, native attributes, and ref |+| `Arrow` | Optional arrow inside the popup |-Place content directly inside these popup parts. Their portal may move the rendered DOM to another container while preserving the component hierarchy and context. See [theming](/ui/theming#scope-an-override) for scoped portal containers.+Nest Popup inside Positioner and Positioner inside Portal. Place content inside Popup and add Arrow explicitly when needed. The portal may move the rendered DOM to another container while preserving the component hierarchy and context. See [theming](/ui/theming#scope-an-override) for scoped portal containers.-[Autocomplete](/ui/primitives/input/autocomplete) exposes separate `Portal`, `Positioner`, and `Popup` parts. Configure the destination and mounting on Portal, placement and collision handling on Positioner, and content width and native props on Popup. Their refs and render composition target their own elements. Autocomplete also preserves the installed upstream collection, grouping, grid, filtering, and status parts.+Each rendered part preserves its own native attributes, ref target, and render composition. [Autocomplete](/ui/primitives/input/autocomplete) also preserves the installed upstream collection, grouping, grid, filtering, and status parts.[Dialog](/ui/primitives/surfaces/dialog) and [AlertDialog](/ui/primitives/surfaces/alert-dialog) expose separate `Portal`, `Backdrop`, `Viewport` and `Popup` parts. Configure mounting and the destination on Portal, overlay appearance on Backdrop and Viewport, and content size and focus on Popup. Each part preserves its own native attributes, ref target and render composition. These dialog APIs are for standalone UI and the Twenty host. Front components use the [SDK host dialog API](/developers/extend/apps/layout/front-components#host-communication-api).@@ -92,13 +94,13 @@ Use a native button for button-like parts. On parts that expose `nativeButton`,Each page includes usage examples, interaction guidance, and a generated API reference.-| Family | Primitives |-| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| Accessibility | [VisuallyHidden](/ui/primitives/accessibility/visually-hidden) |-| Data display | [Avatar](/ui/primitives/data-display/avatar), [Chip](/ui/primitives/data-display/chip), [ColorSample](/ui/primitives/data-display/color-sample), [Badge](/ui/primitives/data-display/badge), [Status](/ui/primitives/data-display/status), [Tag](/ui/primitives/data-display/tag) |-| Feedback | [Banner](/ui/primitives/feedback/banner), [Loader](/ui/primitives/feedback/loader), [Progress](/ui/primitives/feedback/progress), [ProgressBar](/ui/primitives/feedback/progress-bar), [ProgressRing](/ui/primitives/feedback/progress-ring) |-| Forms | [Button](/ui/primitives/input/button), [ButtonGroup](/ui/primitives/input/button-group), [Checkbox](/ui/primitives/input/checkbox), [Field](/ui/primitives/input/field), [Input](/ui/primitives/input/input), [InputGroup](/ui/primitives/input/input-group), [Radio](/ui/primitives/input/radio), [RadioGroup](/ui/primitives/input/radio-group), [Select](/ui/primitives/input/select), [Slider](/ui/primitives/input/slider), [Switch](/ui/primitives/input/switch), [Textarea](/ui/primitives/input/textarea) |-| Layout | [Collapsible](/ui/primitives/layout/collapsible), [Separator](/ui/primitives/layout/separator), [ResizeHandle](/ui/primitives/layout/resize-handle), [DirectionProvider](/ui/primitives/layout/direction-provider) |-| Navigation | [ListItem](/ui/primitives/navigation/list-item), [Tabs](/ui/primitives/navigation/tabs) |-| Surfaces | [AlertDialog](/ui/primitives/surfaces/alert-dialog), [Card](/ui/primitives/surfaces/card), [Dialog](/ui/primitives/surfaces/dialog), [Popover](/ui/primitives/surfaces/popover), [Tooltip](/ui/primitives/surfaces/tooltip) |-| Typography | [Heading](/ui/primitives/typography/heading), [OverflowingTextWithTooltip](/ui/primitives/typography/overflowing-text-with-tooltip), [Text](/ui/primitives/typography/text) |+| Family | Primitives |+| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| Accessibility | [VisuallyHidden](/ui/primitives/accessibility/visually-hidden) |+| Data display | [Avatar](/ui/primitives/data-display/avatar), [Chip](/ui/primitives/data-display/chip), [ColorSample](/ui/primitives/data-display/color-sample), [Badge](/ui/primitives/data-display/badge), [Status](/ui/primitives/data-display/status), [Tag](/ui/primitives/data-display/tag) |+| Feedback | [Banner](/ui/primitives/feedback/banner), [Loader](/ui/primitives/feedback/loader), [Progress](/ui/primitives/feedback/progress), [ProgressBar](/ui/primitives/feedback/progress-bar), [ProgressRing](/ui/primitives/feedback/progress-ring), [Skeleton](/ui/primitives/feedback/skeleton) |+| Forms | [Autocomplete](/ui/primitives/input/autocomplete), [Button](/ui/primitives/input/button), [ButtonGroup](/ui/primitives/input/button-group), [Checkbox](/ui/primitives/input/checkbox), [Field](/ui/primitives/input/field), [Input](/ui/primitives/input/input), [InputGroup](/ui/primitives/input/input-group), [NumberField](/ui/primitives/input/number-field), [Radio](/ui/primitives/input/radio), [RadioGroup](/ui/primitives/input/radio-group), [Select](/ui/primitives/input/select), [Slider](/ui/primitives/input/slider), [Switch](/ui/primitives/input/switch), [Textarea](/ui/primitives/input/textarea) |+| Layout | [Collapsible](/ui/primitives/layout/collapsible), [Separator](/ui/primitives/layout/separator), [ResizeHandle](/ui/primitives/layout/resize-handle), [DirectionProvider](/ui/primitives/layout/direction-provider) |+| Navigation | [Breadcrumb](/ui/primitives/navigation/breadcrumb), [ListItem](/ui/primitives/navigation/list-item), [Tabs](/ui/primitives/navigation/tabs) |+| Surfaces | [AlertDialog](/ui/primitives/surfaces/alert-dialog), [Card](/ui/primitives/surfaces/card), [Dialog](/ui/primitives/surfaces/dialog), [Popover](/ui/primitives/surfaces/popover), [Tooltip](/ui/primitives/surfaces/tooltip) |+| Typography | [Heading](/ui/primitives/typography/heading), [OverflowingTextWithTooltip](/ui/primitives/typography/overflowing-text-with-tooltip), [OverflowingTextTooltipModeProvider](/ui/primitives/typography/overflowing-text-tooltip-mode-provider), [Shortcut](/ui/primitives/typography/shortcut), [Text](/ui/primitives/typography/text) |diff --git a/packages/twenty-docs/ui/ssr.mdx b/packages/twenty-docs/ui/ssr.mdxindex 3c970e5437d..2a8d34f933f 100644--- a/packages/twenty-docs/ui/ssr.mdx+++ b/packages/twenty-docs/ui/ssr.mdx@@ -3,7 +3,7 @@ title: Server renderingdescription: Understand Twenty UI's current server-rendering constraints and theme initialization.----Twenty UI is still in alpha and does not yet provide a package-wide server-rendering guarantee. Verify the specific entry points and components you use with your framework's server build and hydration flow.+Twenty UI does not yet provide a package-wide server-rendering guarantee. Verify the specific entry points and components you use with your framework's server build and hydration flow.## Load CSS through your frameworkdiff --git a/packages/twenty-docs/ui/testing.mdx b/packages/twenty-docs/ui/testing.mdxindex 77e95227a9d..1b8d0c70e90 100644--- a/packages/twenty-docs/ui/testing.mdx+++ b/packages/twenty-docs/ui/testing.mdx@@ -6,7 +6,7 @@ description: Present component previews and variant catalogs with twenty-ui/testimport ComponentStorybookLayoutReference from '/snippets/ui/generated/testing/component-storybook-layout.mdx';import GroupedCatalogReference from '/snippets/ui/generated/testing/grouped-catalog.mdx';-`twenty-ui/testing` exposes Storybook decorators and preview layout helpers. Configure styles and a [ThemeProvider](/ui/theming) in your Storybook preview before rendering themed components.+`twenty-ui/testing` exposes Storybook decorators, preview layout helpers, and media-query overrides. Configure styles and a [ThemeProvider](/ui/theming) in your Storybook preview before rendering themed components.## Story roles@@ -82,7 +82,8 @@ import { CatalogDecorator } from 'twenty-ui/testing';const meta = { component: Button };export default meta;-export const Catalog = {+export const VisualRegression = {+ tags: ['!autodocs'],args: { children: 'Save changes' },decorators: [CatalogDecorator],parameters: {@@ -116,6 +117,31 @@ export const ButtonPreview = () => (<ComponentStorybookLayoutReference />+## Media query overrides++Use `overrideMediaQueryMatches` in a story's `beforeEach` to force responsive hook results. Return its cleanup function to restore `window.matchMedia` after the story:++```tsx+import { Button } from 'twenty-ui/primitives/input';+import { overrideMediaQueryMatches } from 'twenty-ui/testing';+import { MOBILE_MEDIA_QUERY, useIsMobile } from 'twenty-ui/utilities';++const ResponsiveAction = () => {+ const isMobile = useIsMobile();++ return <Button fullWidth={isMobile}>Save changes</Button>;+};++const meta = { component: ResponsiveAction };+export default meta;++export const Mobile = {+ beforeEach: () => overrideMediaQueryMatches({ [MOBILE_MEDIA_QUERY]: true }),+};+```++Queries omitted from the override retain their native behavior. Override `TOUCH_DEVICE_MEDIA_QUERY` separately when an example depends on touch input. These overrides control `matchMedia` results; use a Storybook viewport to change CSS media queries and the preview width.+## Documentation previewsStories embedded in the documentation must be presentational and have no `play` function. Keep interaction tests in separate stories. Share explicit `args`, `render`, `decorators`, and `parameters` when needed, rather than spreading an interaction story into a preview. The documentation embed check rejects stories marked with Storybook's `play-fn` tag, including inherited play functions.diff --git a/packages/twenty-ui/README.md b/packages/twenty-ui/README.mdindex f173f951a97..ce9748ecce2 100644--- a/packages/twenty-ui/README.md+++ b/packages/twenty-ui/README.md@@ -8,11 +8,9 @@ Twenty's open-source React UI library provides foundational primitives, shared cRead the [twenty-ui documentation](https://docs.twenty.com/ui/getting-started) for setup, theming, and component guides.-> **Alpha:** `twenty-ui` is still in alpha. Its version number follows the Twenty SDK release cycle. APIs and component behavior may change between releases.-## Installation-For a standalone React application, install the library. React 19 is required.+For an existing React application, install the library. React 19 is required.```bashnpm install twenty-ui@@ -31,7 +29,7 @@ For Twenty apps, follow [Using Twenty UI components](https://docs.twenty.com/devFor a standalone React application, import the base styles once, pick a theme stylesheet, and wrap your app in `ThemeProvider`:```tsx-import { Button } from 'twenty-ui/primitives/input';+import { Field, Input } from 'twenty-ui/primitives/input';import { ThemeProvider } from 'twenty-ui/theme';import 'twenty-ui/style.css';@@ -39,43 +37,49 @@ import 'twenty-ui/theme-light.css';export const App = () => (<ThemeProvider colorScheme="light">- <Button>Click me</Button>+ <Field.Root>+ <Field.Label>Email</Field.Label>+ <Input name="email" type="email" placeholder="[email protected]" />+ <Field.Description>Use your work email address.</Field.Description>+ </Field.Root></ThemeProvider>);```The component stylesheet includes a global reset. Load it once at your application entry point.+Component styles and the reset use the `twenty-ui` cascade layer. Unlayered application styles override those layered rules. Put application resets in an earlier layer; see [style overrides](https://docs.twenty.com/ui/getting-started#override-styles) for the layer order and Tailwind setup.+## Entry points-Primitives provide foundational controls, including compound controls such as Select, Menu, and Dialog. Shared components compose them into presets such as `MainButton`, `LightButton`, `Dropdown`, and `Toaster`. Both layers receive data, labels, and callbacks from the application.+Primitives provide foundational controls, including compound controls such as Select, Popover, and Dialog. Shared components compose them into presets such as `MainButton`, `LightButton`, `Dropdown`, and `Toaster`. Both layers receive data, labels, and callbacks from the application.Prefer the matching public subpath for focused imports. The root entry point also re-exports primitives, shared components, icons, theme tokens, and utilities. Assets, testing helpers, and the optional code editor have separate entry points.-| Subpath | Contents |-| ------------------------------------ | --------------------------------------------------------------------- |-| `twenty-ui/assets` | Logos and static assets |-| `twenty-ui/components` | All shared component families except the optional editor |-| `twenty-ui/components/data-display` | Avatar groups, JSON trees, metrics, counters, and icon tiles |-| `twenty-ui/components/feedback` | Callouts, inline banners, and notifications |-| `twenty-ui/components/input` | Button presets, search and image inputs, and country/currency pickers |-| `twenty-ui/components/layout` | Sections, overflowing lists, and icon transitions |-| `twenty-ui/components/navigation` | Dropdowns, menu compositions, and tab actions |-| `twenty-ui/components/settings` | Settings rows and settings-specific compositions |-| `twenty-ui/components/code-editor` | Code editor, editor header, and editor theme helpers |-| `twenty-ui/icon` | Icon components and the icon provider |-| `twenty-ui/primitives` | All primitive families |-| `twenty-ui/primitives/accessibility` | Hidden elements and keyboard interaction helpers |-| `twenty-ui/primitives/data-display` | Avatars, chips, tags, color samples, and status indicators |-| `twenty-ui/primitives/feedback` | Banners, progress bars, and loaders |-| `twenty-ui/primitives/input` | Buttons and form controls |-| `twenty-ui/primitives/layout` | Expansion, separators, direction, and resizing |-| `twenty-ui/primitives/navigation` | Action links, list items, and tabs |-| `twenty-ui/primitives/surfaces` | Cards, dialogs, menus, popovers, and tooltips |-| `twenty-ui/primitives/typography` | Text and headings |-| `twenty-ui/testing` | Storybook and test decorators and helpers |-| `twenty-ui/theme` | Theme provider, hooks, types, and tokens |-| `twenty-ui/utilities` | Hooks and shared utilities |+| Subpath | Contents |+| ------------------------------------ | ------------------------------------------------------------------- |+| `twenty-ui/assets` | Logos and static assets |+| `twenty-ui/components` | All shared component families except the optional editor |+| `twenty-ui/components/data-display` | Avatar groups, command blocks, JSON trees, metrics, and icon tiles |+| `twenty-ui/components/feedback` | Callouts, inline banners, and notifications |+| `twenty-ui/components/input` | Button presets, specialized inputs, pickers, and segmented controls |+| `twenty-ui/components/layout` | Sections, overflowing lists, and icon transitions |+| `twenty-ui/components/navigation` | Dropdowns, menu compositions, and tab actions |+| `twenty-ui/components/settings` | Settings rows with labeled controls |+| `twenty-ui/components/code-editor` | Code editor, editor header, and editor theme helpers |+| `twenty-ui/icon` | Icon components and the icon provider |+| `twenty-ui/primitives` | All primitive families |+| `twenty-ui/primitives/accessibility` | Hidden elements and keyboard interaction helpers |+| `twenty-ui/primitives/data-display` | Avatars, badges, chips, tags, color samples, and status indicators |+| `twenty-ui/primitives/feedback` | Banners, progress indicators, loaders, and skeletons |+| `twenty-ui/primitives/input` | Buttons and form controls |+| `twenty-ui/primitives/layout` | Expansion, separators, direction, and resizing |+| `twenty-ui/primitives/navigation` | Breadcrumbs, list items, and tabs |+| `twenty-ui/primitives/surfaces` | Cards, dialogs, popovers, and tooltips |+| `twenty-ui/primitives/typography` | Text, headings, shortcuts, and overflowing text |+| `twenty-ui/testing` | Storybook and test decorators and helpers |+| `twenty-ui/theme` | Theme provider, hooks, types, and tokens |+| `twenty-ui/utilities` | Hooks and shared utilities |Import icons such as `IconCheck` from `twenty-ui/icon`. The dynamic icon provider includes the full catalog, so use it when icons need to be looked up at runtime.@@ -164,7 +168,7 @@ Explain state ownership before advanced behavior such as indeterminate selectionFor compound components, include an anatomy tree and identify required parts, optional parts, and elements supplied internally. Show supported composition with complete examples, use Twenty UI components for supporting controls, and explain how custom wrappers preserve props and refs. Use `text` fences for structural diagrams and `tsx` fences for runnable examples so the documentation checker validates the examples.-Run `npx nx check:ui twenty-docs` to validate generated references and documentation examples. Run `npx nx check:ui-stories twenty-docs` to validate preview titles, story references, the required first `Display`, and the absence of automated interactions in embedded stories.+Run `npx nx generate:ui twenty-docs` after changing documented component props or theme tokens, then review the generated data in `packages/twenty-ui/generated` and snippets in `packages/twenty-docs/snippets/ui/generated`. Run `npx nx check:ui twenty-docs` to validate generated references and documentation examples. Run `npx nx check:ui-stories twenty-docs` to validate preview titles, story references, the required first `Display`, and the absence of automated interactions in embedded stories.### Testing@@ -175,7 +179,7 @@ npx vitest run --root packages/twenty-ui --project unit <file>npx vitest run --root packages/twenty-ui --project storybook <file>```-The unit project runs in jsdom. The Storybook project runs in headless Chromium through Playwright, including story interactions and accessibility checks.+The unit project runs in jsdom. The Storybook project runs in headless Chromium through Playwright, including story interactions and accessibility checks. `npx nx storybook:test twenty-ui` also runs the `reduced-motion` browser project for reduced-motion checks.## Licensediff --git a/packages/twenty-ui/docs/label-ownership.md b/packages/twenty-ui/docs/label-ownership.mdindex e82ca5ded85..f2511c69786 100644--- a/packages/twenty-ui/docs/label-ownership.md+++ b/packages/twenty-ui/docs/label-ownership.md@@ -9,7 +9,6 @@ This covers production exports under components, primitives, and icons, includin| ListItemButton | Children, description, native accessible attributes, and `shortcutJoinLabel` (default `then`). Independent actions remain sibling controls. || Dropdown | Children name actions, options, titles, sections, empty states, and loading states. `Back` children default to `Back`. Search accepts native placeholder and accessible attributes. Close requires a caller-supplied accessible label and accepts native `aria-labelledby`. Item parts pass `shortcutJoinLabel` to ListItem. || CurrencyPicker | Caller-owned catalogue, option content, selected content, placeholders, and trigger and popup names. `searchLabel` defaults to `Search`; native `searchProps` can override its attributes. `emptyLabel` defaults to `No results`. The listbox inherits the registered Dropdown title or trigger name; `listLabel` names only that selection listbox. Native Options accessible labels stay on its own wrapper div. |-| Legacy menu compositions | Draggable, suggestion, and picker presets receive their text from callers; they add no English fallback. || Button, MainButton, LightButton | Children and native accessible attributes. Applications compose upcoming-feature labels with Badge. Loading preserves the supplied name and marks the button busy; its spinner is decorative. Button hints use the shared Shortcut presentation and remain decorative. `shortcutJoinLabel` supplies the sequence join label. || IconButton and LightIconButton | Caller-supplied accessible label and optional tooltip. Native `aria-labelledby` remains available and takes precedence. || SearchInput | Caller-owned placeholder, native accessible name and action labels. Referenced labels take precedence over explicit labels and placeholder fallback. |diff --git a/packages/twenty-ui/docs/theme.md b/packages/twenty-ui/docs/theme.mdindex e131edc3f44..969e119c4a4 100644--- a/packages/twenty-ui/docs/theme.md+++ b/packages/twenty-ui/docs/theme.md@@ -24,6 +24,6 @@ import { THEME_DARK, THEME_LIGHT, ThemeProvider } from 'twenty-ui/theme';The explicit `theme` supplies hook values and updates when the prop changes. Nested providers inherit it, and a provider with an explicit theme skips reading computed CSS values. Pass `theme` on a nested provider to replace the values for that subtree, for example when it switches color scheme. CSS classes, overrides, scaling, and portal scope retain their existing behavior. CSS overrides do not modify an explicitly supplied theme object. `THEME_LIGHT` and `THEME_DARK` keep their callable spacing helper; the provider resolves it into the same spacing entries that `useTheme()` returns from CSS variables, so `theme.spacing[3]` works with either source.-Raw contexts and their implementation types are private. Replace a direct context read with the corresponding hook, including separate hook calls when reading both the theme and color scheme. The React and Preact theme-token gallery stories demonstrate the public provider configuration used to replace the call-recorder and Granola context providers.+Raw contexts and their implementation types are private. Use the corresponding hook, including separate hook calls when reading both the theme and color scheme.-The separately versioned apps under `packages/twenty-apps` must upgrade their source and aligned UI/SDK dependencies together. Their current UI versions cannot use the new provider prop. This workspace migration leaves those packages unchanged.+In Twenty apps, keep `twenty-ui`, `twenty-sdk`, and `twenty-client-sdk` on the same version. The front component renderer supplies the workspace styles and theme. See the [front component guide](https://docs.twenty.com/developers/extend/apps/layout/front-components#using-twenty-ui-components) for sandbox setup and the [theming guide](https://docs.twenty.com/ui/theming) for standalone applications.