Toolkit for building accessible web apps with React
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] 9 months ago
autoSelect
modeThe autoSelect
prop of the Combobox
component now accepts a new "always"
value:
<Combobox autoSelect="always" />
When using this value, the first enabled item will automatically gain focus when the list shows up, as well as when the combobox input value changes (which is the behavior of the autoSelect
prop when set to true
).
ComboboxItem
losing focus too earlySome tweaks were made to the ComboboxItem
component to ensure it doesn't lose focus right after a click or Escape keystroke when the combobox popover is animated. This should avoid an inconsistent UI as the popover plays its exit animation.
disclosure
property to disclosure stores.blurActiveItemOnClick
prop to Combobox
.showOnClick
prop to Combobox
.showOnKeyPress
prop to Combobox
.DisclosureContent
components losing their ref value on fast refresh.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
autoSelect
modeThe autoSelect
prop of the Combobox
component now accepts a new "always"
value:
<Combobox autoSelect="always" />
When using this value, the first enabled item will automatically gain focus when the list shows up, as well as when the combobox input value changes (which is the behavior of the autoSelect
prop when set to true
).
ComboboxItem
losing focus too earlySome tweaks were made to the ComboboxItem
component to ensure it doesn't lose focus right after a click or Escape keystroke when the combobox popover is animated. This should avoid an inconsistent UI as the popover plays its exit animation.
disclosure
property to disclosure stores.blurActiveItemOnClick
prop to Combobox
.showOnClick
prop to Combobox
.showOnKeyPress
prop to Combobox
.DisclosureContent
components losing their ref value on fast refresh.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
disclosure
property to disclosure stores.Published by github-actions[bot] 9 months ago
inert
elements.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
This version introduces enhanced support for CSS animations and transitions, along with a few breaking changes for quite specific cases. The majority of users won't be impacted by these.
Please review the brief notes following the BREAKING labels on each update to determine if any changes are needed in your code.
This version enhances support for CSS animations and transitions on Ariakit components that use Disclosure. This includes Dialog, Popover, Combobox, Select, Hovercard, Menu, and Tooltip.
These components now support enter and leave transitions and animations right out of the box, eliminating the need to provide an explicit animated
prop. If an enter animation is detected, the component will automatically wait for a leave animation to complete before unmounting or hiding itself.
Use the [data-enter]
selector for CSS transitions. For CSS animations, use the newly introduced [data-open]
selector. The [data-leave]
selector can be used for both transitions and animations.
ComboboxList
is no longer focusableBREAKING if you're using the ComboboxList
component directly with Focusable
props.
The ComboboxList
component is no longer focusable and doesn't accept Focusable
props such as autoFocus
, disabled
, and onFocusVisible
anymore. If you need Focusable features specifically on the ComboboxList
component, you can use composition to render it as a Focusable
component.
Before:
<ComboboxList disabled />
After:
<ComboboxList render={<Focusable disabled />} />
grid
roleBREAKING if you're manually setting the role="grid"
prop on a composite widget.
Ariakit automatically assigns the role
prop to all composite items to align with the container role
. For example, if SelectPopover
has its role set to listbox
(which is the default value), its owned SelectItem
elements will automatically get their role set to option
.
In previous versions, this was also valid for composite widgets with a grid
role, where the composite item element would automatically be given role="gridcell"
. This is no longer the case, and you're now required to manually pass role="gridcell"
to the composite item element if you're rendering a container with role="grid"
.
Before:
<SelectPopover role="grid">
<SelectRow> {/* Automatically gets role="row" */}
<SelectItem> {/* Automatically gets role="gridcell" */}
After:
<SelectPopover role="grid">
<SelectRow> {/* Still gets role="row" */}
<SelectItem role="gridcell">
This change is due to the possibility of rendering a composite item element with a different role as a child of a static div
with role="gridcell"
, which is a valid and frequently used practice when using the grid
role. As a result, you no longer have to manually adjust the role
prop on the composite item:
<SelectPopover role="grid">
<SelectRow>
<div role="gridcell">
<SelectItem render={<button />}>
Previously, you had to explicitly pass role="button"
to the SelectItem
component above, otherwise it would automatically receive role="gridcell"
, leading to an invalid accessibility tree.
BREAKING if you're using TypeScript and the onChange
prop on Radio
, FormRadio
, or MenuItemRadio
.
The onChange
callback argument type has changed from React.SyntheticEvent
to React.ChangeEvent
.
Before:
<Radio onChange={(event: React.SyntheticEvent) => {}} />
After:
<Radio onChange={(event: React.ChangeEvent) => {}} />
BREAKING if you're depending on data attributes to carry an empty string (""
) value.
In previous versions, data attributes such as data-active
, data-active-item
, data-enter
, data-leave
, and data-focus-visible
would carry an empty string (""
) value when active, and undefined
when inactive. Now, they have a true
value when active, but remain undefined
when inactive.
Their use as CSS selectors remains unchanged. You should continue to select them with the attribute selector with no value (e.g., [data-enter]
). However, if you're employing them in different ways or have snapshot tests that depend on their value, you might need to update your code.
BREAKING if you haven't addressed the deprecation warnings from previous releases.
This version eliminates features that were deprecated in previous releases: the backdropProps
and as
props, as well as the ability to use a render function for the children
prop across all components.
Before:
<Dialog backdropProps={{ className: "backdrop" }} />
<Combobox as="textarea" />
<Combobox>
{(props) => <textarea {...props} />}
</Combobox>
After:
<Dialog backdrop={<div className="backdrop" />} />
<Combobox render={<textarea />} />
<Combobox render={(props) => <textarea {...props} />} />
You can learn more about these new features in the Composition guide.
MenuBar
in favor of Menubar components.type
prop for the Tooltip has been deprecated. See Tooltip anchors must have accessible names.aria-describedby
to associate the tooltip content with the anchor.disclosure
property to disclosure stores.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
This version introduces enhanced support for CSS animations and transitions, along with a few breaking changes for quite specific cases. The majority of users won't be impacted by these.
Please review the brief notes following the BREAKING labels on each update to determine if any changes are needed in your code.
This version enhances support for CSS animations and transitions on Ariakit components that use Disclosure. This includes Dialog, Popover, Combobox, Select, Hovercard, Menu, and Tooltip.
These components now support enter and leave transitions and animations right out of the box, eliminating the need to provide an explicit animated
prop. If an enter animation is detected, the component will automatically wait for a leave animation to complete before unmounting or hiding itself.
Use the [data-enter]
selector for CSS transitions. For CSS animations, use the newly introduced [data-open]
selector. The [data-leave]
selector can be used for both transitions and animations.
ComboboxList
is no longer focusableBREAKING if you're using the ComboboxList
component directly with Focusable
props.
The ComboboxList
component is no longer focusable and doesn't accept Focusable
props such as autoFocus
, disabled
, and onFocusVisible
anymore. If you need Focusable features specifically on the ComboboxList
component, you can use composition to render it as a Focusable
component.
Before:
<ComboboxList disabled />
After:
<ComboboxList render={<Focusable disabled />} />
grid
roleBREAKING if you're manually setting the role="grid"
prop on a composite widget.
Ariakit automatically assigns the role
prop to all composite items to align with the container role
. For example, if SelectPopover
has its role set to listbox
(which is the default value), its owned SelectItem
elements will automatically get their role set to option
.
In previous versions, this was also valid for composite widgets with a grid
role, where the composite item element would automatically be given role="gridcell"
. This is no longer the case, and you're now required to manually pass role="gridcell"
to the composite item element if you're rendering a container with role="grid"
.
Before:
<SelectPopover role="grid">
<SelectRow> {/* Automatically gets role="row" */}
<SelectItem> {/* Automatically gets role="gridcell" */}
After:
<SelectPopover role="grid">
<SelectRow> {/* Still gets role="row" */}
<SelectItem role="gridcell">
This change is due to the possibility of rendering a composite item element with a different role as a child of a static div
with role="gridcell"
, which is a valid and frequently used practice when using the grid
role. As a result, you no longer have to manually adjust the role
prop on the composite item:
<SelectPopover role="grid">
<SelectRow>
<div role="gridcell">
<SelectItem render={<button />}>
Previously, you had to explicitly pass role="button"
to the SelectItem
component above, otherwise it would automatically receive role="gridcell"
, leading to an invalid accessibility tree.
BREAKING if you're using TypeScript and the onChange
prop on Radio
, FormRadio
, or MenuItemRadio
.
The onChange
callback argument type has changed from React.SyntheticEvent
to React.ChangeEvent
.
Before:
<Radio onChange={(event: React.SyntheticEvent) => {}} />
After:
<Radio onChange={(event: React.ChangeEvent) => {}} />
BREAKING if you're depending on data attributes to carry an empty string (""
) value.
In previous versions, data attributes such as data-active
, data-active-item
, data-enter
, data-leave
, and data-focus-visible
would carry an empty string (""
) value when active, and undefined
when inactive. Now, they have a true
value when active, but remain undefined
when inactive.
Their use as CSS selectors remains unchanged. You should continue to select them with the attribute selector with no value (e.g., [data-enter]
). However, if you're employing them in different ways or have snapshot tests that depend on their value, you might need to update your code.
BREAKING if you haven't addressed the deprecation warnings from previous releases.
This version eliminates features that were deprecated in previous releases: the backdropProps
and as
props, as well as the ability to use a render function for the children
prop across all components.
Before:
<Dialog backdropProps={{ className: "backdrop" }} />
<Combobox as="textarea" />
<Combobox>
{(props) => <textarea {...props} />}
</Combobox>
After:
<Dialog backdrop={<div className="backdrop" />} />
<Combobox render={<textarea />} />
<Combobox render={(props) => <textarea {...props} />} />
You can learn more about these new features in the Composition guide.
MenuBar
in favor of Menubar components.type
prop for the Tooltip has been deprecated. See Tooltip anchors must have accessible names.aria-describedby
to associate the tooltip content with the anchor.disclosure
property to disclosure stores.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
This version enhances support for CSS animations and transitions on Ariakit components that use Disclosure. This includes Dialog, Popover, Combobox, Select, Hovercard, Menu, and Tooltip.
These components now support enter and leave transitions and animations right out of the box, eliminating the need to provide an explicit animated
prop. If an enter animation is detected, the component will automatically wait for a leave animation to complete before unmounting or hiding itself.
Use the [data-enter]
selector for CSS transitions. For CSS animations, use the newly introduced [data-open]
selector. The [data-leave]
selector can be used for both transitions and animations.
grid
roleBREAKING if you're manually setting the role="grid"
prop on a composite widget.
Ariakit automatically assigns the role
prop to all composite items to align with the container role
. For example, if SelectPopover
has its role set to listbox
(which is the default value), its owned SelectItem
elements will automatically get their role set to option
.
In previous versions, this was also valid for composite widgets with a grid
role, where the composite item element would automatically be given role="gridcell"
. This is no longer the case, and you're now required to manually pass role="gridcell"
to the composite item element if you're rendering a container with role="grid"
.
Before:
<SelectPopover role="grid">
<SelectRow> {/* Automatically gets role="row" */}
<SelectItem> {/* Automatically gets role="gridcell" */}
After:
<SelectPopover role="grid">
<SelectRow> {/* Still gets role="row" */}
<SelectItem role="gridcell">
This change is due to the possibility of rendering a composite item element with a different role as a child of a static div
with role="gridcell"
, which is a valid and frequently used practice when using the grid
role. As a result, you no longer have to manually adjust the role
prop on the composite item:
<SelectPopover role="grid">
<SelectRow>
<div role="gridcell">
<SelectItem render={<button />}>
Previously, you had to explicitly pass role="button"
to the SelectItem
component above, otherwise it would automatically receive role="gridcell"
, leading to an invalid accessibility tree.
removeUndefinedValues
utility function.disclosure
property to disclosure stores.Published by github-actions[bot] 9 months ago
v0.3.13
where dialogs wouldn't close when clicking outside on iOS.Published by github-actions[bot] 9 months ago
v0.3.13
where dialogs wouldn't close when clicking outside on iOS.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
Components like MenuItem
, ComboboxItem
, and SelectItem
should now offer improved performance when rendering large collections.
FormControl
componentThis version introduces a new FormControl
component. In future versions, this will replace the FormField
component.
pointerup
event instead of mouseup
.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
Components like MenuItem
, ComboboxItem
, and SelectItem
should now offer improved performance when rendering large collections.
FormControl
componentThis version introduces a new FormControl
component. In future versions, this will replace the FormField
component.
pointerup
event instead of mouseup
.@ariakit/[email protected]
Published by github-actions[bot] 9 months ago
Components like MenuItem
, ComboboxItem
, and SelectItem
should now offer improved performance when rendering large collections.
Published by github-actions[bot] 10 months ago
@ariakit/[email protected]
Published by github-actions[bot] 10 months ago
Combobox
with the autoSelect
prop calling onFocus
with every input change.Hovercard
flickering when used with shadow DOM.Select
with Combobox
scroll jumping when opening using keyboard navigation.CompositeItem
triggering blur on focus.ComboboxItem
not triggering the onClick
event when the item is partially visible.@ariakit/[email protected]
Published by github-actions[bot] 10 months ago
Combobox
with the autoSelect
prop calling onFocus
with every input change.Hovercard
flickering when used with shadow DOM.Select
with Combobox
scroll jumping when opening using keyboard navigation.CompositeItem
triggering blur on focus.ComboboxItem
not triggering the onClick
event when the item is partially visible.@ariakit/[email protected]
Published by github-actions[bot] 10 months ago
CompositeItem
triggering blur on focus.Published by github-actions[bot] 10 months ago
Pressing the Home or End keys on text fields will now move the cursor (selectionStart
/selectionEnd
properties) to the start or finish of the text when using the press
function.
@ariakit/[email protected]
Published by github-actions[bot] 10 months ago
The Combobox components now support the modal
prop on ComboboxPopover
.
When a modal combobox is expanded, users can interact with and tab through all the combobox controls, including Combobox
, ComboboxDisclosure
, and ComboboxCancel
, even if they're rendered outside the popover. The rest of the page will be inert.
The Combobox
component now includes a new getAutoSelectId
prop. This allows you to specify the ComboboxItem
that should be auto-selected if the autoSelect
prop is true
.
By default, the first enabled item is auto-selected. Now you can customize this behavior by returning the id of another item from getAutoSelectId
:
<Combobox
autoSelect
getAutoSelectId={(items) => {
// Auto select the first enabled item with a value
const item = items.find((item) => {
if (item.disabled) return false;
if (!item.value) return false;
return true;
});
return item?.id;
}}
/>
The Combobox
component now includes a data-active-item
attribute when it's the only active item in the composite widget. In other words, when no ComboboxItem
is active and the focus is solely on the combobox input.
You can use this as a CSS selector to style the combobox differently, providing additional affordance to users who pressed ↑ on the first item or ↓ on the last item. This action would place both virtual and actual DOM focus on the combobox input.
.combobox[data-active-item] {
outline-width: 2px;
}
useTabStore
return value not updating its own reference.ComboboxDisclosure
to update its aria-expanded
attribute when the combobox expands.Maximum update depth exceeded
warning when rendering multiple collection items on the page.@ariakit/[email protected]