Changelog
All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
import { Avatar } from '@ark-ui/react'
export const Example = () => {
// New: Use `Avatar` import to declare types.
const handleLoadingStatusChange = (details: Avatar.StatusChangeDetails) => {
console.log(details.status)
}
return (
<Avatar.Root onLoadingStatusChange={handleLoadingStatusChange}>
<Avatar.Fallback>PA</Avatar.Fallback>
<Avatar.Image src="https://i.pravatar.cc/300" alt="avatar" />
</Avatar.Root>
)
} Context component to allow access to the internal machine API.
Previously, it was only possible to access the internal API at the root level,
which is manageable for small components but could lead to cumbersome
composition in larger components. Additionally, this pattern clashed with the
asChild composition pattern we use.export const Basic = () => (
<Popover.Root>
<Popover.Trigger>Open</Popover.Trigger>
<Popover.Positioner>
<Popover.Context>
{(api) => (
<Popover.Content>
<Popover.Title onClick={() => api.close()}>Title</Popover.Title>
<Popover.Description>Description</Popover.Description>
</Popover.Content>
)}
</Popover.Context>
</Popover.Positioner>
</Popover.Root>
) Format component to format bytes and numbers.defaultOpen to TooltipMenu component. Please refer to the
documentation for more information.DatePicker where the min and max props did not
support date string values.Context component instead. This change will help in
streamlining the asChild composition pattern.parse prop from the DatePicker component.Locale in Next.js projects.Toast not updating its toasts and count properties
when creating one or more toasts.Accordion.Item could still be opened.@ark-ui/anatomy version.Collapsible component.defaultExpandedIds in the TreeView component.factory by utilizing memo to avoid
unnecessary re-renders.Collapsible into Accordion, allowing the Accordion component
to utilize Collapsible for animating the opening and closing of content.d@keyframes slideDown {
from {
height: 0;
}
to {
height: var(--height);
}
}
@keyframes slideUp {
from {
height: var(--height);
}
to {
height: 0;
}
}
[data-scope='accordion'][data-part='item-content'][data-state='open'] {
animation: slideDown 250ms;
}
[data-scope='accordion'][data-part='item-content'][data-state='closed'] {
animation: slideUp 200ms;
} createToaster for comprehensive IntelliSense
support when styling the Toaster component.TreeView to utilize defaultSelectedIds instead of
defaultFocusedId.factory in Next.js projects.Tooltip would flash upon hovering and
clicking the trigger.Clipboard component was missing a specifier in
the @ark-ui/react package.Clipboard component. Refer to the
documentation for details.ColorPicker,
DatePicker, Dialog, HoverCard, Menu, Popover, Select, and
Tooltip.PresetTrigger part to the DatePicker component, enabling custom
triggers for common date presets (e.g., Last 7 days, Last 30 days).DatePicker.Control component to support multiple inputs by
introducing an optional index attribute to DatePicker.Input. Example
usage:<DatePicker.Control>
<DatePicker.Input index={0} />
<DatePicker.Input index={1} />
</DatePicker.Control> TreeView component API for streamlined component usage. See the
documentation for details.Combobox, Menu, and Select where scrolling into
view inadvertently scrolled the body element.DatePicker regarding the incorrect display of weeks
when setting startOfWeek.Editable preventing text deletion upon reaching
maxLength.Select where an item group’s label id was
misdirected.Select to use the correct id for the aria-activedescendant
attribute.SelectionDetails type for the Menu component.Dialog.Description and Popover.Description elements from p to
div for better paragraph handling.TreeView.BranchTrigger element from button to div for
accessibility enhancements.@types/react@18.2.8 broke current typings in PortalSelect component submits its first option when used in a
form, even if there is no value selected.TreeView component@zag-js dependencies to their latest versions, enhancing performance
for all components.<ComponentName>RootProps. Like shown for the Avatar component below:- import type { AvatarProps } from "@ark-ui/react"
+ import type { AvatarRootProps } from "@ark-ui/react" .Root suffix for provider component like
Presence and Environment.- <Presence.Root>...</Presence.Root>
+ <Presence>...</Presence> Breaking Change: Renamed the indicator part to view in the Progress
component to more accurately reflect its functionality.
Added the ItemPreview component to the TagsInput component. See the
example below:
<TagsInput.Item key={index} index={index} value={value}>
+ <TagsInput.ItemPreview>
<TagsInput.ItemText>{value}</TagsInput.ItemText>
<TagsInput.ItemDeleteTrigger>Delete</TagsInput.ItemDeleteTrigger>
+ </TagsInput.ItemPreview>
<TagsInput.ItemInput />
</TagsInput.Item> Progress component to use div elements instead of nav for
semantic correctness.Combobox,
Menu, or Select triggered a click event on the element behind the
portalled content.PinInput where pasting a value filled all inputs instead
of populating them one per input.Progress component.valueAsString to onValueChange in DatePicker callback detailsAccordionValueChangeDetails or
DialogOpenChangeDetailsPortal component to support getRootNode and disabled propsRadioGroup,
SegmentGroup, and Tabs.placeholder prop to SelectValueTextProps type.PopoverDescriptionProps type from div to pSelect component with Next.js or Remix
useSearchParamsdisabled on Combobox does not reflect in
combobox itemCombobox when clicking on the input while the
menu is openDatePicker initial value isn’t set when using
controlled contextMenu option item could not be activated by keyboardark factory type was not being exported
correctly.ToastGroup component.ark factory at @ark-ui/react/factoryFileUpload component. Check out the
documentation for more
information.Portal component to resolve an issue
with online code editors.present prop in the disclosure-type component
was not being respected.ark function would log a warning when the
asChild prop was set to false.Menu.Portal component.NumberInput componentFileUpload componentColorPicker component. Check out the
documentation for more
information.Toast component would throw a warning when
multiple toasts were rendered at the same time.Dialog component would not animate on exit.Menu when lazy mounted.MenuTrigger could still work even when disabled.Dialog, Popover etc would not
invoke onExitCompleteCombobox could be incorrect when lazy
mounted.We are happy to announce the release of @ark-ui/react@1.0.0. This release
includes a number of breaking changes, new features, and bug fixes. Since our
last release over two months ago, we will only highlight some key changes.
Please refer to the documentation for each component to learn more.
Presence component: lazyMount and unmountOnExit have been
added at the root level. For some disclosure components like Tabs and
Accordion, this constitutes a breaking change.Accordion, ColorPicker,
DatePicker, Dialog, RadioGroup, SegmentGroup, TagsInput, Toast,
and ToggleGroup to achieve a consistent and more intuitive API.With the release of version 1.0.0, we are moving towards a more stable version
of @ark-ui/react. Future updates will strive to avoid breaking changes,
ensuring a smoother experience for our users. If you encounter any issues while
upgrading, please do not hesitate to open an issue on our
GitHub repository. Your feedback is
invaluable in helping us improve.
ToggleGroup componenttype HTMLArkProps that can be used together with the ark factory fn
to create a type that can be used with asChild prop.Comoobox component to support multiple selectionSelect component to support multiple selectionflushSync did not have a stable
reference, resulting in a noticable blocking re-renders.
Affected components:
Slider,RangeSlider,NumberInput,ColorPicker
MenuItem from a button to a div element.Accordion: Remove support for passing value as string. The value property
must be an array of strings.Combobox: Remove selectInputOnFocus option in favor of userland controlTagsInput: Rename onHighlight to onFocusChange'use client' annotation from compose-refs function.Switchinput. This component is no longer required.TagsInput: RemovedonTagUpdate use onChange instead.Switch: Removed defaultChecked in favor of defaultIsChecked'use client' annotation from factory function.SegmentIndicator to SegmentGroupIndicator to match the
naming convention of other components.defaultChecked to Checkbox component.defaultChecked to Switch component.ark factory function.EditableCancelTrigger component.RadioInput. This component is no longer required.SegmentInput. This component is no longer required.ComboboxOptionGroup and ComboboxClearTrigger components to the
Combobox component.DatePickerPositioner component to the DatePicker component to help
with positioning the calendar.ComboboxOptionGroupLabel to the Combobox component. This component
can be used to render a label for a group of options in the
ComboboxOptionGroup component.TagsInputField to TagsInputInput to match the naming
convention of other input components.NumberInputField to NumberInputInput to match the naming
convention of other input components.PinInputField to PinInputInput to match the naming
convention of other input components.CheckboxInput. This component is no longer required.Toast components in their
application, ensuring a consistent look and feel across the board.onChange handler to allow synchronous updates to the
value when using the scrubber.ref property when dealing with both
intrinsic HTML elements and custom React components.AccordionContent, ComboboxContent, DialogBackdrop,
DialogContent, HoverCardContent, PopoverContent, SelectContent, and
TooltipContent components. The lazyMount property allows for on-demand
rendering of content, while the unmountOnExit property enables the removal
of the component from the DOM once it’s no longer required, ensuring better
resource management and cleaner code.use client annotation.isOpen from Popover. Please use open instead.Carousel component: Introduced CarouselIndicator and
CarouselIndicatorGroup components. These sub-components offer finer control
over the carousel navigation, enabling users to directly access desired
carousel slides.Presence component, a new utility designed to delay the unmount
of child components to assist with animation processes.Dialog, Tooltip and Popover elements using
the Presence component. Check out the documentation for these components to
learn more.use<X>Context for all components that use context.SegmentGroup component would not animate on the
first click.Toast component would not render custom content.@ark-ui/react/srctabs instead of the full
@ark-ui/react package. This is a significant feature for those working with
bundlers that do not support tree-shaking. By allowing imports of individual
components, we ensure a reduced bundle size when the full package import is
not necessary.SegmentGroup componentAvatar componentdefaulPage property to PaginationdefaultSize property to SplitteronLongPress property to PressableSplitter component’s internal API, enabling
more control over the component’s state@zag-js dependencies to their latest versionsAccordionIconDatePickerCheckbox. Control indeterminate state in checked propSwitchProps typeSwitchasChildColorPickerAccordionCarouselCheckboxComboboxDatePickerDialogEditableHoverCardMenuNumberInputPaginationPinInputPopoverPressableRadioGroupRangeSliderRatingGroupSelectSliderSplitterTabsTagsInputToastTooltip