更新日志
最新更新与功能特性。查看每个版本有哪些变化。
次要变更
- 8b2d6a0
Add radio card appearance via
appearance="card"prop on Radio.Group and Radio.Item. Cards display a bordered, selectable container with title and description. Also addsdescriptionprop to Radio.Item for helper text. Supports vertical and horizontal orientations, error state, and disabled state. - abbf586
Expose Chart
optionUpdateBehaviorto control how ECharts applies option updates;notMergenow defaults tofalse. - c6aa554
Add neutral variant to Switch component and improve accessibility
- New
variant="neutral"option: monochrome switch with squircle shape, matching the design from stratus - Improved off-state visibility for default variant with darker background/ring colors
- Removed
errorvariant (not useful for toggle switches) - Added defensive fallback so invalid variant values don't cause runtime crashes
- New
修订内容
- f2e17d7
removed
outline-noneto bring back focus states on all buttons - eba693e
Fix flaky vitest "Closing rpc while fetch was pending" error in deep-imports test
- db91f50
Fix InputArea label click not focusing textarea. Use FieldBase.Control with render callback to properly associate the label with the textarea element.
- 80afd4d
Fix TypeScript return types for ShikiProvider and CodeHighlighted components.
Changed return type from
ReactNodetoReact.JSX.Elementto resolve JSX compatibility errors. This fixes issues when consuming these components in projects with stricter TypeScript configurations (e.g.,skipLibCheck: false), whereReactNodewas incorrectly inferred as a valid JSX element return type. - dc9742d
Fix table header font size to ensure consistent rendering across dashboards with different default font sizes
- f94fee7
Add dedicated
lark-placeholdertext color token and use it for Input, InputArea, SensitiveInput, and CommandPalette placeholder text. The new token provides better visual distinction between placeholder and active text in both light and dark modes. - 66012b7
Replace the package-level ESLint pass with Oxlint JS plugin coverage for the remaining jsx-a11y rules, and pin the library build to
es2022with a post-build browser-compat test that blocks newer runtime APIs from shipping indist. - e8acdd8
fix(Select): prevent chevron overflow with long multi-select values
Added
min-w-0 truncateto the value element andshrink-0to the chevron icon so that long option names truncate gracefully instead of pushing the chevron outside the select bounds.
次要变更
- 56a8b35
add xAxisTickFormat, yAxisTickFormat, and tooltipValueFormat props to TimeseriesChart; deprecate yAxisTickLabelFormat
Deprecation: yAxisTickLabelFormat is deprecated
If you were using
yAxisTickLabelFormatto customize tooltip output, switch totooltipValueFormat.Before:
<TimeseriesChart yAxisTickLabelFormat={(v) => `${v} req/s`} />After:
<TimeseriesChart tooltipValueFormat={(v) => `${v} req/s`} />
修订内容
- eda8362
Fix combobox caret icon visibility by using fill-lark-subtle instead of fill-lark-ring
次要变更
- 4d6de27
reorganize greyscale tokens and update color preferences
修订内容
- 2ff49b7
updated button styles for outline and secondary
- 59f7935
Fix Jest module resolution failures and reduce Shiki bundle size
Jest Fix:
- Add
chunkFileNamesconfig to prevent double-dash filenames (e.g.,combobox--ec3iibR.js) that Jest cannot resolve - Move chunks to
dist/chunks/subdirectory for cleaner structure
Bundle Size Reduction:
- Switch from full Shiki bundle to fine-grained imports via
shiki/core - Reduce from ~300 language/theme chunks to ~16 bundled languages
- Total JS files reduced from 358 to ~163 (54% reduction)
Supported Languages:
javascript,typescript,jsx,tsx,json,jsonc,html,css,python,yaml,markdown,graphql,sql,bash,shell,diffBreaking Change:
BundledLanguagetype is now deprecated, useSupportedLanguageinstead- Only the languages listed above are bundled; other Shiki languages are no longer available out of the box
- Add
- 9eaf584
Fix npm publish failure by removing cross-package dependency from prepublish hook
次要变更
- 140f4ab
Select: Improved label API to match Input component pattern
hideLabelis now deprecated. Whenlabelis provided, the label is visible by default (previously hidden by default).- For visible labels:
<Select label="Country" />(no changes needed if you were usinghideLabel={false}) - For hidden labels: Use
<Select aria-label="Select a country" />instead of<Select label="Country" hideLabel={true} />
- For visible labels:
- Bug fix: Placeholder text now displays correctly when using object map
itemsformat (e.g.,items={{ a: "Option A" }}). Previously, placeholders only worked with array format items.
Backward compatibility:
hideLabel={true}still works but shows a deprecation warning in development. Existing code usinghideLabel={false}requires no changes.Migration guide:
// Before (label hidden by default) <Select label="Country" /> // label was sr-only <Select label="Country" hideLabel={false} /> // label was visible // After (label visible by default, matching Input) <Select label="Country" /> // label is now visible <Select aria-label="Country" /> // use aria-label for hidden labels - f1c6392
Add optional
idprop toFlow.Nodefor stable node identification and connector test IDs - da03394
Avoid adding multiple toasts with the same ID. Use a subtle bump animation when a toast with an existing ID is added.
修订内容
- a53ec1b
Fix theme token flicker by generating stable light/dark fallback variables with safer scope and layer precedence.
- cb121bc
fix: add defensive styles to prevent global CSS pollution
Problem
When Lark components are used in applications with aggressive global styles (e.g., Stratus's
cfBaseStyleslayer), certain elements get polluted:label { margin-bottom: 1rem }adds unwanted margins to all labelsbutton { background: gray }affects unstyled button wrappers (e.g., tooltip triggers)a { color: var(--text-color-primary) }can override link colors if the consuming app defines--text-color-primarydifferently
Solution
Add defensive Tailwind utility classes directly to components. These:
- Reset commonly-polluted properties to safe defaults
- Use
cn()(tailwind-merge) so consumer styles viaclassNamestill override them - Are no-ops in clean CSS environments (no visual change in Lark docs)
Changes
Label margins (
m-0)- Label:
labelVariants()now includesm-0 - Field:
FieldBase.Labelgetsm-0 - Checkbox: label wrapper gets
m-0 - Radio: label wrapper gets
m-0 - Switch: label wrapper gets
m-0
Button trigger resets
- Tooltip trigger (when
!asChild):bg-transparent border-none shadow-none p-0 m-0 h-auto min-h-0 leading-[0] inline-flex items-center - Collapsible trigger:
bg-transparent border-none shadow-none p-0 m-0
Link color namespace fix
- Link: Changed from
text-primarytotext-lark-linkto avoid collision with consuming apps that define--text-color-primarydifferently
Label tooltip composition
- Label: Tooltip trigger now uses
<Button variant="ghost" size="xs" shape="square">withasChild, leveraging composition instead of relying on defensive resets
Docs
Added "Custom Trigger" section to Tooltip docs demonstrating that
classNamecan fully override defensive styles when not usingasChild. - c6a3fb3
fix(dropdown): use Base UI CheckboxItemIndicator for proper accessibility
Replace custom Checkbox component with Base UI's CheckboxItemIndicator in DropdownMenuCheckboxItem. The previous implementation nested an interactive Checkbox inside the menuitemcheckbox role, causing duplicate accessibility labels. CheckboxItemIndicator is automatically aria-hidden and only renders when checked, following the standard Base UI pattern.
- 1bfffaa
Fix Field error message line height by adding
leading-snugfor consistent text spacing - 5d16fdb
Improve info banner dark mode contrast for WCAG AA compliance. Changes
lark-infofromblue-700(L=48.8%) toblue-400(L=70.7%), achieving 7.97:1 contrast ratio against the banner background. - 8b964f5
Fix Combobox.TriggerValue icon misalignment caused by inherited line-height
The caret icon span was inheriting
line-heightfrom the parent button'stext-baseclass, causing the span's height to exceed the icon's height (e.g., 21.5px vs 16px). The icon sits at the top of the span by default, so when the span is centered viatop-1/2 -translate-y-1/2, the icon appears offset.Added
flex items-centerto the icon wrapper to ensure proper vertical centering regardless of inherited styles. This matches the pattern used in TriggerInput. - 529274d
fix(Pagination): use aria-label instead of label for PageSize select
The Select component now shows visible labels by default. Since Pagination.PageSize already displays "Per page:" text next to the select, the internal Select should use
aria-labelfor accessibility without showing a duplicate visible label. - 2f0e572
chore(toast): replace inline XIcon with Phosphor icon
- ee1099d
Prevent password managers autofilling Pagination input field
- 6dc952f
fix(tabs): improve focus ring and hover styling
- Fixed focus ring to use proper
ring-lark-ringtoken instead of browser default blue - Segmented variant: inset focus ring to avoid overlap with adjacent tabs, hidden on active tab
- Underline variant: added padding for better focus ring spacing around text
- Added subtle hover states for both variants
- Fixed focus ring to use proper
- 2352344
fix(Tabs): pass TabItem render prop through to Base UI for custom tab rendering (e.g., link-based tabs)
次要变更
- 5505610
Add Shiki-powered
CodeHighlightedcomponent for syntax highlighting- New entry point:
@lark-ui/core/code- keeps Shiki out of main bundle - ShikiProvider: Lazy-loads Shiki on first render, shares instance across all children
- CodeHighlighted: Syntax highlighting with line numbers, line highlighting, copy button
- Server utilities:
@lark-ui/core/code/serverfor SSR/static highlighting - Themes: Ships with
github-lightandvesperdefaults, supports any Shiki theme - i18n: Customizable labels via provider or per-component
- CSS customization:
--lark-code-highlight-bgvariable for highlight color - Deprecates: Legacy
CodeandCodeBlockcomponents (will be removed in v2)
- New entry point:
- 003128b
feat(combobox): add size prop with xs, sm, base, lg variants matching Input component
- 1cad157
feat(flow): make nested lists work inside parallel nodes
- 9d89256
Add
roleprop to Dialog component supporting both"dialog"(default) and"alertdialog"ARIA rolesNew Feature:
Dialog.Rootnow accepts aroleprop to specify the dialog's ARIA semantics- When
role="alertdialog"is used, the dialog uses Base UI's AlertDialog primitives for proper accessibility - This provides correct screen reader announcements for confirmation and destructive action dialogs
When to use
role="alertdialog":- Destructive actions (delete, discard, remove)
- Confirmation flows requiring explicit user acknowledgment
- Actions that cannot be undone
- Critical warnings or errors
Example:
// Standard dialog (default) <Dialog.Root> <Dialog.Trigger render={(p) => <Button {...p}>Edit</Button>} /> <Dialog>...</Dialog> </Dialog.Root> // Alert dialog for destructive actions <Dialog.Root role="alertdialog"> <Dialog.Trigger render={(p) => <Button variant="destructive" {...p}>Delete</Button>} /> <Dialog>...</Dialog> </Dialog.Root> - e6218d2
Add TimeseriesChart component with ECharts integration, supporting legends, gradient fills, custom axis formatting, loading skeleton state, and configurable color palettes.
- a7eb061
feat(select): auto-render options from items prop when children omitted
The Select component now automatically renders Select.Option elements from the items prop when children are not explicitly provided.
修订内容
- 5943e77
Add missing
successbackground and tint semantic color tokens (bg-lark-success,bg-lark-success-tint) for parity withinfo,warning, anddanger. Fixtext-lark-successdark mode contrast by usinggreen-400instead ofgreen-500. Add newsuccessBadge variant for positive state indicators. - 35d5c42
fix(breadcrumbs): improve mobile breadcrumb readability
breadcrumbs now render a compact mobile trail for deeper hierarchies by collapsing early levels to
...and keeping the trailing path visible. labels in breadcrumb links and the current page now truncate correctly to prevent stacking or overlap on narrow viewports. - 02d0d65
fix(badge): prevent crash when unknown variant is passed
Add defensive fallback to primary variant when an unrecognized variant string is provided to Badge component. This prevents "Cannot read properties of undefined (reading 'classes')" errors when consumers use a variant that doesn't exist in their installed version.
- 3170d65
fix(code): Fix CodeHighlighted dark mode, layout, and SSR issues
- Fix dark mode: Make
<pre>background transparent so container'sbg-lark-basehandles theming and border-radius is respected - Fix layout: Wrap Shiki output in overflow container to prevent line highlight negative margins from being clipped
- Fix width: Add
w-fullto container for proper full-width display - Fix SSR: Remove
"use client"directive from@lark-ui/core/code/serverentry point so server utilities work in RSC/SSR contexts
- Fix dark mode: Make
- 31ce577
fix(CommandPalette): add explicit text-base class to Item component for consistent 14px font size
- ee5a632
Fix Select to render description and error when hideLabel is true
Previously, the
descriptionanderrorprops were silently ignored whenhideLabelwastrue(the default). Now, helper text and error messages display correctly even when the label is visually hidden. - 409d32b
Fix TypeScript errors when consumers type-check their projects with lark installed.
Previously, TypeScript would attempt to type-check raw
.tsxand.tssource files shipped in the package (block sources indist/src/blocks/,ai/schemas.ts, andscripts/theme-generator/*.ts), causing build failures in downstream projects.This change:
- Moves block source files to a separate
dist/blocks-source/directory - Compiles
ai/schemas.tsandscripts/theme-generator/*.tsto JavaScript - Updates package exports to point to compiled
.jsfiles with proper.d.tstypes
- Moves block source files to a separate
- 7816318
fix(inputs): expand small control hit areas
- e7f0c80
Fix pagination component to properly wrap numbers in
tabular-numsclass for consistent number alignment. Both the page range and total count now use tabular numerals. - c0341b4
Simplify Select placeholder implementation by using Base UI's native placeholder prop on SelectBase.Value instead of manually injecting placeholder items into the items array. This provides a cleaner, more intuitive API that aligns with standard HTML select behavior while maintaining backward compatibility with the null-value placeholder pattern.
- 35d5c42
fix(breadcrumbs): enhance mobile breadcrumb display for better readability
- abb7f8c
Add
variant="compact"prop to Table.Header for a more condensed header style - 8972cc4
Fix Combobox group label styling to use semantic token and correct padding
- bb49d4b
Standardize z-index usage with isolation containment
- Add
isolation: isolateto components with internal stacking (Tabs, MenuBar, InputGroup, Flow/Parallel) - Simplify internal z-index values to
z-0/z-1/z-2instead of arbitrary values likez-10/z-20 - Remove superfluous
z-10from CommandPalette List - Update Toast viewport to
z-1(matching Base UI's documented pattern) - Update ClipboardText viewport to use
isolateinstead ofz-50
This prevents z-index values from leaking outside component boundaries.
- Add
次要变更
- 23865db
feat(dropdown): add LinkItem for navigation links and fix icon rendering
New Features:
- Add
DropdownMenu.LinkItemfor navigation links (semantic<a>element with proper menu item behavior) - Upgrade
@base-ui/reactfrom 1.0.0 to 1.2.0 - Add new primitives:
csp-provideranddrawerfrom Base UI 1.2.0
Bug Fixes:
- Fix
iconprop not rendering onDropdownMenu.Itemwhen nohrefis provided
Deprecations:
hrefprop onDropdownMenu.Itemis deprecated. UseDropdownMenu.LinkIteminstead.
Migration:
// Before (deprecated) <DropdownMenu.Item href="https://example.com">Link</DropdownMenu.Item> // After (recommended) <DropdownMenu.LinkItem href="https://example.com" target="_blank"> Link </DropdownMenu.LinkItem>DropdownMenu.LinkItemgives you full control over link attributes (target,rel, etc.) without the component making assumptions about your intent. - Add
- 68c2f0d
Add
positionMethodprop toPopover.Contentto control CSS positioning strategy. Use"fixed"when the popover needs to escape stacking contexts (e.g., inside sticky headers). Defaults to"absolute".
修订内容
- 89cb5ec
Improve Flow diagram components with disabled node support and better connector rendering:
- Add
disabledprop to FlowNode for greying out connectors - Add
alignprop to FlowParallelNode for start/end alignment - Improve connector path rendering with smarter junction detection
- Fix panning behavior to not interfere with node interactions
- Add
次要变更
- cf4ff38
Refactor Banner component with softer styling and i18n-friendly props
- Added
titleanddescriptionprops for structured content with i18n support - Softened visual appearance: reduced background opacity (20% -> 10%), muted border colors
- Text now uses
text-lark-defaultfor readability, with colored icons for variant indication - Added
iconClassesto variant config for per-variant icon coloring - Component now uses
forwardRefand setsdisplayNameper conventions - Deprecated
childrenandtextprops in favor oftitle/description - Legacy
childrenprop still works for backwards compatibility
- Added
修订内容
- 0ca3b05
Fix Checkbox ring color to use
ring-lark-contrastwhen checked or indeterminate - f69df6d
Fix Combobox dropdown scrolling regression and improve scroll behavior.
Bug fix: The
overflow-hiddenclass was accidentally re-introduced during a semantic color token migration, which overrodeoverflow-y-autoand caused dropdown content to be clipped instead of scrollable.Improvement: Restructured Combobox.Content to use flexbox layout so that when using
Combobox.Inputinside the dropdown (searchable popup pattern), the input stays fixed at the top while only the list scrolls. Previously, the entire popup content would scroll together.Scrollbar fix: Moved horizontal padding from the popup container to individual child components, so the scrollbar renders flush with the popup edge instead of being inset (which was clipping the checkmark indicators).