@beehexa/ant-design-vue-tokens owns the reusable Ant Design Vue 4 adapter.
Use its typed ESM API and companion CSS, backed by @beehexa/design-tokens.
Frameworks are peers: ant-design-vue@^4.2.6 and vue@^3.3.0; neither is bundled.
Unreleased 0.0.0 packages use explicit local development references; only the authorized
release runner stamps real package versions. Do not copy a theme palette into an application.
Beehexa tokens are the source of truth. Ant Design Vue only reads them.
This page is the only place where the Beehexa foundations meet Ant Design Vue. The foundation pages stay the same whatever the product is built with.
Usage
<script setup lang="ts">
import { computed, watchEffect } from 'vue';
import { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';
import '@beehexa/design-tokens/css';
import '@beehexa/ant-design-vue-tokens/css';
const props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();
const rootFontSize = useAntDesignVueRootFontSize();
const theme = computed(() => createAntDesignVueTheme({
dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value
}));
watchEffect(() => {
if (typeof document === 'undefined') return;
document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';
document.documentElement.lang = props.locale;
});
</script>
<template>
<a-config-provider :theme="theme" :get-popup-container="getAntDesignVuePopupContainer">
<App />
</a-config-provider>
</template>
createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})
returns the native ThemeConfig. Recompute on theme/language/root-font changes;
each call returns a fresh object. locale selects source typography, not messages.
The setup-only source observer measures one inert1rem probe and cleans it up.
This keeps numeric native size/type/radius APIs aligned with scalable CSS units;
pixel-based borders and breakpoints do not scale. The pure factory reads no DOM.
Pass the appropriate AntD language pack through ConfigProvider.locale, and configure the
date library separately. Render native useMessage, useNotification and useModal
holders in a feedback host inside the sole root provider. Bind application notify facades
to those hook APIs; never use detached raw static feedback APIs. The factory sets
hashed: false because AntD4 contextual message/notification holders otherwise retain
stale hashes across theme/locale changes. Keep an existing notice open while switching
dark/Vietnamese to light/English; its typography and paint must follow the active theme.
Keep document data-theme and lang synchronized for teleported overlays. Import
companion CSS after application/framework styles. Use a native 16px root and 14px body;
numeric APIs resolve source rem at 16px. The pixel entrypoint is not the dashboard path.
Overlay ownership and bounded native content
Triggered popups use getAntDesignVuePopupContainer to stay inside their nearest native
Modal/Drawer or custom data-bh-overlay-owner host. Native Modal/Drawer roots remain
body-hosted for viewport geometry. Provider-bound modal facades default their invocation
zIndex through getAntDesignVueModalZIndex() while preserving explicit caller values;
this keeps keyboard/awaited confirmations above their live owner. Nested drawers use
getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex) as rootStyle.zIndex so
surface and mask move together; AntD4’s zIndex prop styles only the content wrapper.
Body-teleported fullscreen editors/images and fullscreen native Modals capture
getAntDesignVueFullscreenZIndex() before mounting their root. This uses
z-index.modal with above-owner ordering, not a separate fullscreen tier.
Mark custom roots only once they are active, avoiding self-counting. The seven
approved tiers have no fullscreen450 or readiness650 token; blocking loading
also uses z-index.modal. Keep owner-relative ordering below
z-index.tooltip and z-index.toast; reserve z-index.spotlight for tours.
Tour’s inline native default also requires its public
zIndex prop bound to z-index.spotlight.
Modal frames and Drawer content wrappers intentionally inherit pointer-events: none;
native content restores pointer entry only for its own subtree. The companion CSS also
restores pointer-events: auto on actual native popup roots portaled into either frame
(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover and
Tour). Frames remain pointer-transparent outside content and popups; native masks,
focus traps and dismissal remain unchanged. Do not relocate popups into a scrolling
body, change z-indices or add page overrides to solve this inherited-pointer gap.
The companion CSS provides opt-in native structural contracts, not application selectors:
bh-ant-fill-drawer/bh-ant-drawer-flush: bounded body, intrinsic header/footer, optional zero body padding; bind throughrootClassName. Keep the native body’s default automatic overflow rather than suppressing access when intrinsic controls or preserved pane minima exceed a short allocation. Do not repeat body flex/overflow styles at consumers.bh-ant-fill-modal: bind through nativewrapClassName, not the unsupported ModalrootClassName. The real fixed overlay allocates a token-inset bounded dialog; its content/focus wrapper and body fill around intrinsic header/footer. Width remains the caller’s native width, bounded by the available overlay. Use for interactive renderer inspection, not short confirmations. The renderer viewport alone owns below-minimum overflow; do not subtract guessed chrome heights.bh-ant-fill-tabs: bounded native wrappers and active pane. Nested tabs opt in separately;bh-ant-fill-tabs--scrollenables pane scrolling andbh-ant-tabs-mobile-insetadds the source mobile inset. Inactive panes stay hidden. Inner tabs inside that scrolling document can instead addbh-ant-fill-tabs--document: wrappers keep intrinsic content height and grow into adequate space, without clipping a renderer after long metadata exhausts the allocation. The outer native scroll pane owns vertical access; do not put both modifiers on the same root. Only the interactive renderer host receives--bh-layout-renderer-minimum-block-size, not outer panes or static fields.bh-ant-fill-spin/bh-ant-fill-card: carry an existing bounded host through native wrappers. Static document/tree/list content can remain nonshrinking and overflow-visible inside the native Card’s existing scroll owner. Do not pair that Card scroller with a second zero-height inner scroller when its header exhausts a tiny pane. This document composition adds no SDK-readable minimum to ordinary fields.bh-ant-fit-empty: only on a real native Empty inside an already allocated placeholder. Native illustration choice alone does not guarantee a fit in a short host. The opt-in removes outer and description paragraph margins (the parent owns its inset), bounds the root and lets the image row shrink before the intrinsic description/footer. The image keeps its native preferred height and removes its inline baseline strut; neither enlarged artwork nor paragraph margins consume a tiny host. It adds no readable-renderer minimum, palette, text typography, image replacement or overflow suppression. Preserve the parent’s one genuine scroll owner when even the intrinsic text/actions cannot fit. Ordinary document/list/table empties omit it and retain native defaults. The live native family below compares 2/4/12rem allocations, the simple illustration and the unchanged no-opt-in base.AntDesignVuePopupScope: only for retained renderers moved across native overlay owners. Wrap the existing subtree outside its Teleport and pass the existing HTMLElement root asowner; keep owner attributes on that actual root. Keep a real element as the consuming component’s root when callers usev-showor other element directives; put the scope inside that existing root, not in its place. A stable native popup holder moves with the owner because AntD4 caches the first portal container. Nested scopes inherit the enclosing target. Native ConfigProvider theme/locale, menus, focus and no-trigger body portals remain native; no editor/model/graph rekey or global popup z-index is involved. Opt-infeedback(defaultfalse) sends trigger-less containers to one stable element attached to the scope host instead, so anotification.useNotification()/message.useMessage()holder inside the scope follows the overlay owner into native fullscreen, even when it mounts before the host (a pendingSuspensedefers the host). Fullscreen capture handlers yield menu/listbox Escape viaisAntDesignVueMenuEvent(event)before closing their own overlay. Native Drawer portals can use the same stable host through the public scoped slot:<AntDesignVuePopupScope v-slot="{ getContainer }">with<a-drawer :get-container="getContainer">. HTML attributes on the scope belong to that actual portal host; conditionally exposerole="dialog",aria-labelandaria-modalonly while open when the native Drawer drops these attributes. Do not add a second dialog wrapper or mutate native DOM. AntD4 Flex also drops attributes other than class/style: use an existing real semantic element when a controlled ID, region name or tab stop must survive.- Independently selectable, disclosable choices compose actual Card title slots
with sibling native disclosure and selection Buttons plus a shortcut Tag.
Keep Card headers noninteractive; each Button owns only its own action.
AntD4 Collapse headers retain an ancestor
role="button"/tab stop even in icon-only mode, so do not nest independently actionable choices there. Native conditional Card body slots own expanded content; no private header role/keyboard patch or special choice-collapse CSS is needed. bh-ant-inspection-descriptions: source desktop label minimum and mobile stacked rows.bh-ant-data-table: generic pending/success/error row classes plus publiccustomCellmarkersdata-bh-cell-interaction="editable|readonly"anddata-bh-cell-state="changed". Native selection outranks operational row paint; changed cells keep diff paint on hover.bh-ant-table-nowrapis an independent horizontal-content opt-in. Addbh-ant-row-indicatorsfor aborder.width.accentinset danger marker on the first cell ofbh-ant-row-errorrows. This non-colour issue cue does not change column geometry, override selection or replace status text/icons.data-bh-tone="warning"on a native Badge root selectscolor.background.warning.bold/color.text.on-boldfor its count only. Native operational status dots keep their separate source semantics and circles.- Native Button
data-bh-target="touch"selectssize.target.touchas minimum width/height without repainting it.data-bh-target="responsive"applies the same target only for coarse pointers. Keep native type, size, disabled and keyboard semantics; no page-owned target sizing is needed. - Native Modal/Drawer close controls also use the root-scaled coarse-pointer
target. Closable Modal headers reserve the whole target height and center the
title beside it, so the close hit area never covers the first body control.
Modal titles reserve that native control’s lane only when it is present;
short
closable=falseconfirmations do not receive an empty title inset. - A native Flex span inside Button remains a flex layout rather than inheriting AntD4’s ordinary inline text-span display. Keep semantic title/description content separate through native composition, not another button wrapper.
- Pass the observed root to
tokenPixels(name, locale, rootFontSize)for actual Avatar/Image/Space/Row numeric props, including compact dock gaps. Omitting that argument intentionally returns nominal16px-root pixels; it does not read the browser’s current root. Child setup calls reuse the sole provider’s readonly measurement, not another observer. Keep CSS dimensions on scalable source roles.
Keep custom business data/slot meaning and host structure in the consumer, not
presentation recipes. Do not recreate native selectors through per-page
:deep(.ant-*), global overrides or priority escalation.
Token mapping
| Ant Design token | Beehexa token |
|---|---|
colorPrimary |
color.background.neutral.bold |
colorText |
color.text |
colorBorder |
color.border |
borderRadius |
radius.control (6 px) |
borderRadiusXS / borderRadiusSM |
radius.025 (2 px) / radius.control.small (4 px) |
borderRadiusLG / borderRadiusOuter |
radius.card (8 px) / radius.control (6 px) |
fontFamily |
font.family.sans |
Use the Radius roles, not one radius for every component:
| Component | Radius token |
|---|---|
| Button, Input, Select trigger, Radio button, Segmented, side navigation item | radius.control (6 px) |
| 24 px controls | radius.control.small (4 px) |
| Items in a dropdown or submenu popup | radius.item (4 px) |
| Tooltip, tag, badge count | radius.050 (4 px) |
| Checkbox | radius.025 (2 px) |
| Card, Alert, Collapse, Tabs and other in-page containers | radius.card (8 px) |
| Dropdown, submenu popup, Select popup, Popover, Message, Notification | radius.overlay (8 px) |
| Modal, Drawer | radius.modal (12 px) |
| Avatar (circle), Switch, chip | radius.pill |
| Full-width table, joined Search edges, fullscreen surface | radius.0 |
Groups with 4 px padding use 8 px outside; groups with 8 px padding use 12 px
outside. The adapter pins these component aliases and the companion CSS covers
the badge, Switch, Segmented and Drawer cases that have no theme input.
Consumers must remove competing corner overrides, not add .ant-* radius patches.
Explicit Button shape="circle" / shape="round" props keep their native sizing
and the radius.control corner. They are not avatar, Switch or chip roles.
The adapter also pins semantic hover/pressed/disabled/link/status/selection/focus roles instead
of allowing a framework-generated blue palette to leak through. Inputs, selects, checkboxes
and radios use color.border.bold while cards/tables use color.border. Layout header and
sider sit on color.surface.page, separated from the content by a color.border line; the mobile
navigation drawer is a drawer on color.surface.overlay. There is no separate shell palette or nested isolated
theme. Use font.body.default for table data, font.label.small for headers/tags,
font.heading.medium for modal titles and font.heading.small for drawer titles.
Native Menu icons use the native icon slot, source icon box and a space.050
title gap. Do not rebuild the icon/label row in a Space with a page-specific gap.
Title text uses font.label.default rather than the row-height line box, keeping
Vietnamese labels and adjacent title/tag content vertically aligned.
Native Tree content keeps its icon and shrinkable title centered as one row.
If a custom title already includes its glyphs, leave showIcon off; AntD4 otherwise
reserves another empty icon box. Native selection, expansion and keyboard ownership
are unchanged. Apply required content roles to a semantic host, not AntD4 Flex.
Ant Design Vue 4 component contracts
- Table reads
colorFillAlter,colorTextHeading,controlItemBgActiveandcontrolItemBgActiveHover. AntD5 names such asheaderBgandheaderColorare ignored by AntD Vue 4.2.6 and must not be used. - Switch reads OFF tracks from
colorTextQuaternary/colorTextTertiary, ON tracks fromcolorPrimary/colorPrimaryHover, its shared thumb fromcolorWhite, both labels fromcolorTextLightSolid, and disabled/loading opacity fromopacityLoading. These are component-scoped mappings, not changes to global primary/text colors. AntD5trackBg/handleBg-style names are not the AntD4 state API. - Menu reads
colorItem*,radiusItem,radiusSubMenuItemandcolorActiveBar*. Explicittheme="dark"menus receive the same source roles. Selection has a visible bar, not a heavier label that shifts its neighbours or merely a changed fill. - Form controls share source outline/focus/disabled roles. Validation retains danger/warning text/icons and native state semantics. Do not replace meaningful input borders with divider hairlines.
- Tag status presets are
success,processing,warning,error; default is neutral. They use source foreground and outline pairs. Arbitrary hue presets are not status names. Badge counts are neutral; error/processing status dots retain their semantics. - Tooltip and Message use the inverse surface/text pair. Modal/Drawer content uses surface, scrim and overlay elevation. Progress is neutral by default and semantic on success/error.
Native Switch contract
Use the native Switch inside the existing root ConfigProvider. enabled,
saving, unavailable and locale below are application state; do not create a
nested provider or local theme just for schedules, permissions or status toggles.
<a-switch
v-model:checked="enabled"
:loading="saving"
:disabled="unavailable"
:checked-children="locale === 'vi' ? 'Bật' : 'On'"
:un-checked-children="locale === 'vi' ? 'Tắt' : 'Off'"
:aria-label="settingLabel"
/>
switch.on.* is neutral-bold, never business-success green. switch.off.* has a
strong thumb, readable label and meaningful boundary so enabled OFF cannot be
mistaken for disabled. The source defines paired track/thumb/label/border roles
for normal, hover, pressed, focus, loading and disabled; normal and size="small"
use the same light/dark palette and existing native geometry. Native thumb
position, aria-checked, labels and the separate focus ring provide non-color
cues. Short EN/VI state labels use the existing source typography, not a patched
height or a consumer font declaration.
AntD4 supports only one shared thumb/label pair, no pressed track paint and no
explicit disabled color pairs. Its spinner foreground and translucent green
thumb shadow are also not configurable as paired parts. The companion CSS closes
those evidenced gaps, while normal/hover track paint stays in native aliases.
opacityLoading: 1 removes native loading/disabled dimming. Disabled ON uses
color.background.neutral.bold.pressed with inverse thumb/label; disabled OFF uses
the disabled track, subtle thumb/label and bold boundary. Native checked position,
disabled behavior and cursor remain unchanged; both values must be readable.
Loading retains the current normal checked pair and a high-contrast native spinner, including when both
loading and disabled props are set. It never predicts or changes the saved value.
Keep native controlled binding, change callback and keyboard operation. The
native button is disabled during loading; pending/disabled activation must not
save twice or update checked state. Business save operations and errors remain
application-owned. Test both sizes, OFF/ON loading and disabled states, EN/VI labels,
callback counts and a delayed controlled save. No consumer .ant-switch patch,
palette literal or custom Switch implementation is necessary.
Contrast, links and native Segmented
The Source contrast and link rules are authoritative for every text/label/tag and effective background in both themes. Read-only IDs, titles, dependency names and status values must not use disabled roles. Use paired semantic status text/fills, not arbitrary hue tags or inverse text over subtle fills. Normal text requires 4.5:1, large text 3:1 and meaningful boundaries 3:1 at rest, hover, pressed and selected states, including composites.
Anchors, Typography links, link Buttons and prose links have no underline by
default, including hover. .bh-link-underline is the sole explicit opt-in.
Keep color.link/color.link.hover and Source focus rings; never mute a link
into metadata. Ordinary prose/document links use Source semibold as a persistent
non-colour cue; explicitly opt an authored link into underlining when its
surrounding prose is already semibold. Navigation and native link Buttons keep
their existing component typography.
Use native Segmented through this same root provider and companion CSS. Source
removes the opaque ::after label overlay and applies paired backgrounds directly
to stable item hover/pressed/selected-hover states. While AntD’s native thumb is
present during motion, these opaque item fills are suppressed so they cannot
cover it. Native selection and keyboard behavior remain unchanged.
Never add consumer state paint or synthetic selected items.
The selected item and moving thumb use the native boxShadow alias for an inset
border.width.default / color.border.bold boundary that identifies selection
persistently without covering the label.
The live native matrix
includes all sizes, enabled/disabled and selected/unselected items for hover,
press, click and keyboard verification. Follow the
spacing, truncation and motion invariants;
hover must never obscure text or be the only way to expose information.
Keep the size-specific native Segmented label line-height; do not apply a
font shorthand that resets it. The default toolbar Input, Segmented and Button
must share their native control center, including wrapped toolbar groups.
For metric rows, use headerless native Cards with bh-ant-subgrid-card in a
parent grid with two shared automatic rows. Compose label/icon first and
value/actions second, retaining native padding, source gaps and wrapping.
Use bh-icon-slot with data-bh-size="responsive" only for passive indicators
beside small responsive icon Buttons; it supplies matching geometry, not an action.
Do not position labels or icons with manual pixel offsets to compensate for a
native line-box or shared-row defect.
Companion CSS and structural classes
Use component tokens first. The package CSS fills actual AntD4 gaps: semantic label/header/title typography, hard-coded submenu fill, selected bar colors, keyboard focus offsets, safe areas, responsive Tour placement, reduced motion and neutral Badge count without recoloring error dots. Application selectors and palette overrides belong neither in that CSS nor in a dashboard theme. Consumers retain genuine portal layout and scrolling mechanics only. Framework paint and typography fixes belong to the package, not duplicated consumer overrides.
Bordered Descriptions clip cell backgrounds inside the native rounded frame instead of
painting over its left corners. Header-only Cards omit the orphan header/body divider
and retain all four rounded corners; Cards with body/cover/actions keep native separation.
Bordered hoverable Cards keep color.border.bold plus elevation.shadow.raised on
hover and keyboard focus, rather than AntD4’s transparent hover border. Focus also
uses the standard outline/offset; the application still owns keyboard action semantics.
These framework fixes are automatic, not per-page overrides.
Native Search, Input addon buttons, compact InputGroup and horizontal Space.Compact
share an intrinsic flex-stretched row: input and action top/bottom edges stay aligned,
adjacent borders overlap once, exposed corners use radius.control and touching corners stay zero.
Source font roles are retained. Small Vietnamese fields/actions grow together to 26 px;
do not clip accents or shrink type to force 24 px. Default actions share field
error/warning/disabled borders; primary/danger actions retain their semantic roles.
Clear icons keep an icon-sized line box so they cannot inflate affix wrappers.
bh-ant-tag-large on a Tag selects the source large label (24px minimum, 8px inline padding);
the default is 20px minimum/6px. Both grow for Vietnamese line boxes rather than clipping marks.
bh-ant-tree-fill on an actual Tree fills a bounded flex host, including below an
intrinsic summary. Root and list establish the min-height-zero chain; only the
native list holder scrolls, preserving its keyboard scroll target. Do not pass a
fixed height or add another wrapping scroller. Intrinsic trees omit this opt-in.
Keyboard-navigation consumers bind the native activeKey / onActiveChange pair:
state ref<TreeProps['activeKey']>(), then :active-key="activeKey"
and @active-change="activeKey = $event ?? undefined". AntD 4.2’s uncontrolled
active-change path does not retain the requested node; a CSS fill opt-in cannot
supply that navigation state.
For data inspection, bind width="var(--bh-ant-overlay-width)" and apply
bh-ant-inspection-modal or Drawer rootClassName="bh-ant-inspection-drawer".
Add bh-ant-inspection-modal--wide / bh-ant-inspection-drawer--wide only for an explicit
content-heavy variant. The variable selects layout.overlay.default / .wide, and .mobile
below breakpoint.lg. Short confirmations and navigation drawers retain their own widths.
The Modal’s max-width: 100% caps that width to its native scrolling wrap, which
excludes the vertical scrollbar. Do not replace the cap with 100vw or hide
horizontal overflow: the mobile width token may fill the viewport, but the actual
Modal must still fit its available containing block.
Fullscreen modes are Modal wrapClassName="full-screen" and Drawer
rootClassName="fullscreen"; AntD4 Modal has no rootClassName prop. These preserve
bounded scroll mechanics, not decoration.
Native field names
Bind a real <label for="…"> to the native Select’s explicit id, or use the
corresponding native Form Item label association. In AntD4, an aria-label on
Select can name its outer generic wrapper while leaving the actual combobox
unnamed. Check the combobox’s accessible name and native label activation, not
just an attribute on a component root. Use Vue useId() plus a row identity for
repeated fields; do not add a wrapper or an attribute-copying observer.
Verify the actual framework
Exercise light/dark × English/Vietnamese with the real CSS imported: buttons and validated inputs/selects, ordinary/selected/hovered table row checkboxes, sorting/filter portals, expanded/collapsed/horizontal and submenu navigation, form help/error, Tooltip/Message, Modal/Drawer and default/wide/fullscreen inspection at 1023/1024px. Check keyboard focus, touch hit areas, reduced motion, narrow Tour and focus return. Use ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI in controls, tags and rows. Compilation alone does not establish those rendering/interaction outcomes.
Spacing
Ant Design Vue sizes come from sizeUnit and sizeStep. Keep both at 4, so size is 16 px. The theme then sets each size from a spacing token.
| Beehexa token | Value | Ant Design Vue tokens |
|---|---|---|
space.050 |
4 px | sizeXXS, paddingXXS, marginXXS |
space.100 |
8 px | sizeXS, paddingXS, marginXS |
space.150 |
12 px | sizeSM, paddingSM, marginSM |
space.200 |
16 px | size, sizeMS, padding, margin |
space.250 |
20 px | sizeMD, paddingMD, marginMD |
space.300 |
24 px | sizeLG, paddingLG, marginLG |
space.400 |
32 px | sizeXL, paddingXL, marginXL |
space.600 |
48 px | sizeXXL, marginXXL |
space.0, space.025, space.075, space.500, space.800 and space.1000 have no Ant Design Vue token. Use their CSS variables in your own styles.
Props that take a number, such as size on a-space and gutter on a-row, take pixels. Use a value from the scale: <a-space :size="8">.
Control height
| Beehexa token | Height | Ant Design Vue token | Component prop |
|---|---|---|---|
size.control.small |
24 px | controlHeightSM |
size="small" |
size.control.default |
32 px | controlHeight |
None |
size.control.large |
40 px | controlHeightLG |
size="large" |
These are Ant Design Vue’s own heights. The theme still sets each one from its size token, so a change to the token reaches the components. See Size and density.
Breakpoints
Override the screen* tokens with the Beehexa breakpoints. The default Ant Design Vue values are different (576, 992, 1200 and 1600 px).
The Min and Max tokens are computed from the defaults, not from your overrides. Set them too: each Max is the next breakpoint minus 1.
| Beehexa | Value | Ant Design Vue tokens |
|---|---|---|
breakpoint.xs |
0 | screenXSMax: 767 |
breakpoint.md |
768 px | screenSM, screenSMMin, screenMD, screenMDMin: 768; screenSMMax, screenMDMax: 1023 |
breakpoint.lg |
1024 px | screenLG, screenLGMin: 1024; screenLGMax: 1439 |
breakpoint.xl |
1440 px | screenXL, screenXLMin, screenXXL, screenXXLMin: 1440 |
Ant Design Vue has six breakpoints and Beehexa has four, so sm switches with md, and xxl with xl. Use the xs, md, lg and xl props of a-col.
The props of a-col and the responsive gutter of a-row then switch at the Beehexa widths. Do not use xxxl: its media query is malformed in Ant Design Vue 4.2.6 and never matches.
Grid
Ant Design Vue divides a row into 24 parts. The Beehexa grid has 4, 8 or 12 columns, and each one fits 24 exactly.
| Beehexa grid | Window | a-col span |
|---|---|---|
| 4 columns | Below 768 px | Beehexa span × 6 |
| 8 columns | 768 to 1023 px | Beehexa span × 3 |
| 12 columns | 1024 px and up | Beehexa span × 2 |
| Layout | Beehexa spans (4 / 8 / 12 / 12) | Props of each a-col |
|---|---|---|
| Cards, 1 to 4 a row | 4 / 4 / 4 / 3 | :xs="24" :md="12" :lg="8" :xl="6" |
| Main panel | 4 / 8 / 8 / 9 | :xs="24" :lg="16" :xl="18" |
| Side panel | 4 / 8 / 4 / 3 | :xs="24" :lg="8" :xl="6" |
| Summary tile | 2 / 2 / 3 / 2 | :xs="12" :md="6" :xl="4" |
Ant Design Vue rows have no gutter by default. Set it from the spacing tokens, and set the page margin on the content area.
<a-row :gutter="[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]">
<a-col :xs="24" :md="12" :lg="8" :xl="6">
<OrderSummary />
</a-col>
</a-row>
App frame
| Region | Beehexa | Ant Design Vue |
|---|---|---|
| Header | 48 px | <a-layout-header style="height: 48px; line-height: 48px"> |
| Side navigation, open | 280 px | <a-layout-sider :width="280"> |
| Side navigation, collapsed | 64 px | <a-layout-sider :collapsed-width="64"> |
The header is 64 px by default and has no token for its height, so set it in the header’s style.
The breakpoint prop of a-layout-sider uses fixed widths that ignore the screen* tokens. Do not use it. Set collapsed from your own media query and the user’s choice: open from 1024 px, collapsed to the rail when the user asks, and the choice remembered. Below 1024 px, hide the sider and show the menu in a-drawer.
See Layout for the frame.
Interactive table rows
Bind data-bh-interactive="true" through customRow only when the complete row
already has an activation handler. The source companion owns the pointer cursor;
native selection keys/classes retain their selection recipe. Preserve accessible
row actions, keyboard behavior and actual record activation rather than replacing
selection with a custom outline.
Native composition and optional variants
Use the real native component. These opt-ins do not authorize a div-based replacement, a skin-only wrapper, or copying Card/Button geometry into the app.
- Native Card’s
hoverableprop remains optional.data-bh-selected="true"adds a selected fill and independent inset cue; omitting it restores the base. In a composed selectable Card,data-bh-card-action="primary"on the primary native text Button retainsaria-pressedand keyboard focus without duplicating the outer Card’s selected frame. Independent actions retain ordinary Button paint. - Reuse
bh-data-accentwith an existing semanticdata-bh-status,data-bh-band,data-bh-metric,data-bh-job-typeordata-bh-priorityfor an optional leading edge on a real Card. It adds no selection or hover behavior. A status/category edge survives selection; keyboard focus remains a separate outside outline. Bind the discriminator appropriate to that mark rather than conflating status with categorical identity. Labels are still mandatory. data-bh-layout="content"on a real Button allows a multiline composed label: auto height, normal wrapping, start alignment and the source default-control minimum height. Native props, padding and keyboard activation remain native. Use ordinary Button size/block props when they suffice.bh-ant-shell-regionremoves native Header/Footer padding only when the region already contains the composed app header/footer. It does not change native height, paint or the surrounding responsive page-region layout.bh-card-linkon a real navigation anchor wrapping Card removes competing link paint/underline and supplies source keyboard focus, not Card skin.bh-ant-card-action-rowuses the native Card title/extra slots with a shrinkable leading track and reserved trailing action. Source head inset stays consistent across Card sizes; the real link remains a flexible inline title/metadata row. See application content.bh-ant-metric-tooltipon a native Tooltip overlay andbh-metric-tooltipon its semantic title-slot host separate date/header, metric definition list and explanation. The token-backed readable width is capped by the viewport; native popup placement, theme, keyboard and touch behavior stay with the actual owner.
Business components may own data, state, behavior and meaningful composition of these primitives. Inventory and remove redundant replacement components and every obsolete caller/import/export. Generated rich content must mount real native enhancement controls when the host framework permits it; a producer stylesheet alone is not evidence of missing native capability.
Operational and composed native content
Steps[data-bh-operational="true"] uses success/info/danger/subtle for native
finish/process/error/wait states. It leaves categorical navigation Steps unchanged.
An actual Step’s data-bh-skipped="true" adds a dashed tail in either orientation;
the caller retains ordering and the relationship’s meaning. Custom icon slots do
not require rebuilding the Steps primitive.
Result[data-bh-layout="step"] retains a composed report’s icon-and-title header
row, with subtitle/content and extra/actions below at full width. It only changes
native layout/padding; status paint and native slots remain native.
The native Tree title data-bh-highlighted="true" is a temporary locator cue,
not a selected key or keyboard focus. Native selected/disabled treenodes suppress
it; the source outline does not change title geometry.
Use bh-partner-logo-image on a real Image for connector/brand assets.
Bind only the Source partner-image height and width="auto"; native Image plus
the adapter preserves its intrinsic aspect ratio without a square frame or crop.
Actual identity Avatars stay native. Do not use brand hue as operational status.
Native Image preview
The official Image zIndexPopupBase and zIndexPopup tokens use z-index.modal.
That alone cannot clear an owner nested above it: AntD4.2.6 Preview drops
both declared Dialog zIndex and wrapProps. The setup composable
useNativeImagePreviewContainer(labelGetter) from
@beehexa/ant-design-vue-tokens/image owns the official lazy body portal:
pass its getter to native preview.getContainer. It names the real native
dialog, reacts to locale changes and captures a layer above live owners on
each opening, excluding its own previous layer. A closed portal is not an
overlay owner. Its observer/container are disposed on unmount. Native Image
still owns zoom/pan, keyboard close and focus return; there is no custom viewer.
bh-ant-card-flush opts a real Card body out of inset only for an edge-to-edge
embedded editor, canvas or composed pane. Ordinary cards retain native padding.
Reuse bh-ant-fill-card and bh-ant-fill-spin for existing bounded flex hosts;
do not create parallel fill aliases or restore private consumer selectors.
The flush Card clips embedded paint to its native rounded frame. A direct
browser iframe child has its UA border removed to avoid a second frame;
sandbox/srcdoc and embedded-document behavior remain browser-owned.
semanticTableComponents from @beehexa/ant-design-vue-tokens/table extends
the real Table’s public components API. A column’s customCell may return
{ scope: 'row' }; its body cell becomes a semantic th, forwarding the native
attributes and slot. Other cells remain td. AntD4 has no row-scope column prop
and its body-cell CSS only targets td, so the source companion supplies the
matching row-header size/border/hover/selection recipe for this actual HTML
semantics gap. Native columns, rows and Summary remain native.
An actual native ListItem may opt into data-bh-interactive="true" for a rich
activation row when no narrower native control meets its content contract.
The opt-in supplies hover/pointer/focus only; the consumer supplies a real action,
keyboard activation and accessible role. Do not nest competing interactive targets.
Connector and partner brands share content.partner-logo.image-size as their
rendered height, not a width cap. Keep natural width; wrap rows when needed.
Semantic icon-height roles likewise preserve proportional width and hit targets.
Native Table already styles tfoot > tr > th geometry at each size; the companion
adds only its missing Summary row-header border and semantic weight/alignment.
a-typography-link[data-bh-target="responsive"] uses the source minimum24px
target, increasing to44px only on coarse pointers; it adds no link skin.
Flush Cards clip embedded paint to their actual rounded frame. Native Drawer
footers retain their canonical inset or the device’s safe-area inset, whichever
is larger. Spin[data-bh-mode="nonblocking"] removes the native veil/pointer
block only for progressive content that remains inspectable; omit it for actual
blocking work such as export. This does not change spinner timing or graph data.
Read-only segmented native Progress
For “Step 3 of 7” feedback, use the real native Progress with its actual
steps and percent. This is not navigation: do not substitute Steps,
Segmented, a fabricated row of marks, or another progress engine.
AntD4 size="small" deliberately renders each step as a 2 × 8px vertical
fragment. Its native [width, height] tuple means per-segment geometry.
The source helper resolves content.step-progress.segment-width and
segment-height to16 ×4px at root16 and20 ×5px at root20. Bind it reactively:
<script setup lang="ts">
import { computed } from 'vue'
import {
getAntDesignVueStepProgressSize,
useAntDesignVueRootFontSize
} from '@beehexa/ant-design-vue-tokens'
import { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'
const props = defineProps<{ total: number; index: number; dark: boolean }>()
const rootFontSize = useAntDesignVueRootFontSize()
const progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))
</script>
<template>
<a-space align="center" wrap>
<span>Step {{ props.index }} of {{ props.total }}</span>
<a-progress
class="bh-ant-step-progress"
:steps="props.total"
:percent="props.index / props.total * 100"
:size="progressSize"
status="normal"
:stroke-color="getStatusColor('info', 'border', { dark: props.dark })"
:show-info="false"
aria-hidden="true"
/>
</a-space>
</template>
The feature owns the real positive total, current index, status text and business transitions. The helper supplies geometry only; native Progress owns the rendered count and active marks. Hide the redundant bar from assistive technology only when adjacent text already conveys the same progress.
For current-position feedback, explicitly set status="normal": reaching the
last authored group does not mean the operation succeeded. Render failure or
completion status only from actual workflow evidence, independently of the
index. A one-group workflow still has one real mark; an absent/zero total has no
bar. Do not manufacture a denominator from screenshot geometry or API-step count.
bh-ant-step-progress opts that native root into intrinsic inline width,
zero native outer margins, the source content.step-progress.gap (4px at
root16), and wrapping without a trailing item margin. CSS does not replace
the native size API or set per-mark width/height. The bar follows the status
on a wide row and wraps within the available width on mobile.
Omit the class and helper to retain the native base. Ordinary percentage, upload and countdown progress do not opt in. The shared live matrix below includes a real native no-opt-in comparison, editable total and first/middle/ final controls; check both root16 and root20, light/dark and narrow widths.
Thin navigation Progress
For route-loading feedback use real native Progress with bh-ant-navigation-progress,
showInfo=false, status="normal", strokeLinecap="square" and its native size tuple.
Use border.width.focused for the thin line and color.brand.yellow for its optional
brand stroke. The application owns fixed viewport positioning at top: 0, width and
its layer from the seven z-index tokens; the adapter removes AntD’s inline baseline gap and outer margins,
so the actual ink begins at the allocated top edge without negative offsets.
Progress reflects completed navigation milestones, not invented network percentages.
Keep the previous page while guards and route chunks resolve, advance to100%, and await
the actual finite native width transition before committing the new page. Cancellation,
errors and superseding navigation must clear their own progress without clearing a newer
request. The source width transition uses motion.duration.default and
motion.easing.linear; reduced motion removes it. Keep a named progressbar with actual
milestone values, and never use a page-covering scrim just to load a route.
One native control family, distinct roles
Use native default Button for compact bordered utility triggers (including
language and theme), with the same native size as adjacent page controls.
Use the public #icon slot and one label child; icon-only Buttons still need
an accessible name. Do not disguise type="text" globally as a default Button.
A frameless account/avatar menu legitimately uses type="text", a real Avatar
and native Space: center it in the row rather than inventing a shell skin.
Button small/default/large use source control heights24/32/40px at the nominal
root; typography is label-small for small and label-default otherwise.
Button/Input/Select and side navigation items use radius.control; Select popups and menus use radius.overlay.
The numeric theme/root observer and rem CSS scale together.
AntD4 only inserts margin for .anticon siblings, not Lucide SVGs in #icon;
the source supplies one space100 flex gap for all real Buttons and removes
the competing native/loading-icon margin. No shell-specific class is needed.
Native default/primary/text/link, disabled/loading, hover/pressed and keyboard
focus remain distinct. data-bh-target="responsive" adds touch minimums only
on coarse pointers. Open Dropdown/Menu state is not Button selection; keep
aria-expanded, menu keyboard behavior and focus return in the actual feature.
The primary neutral-bold/inverse pair is intentional: graphite in light mode, light graphite with dark text in dark mode. A pale dark-mode Continue action is not a reason to recolor every primary or text Button blue. Link actions retain the source link palette; default utility actions remain bordered.
| Native variant | Source role and state contract |
|---|---|
| Default / dashed | Surface, text and border; neutral-subtle hover/pressed fill. Dashed retains its native dashed outline. |
| Primary | Neutral-bold/inverse pair and its own bold hover/pressed roles. |
| Danger primary | Danger-bold/on-bold pair, including hover/pressed. |
| Danger default / dashed / text / ghost | Readable danger text; outlined variants retain danger borders. Available non-link variants use danger-subtle hover/pressed fill. Ghost starts transparent, never with the solid on-bold label. |
| Link / text | Distinct link/frameless roles, not a disguised default Button. |
| Ghost | Native transparent outlined variant with a role-appropriate foreground and host context; not a solid primary. |
| Disabled / loading | Native blocking behavior and disabled aliases remain authoritative, including disabled anchor Buttons. Loading does not fade an otherwise readable source pair. |
AntD4 paints a resting lower shadow from controlOutline on primary,
controlTmpOutline on default, and colorErrorOutline on danger-primary.
Those names are not exclusively keyboard-focus inputs. Reusing the global
blue focus alias there produces a stranded blue stripe even after all
animations finish. The source scopes these three Button component aliases
to transparent; it does not clear the global focus role or set its width
to zero.
Native Button keyboard focus instead reads colorPrimaryBorder and
lineWidthBold. Its component overrides use source focus color/width.
The companion’s enabled :focus-visible rule supplies the independent,
gapped source outline/offset. Default/dashed state fills and the separate
danger text/on-bold pairs are the remaining native-token gaps; source CSS
handles only those cases, excluding disabled controls and genuine selection.
Apps must not add a local shadow/border reset or a focus suppression.
The compact native dock uses bh-control-group and data-bh-variant="dock"
on Space. Its neutral text-action paint excludes danger, ghost, real selected
toggles, loading controls and disabled anchors, so the same role/state contracts
still apply inside the dock. Open actions may use aria-expanded; genuine
toggles use aria-pressed and retain the selected fill plus structural indicator.
AntD4 href Buttons render anchors with a native disabled attribute, not the
:disabled pseudo-class or a generated disabled class. Native enabled hover/active
selectors still match those anchors. The companion recognises [disabled] and
aria-disabled="true" with sufficient native-state specificity: disabled text
stays disabled; fill/border roles match the native non-href Button for solid,
text/link, ghost and danger/ghost combinations. Set the native disabled prop, supply
aria-disabled="true" and tabindex="-1" for an unavailable href Button; native
AntD click handling blocks its navigation. ARIA or CSS alone never disables a
link. Do not manufacture AntD classes or replace genuine links with pointer-only
handlers.
Live native state and progress matrix
Use the site theme/language controls and browser root font preference. Change Button size, hover/hold a press, Tab/Enter/Space through available actions, and inspect actual activation counts. Loading/disabled Buttons and genuine disabled href variants must not activate, including inside the compact dock. Toggle its selected action and check danger hover/pressed without neutral repaint. The long native Card title wraps independently of its extra action on mobile. Switch examples include loading and disabled together; loading retains checked paint and the spinner while callbacks stay blocked. Progress uses the same actual count/index for its opt-in and no-opt-in renderers.
Native mobile composition and bounded content
The adapter stretches joined Input/Search/compact-group fields and their actions
as one row, including validation, disabled states and coarse-pointer targets.
Icon-only Buttons keep their native size proportions; on coarse pointers both
axes reach size.target.touch. Content-layout Buttons retain multiline text
without overriding explicit or responsive touch minimums.
Below breakpoint.md, every native Card header/meta title wraps, including
descendant Typography ellipsis, Tags and Space. This is global readable content,
not an optional consumer override. Header extras remain available. Standard
Timeline dots, tails and custom dots align to the first content line; wrapped
event content stays in the native timeline column. Label/alternate/right
timelines retain their distinct native alignment.
For event rows with inline native small Buttons, bind data-bh-layout="actions"
on the Timeline and center the native Flex row. This shares the first line’s
allocation with size.control.small (or size.target.touch on coarse pointers),
so the dot/tail do not stay above text beside a taller touch action. Plain text
timelines keep their normal source line box. AntD4 Timeline exposes no component
sizing token; this bounded composition does not change label/right/alternate modes.
AntD4 Flex does not forward arbitrary role, aria-*, data-* or DOM listeners.
Do not put required semantics, source opt-ins or keyboard handlers on it. Use
native Space/Typography where appropriate, or retain a real semantic host with
minimal structural flex/grid CSS. Do not introduce a forwarding wrapper.
Use bh-content-toolbar and bh-content-toolbar__group on actual intrinsic
text-editor toolbar hosts; the source owns spacing, padding, wrapping and mobile
control minimums. Graph navigation instead uses the compact Source dock floating
inside its drawing viewport, default lower-left, never a full-width header band.
Follow the canvas dock contract
without copying graph-only actions to text editors. These are shared recipes,
not page-specific skins. Keep hosts and flex children shrinkable with min-width: 0.
Bind bh-ant-fill-spin through Spin’s wrapperClassName, not its class:
the nested-loading wrapper carries the bounded height. Drawer fill/flush modes
traverse the native content-wrapper/content/wrapper-body chain; header/footer
remain intrinsic and the body owns the remaining space. Tabs fill only their
own active pane. Consumers supply the actual bounded parent, not guessed
viewport-minus-header heights. Monaco/Mermaid observe that host’s dimensions
without replacing the editor model or resetting existing chart pan/zoom.