Barrel: registers ALL Anta custom elements (the convenience path).
Each element with browser behavior self-registers and imports its own CSS when loaded,
so re-exporting them here (which evaluates each module) registers the whole
set + injects every element's CSS. Importing this barrel for side effects —
import '@antadesign/anta/elements' — gives you everything.
To reduce bundle size, import only the element(s) you use:
import '@antadesign/anta/elements/a-tooltip' // registers a-tooltip + its CSS, nothing else
That granular path pulls in only that element's code and CSS, nothing else.
Entries for structural tags and composed layouts import only CSS and do not
register custom elements. Load their nested browser elements separately.
Must only be imported client-side — registration is guarded against missing
customElements (SSR), but there's no reason to load it server-side.
Barrel: registers ALL Anta custom elements (the convenience path).
Each element with browser behavior self-registers and imports its own CSS when loaded, so re-exporting them here (which evaluates each module) registers the whole set + injects every element's CSS. Importing this barrel for side effects —
import '@antadesign/anta/elements'— gives you everything.To reduce bundle size, import only the element(s) you use: import '@antadesign/anta/elements/a-tooltip' // registers a-tooltip + its CSS, nothing else That granular path pulls in only that element's code and CSS, nothing else. Entries for structural tags and composed layouts import only CSS and do not register custom elements. Load their nested browser elements separately.
Must only be imported client-side — registration is guarded against missing
customElements(SSR), but there's no reason to load it server-side.