Toolkit with accessible components, styles, and examples for your next web app

Ariakit retweeted
Experimenting with dropdown menus and tooltips using Ariakit.

ALT Using a dropdown menu that displays a tooltip when hovering or focusing on menu items.

6
13
265
Ariakit retweeted
Building a simple dropdown menu with keyboard support using Ariakit.

ALT Programming and testing with mouse and keyboard a dropdown menu widget. The state is provided through the useMenuState hook imported from the Ariakit package, and the components are MenuButton, MenuButtonArrow, Menu, MenuItem, and MenuSeparator. The code uses React and JSX.

1
5
47
Ariakit retweeted
Doing some experiments with a custom select grid component. Some key features: - Bidimensional arrow key navigation. - Typeahead support even when the popup is closed. - Changes the value on mouse hover. - Resets the value on Escape.

ALT Using a custom 3x3 select grid component with the mouse and keyboard to control the position of a black text inside a yellow background.

4
9
102
Ariakit retweeted
From the series "dropdowns should all be modal dialogs on mobile."

ALT Resizing the window to the point where a custom select dropdown becomes a modal dialog

9
34
549
Ariakit retweeted
The Ariakit Select renders a hidden <select> element that's kept in sync with the custom element. This is so we can support things like native form submission and browser autofill.

ALT Showing a custom select element and a native select element. When the value of one changes, the other is automatically updated.

1
7
121
Ariakit retweeted
"I know we've spent several days on this custom single-select component, but now the requirements have changed, and we need a multi-select." Okay 👌

ALT Using a single-select element. Then, changing its default value from a string to an array of strings immediately turns the element into a multi-select.

6
17
472
Ariakit retweeted
The Ariakit Select component can optionally set the value when an item receives focus, not only on click, similar to how native selects work on Windows. Mouse hover is ignored. And pressing Escape will reset the value. 🧵

ALT Using a custom select component with mouse and keyboard

2
2
17
This is the ultimate answer to "How is Ariakit different from X?"
You're given a design with complex components with very specific requirements. You look for a library to make your work easier. After a few days of puzzling over the options, you realize that you won't be able to implement the component exactly how it was designed. [1/6]
1
7
Ariakit retweeted
Replicating Twitter hovercard with keyboard support using Ariakit. ✨ The disclosure button appears when the hovercard anchor receives keyboard focus.

ALT Programming a hovercard component similar to the Twitter one with more information about a user. Testing the component with the mouse by hovering over the username anchor, and then with keyboard, by clicking on a disclosure button that appears when the username anchor receives keyboard focus.

5
29
Ariakit retweeted
Had a lot of fun building this example with a few Ariakit components: a Select with custom items, including one that opens a Dialog with a Form. ✨ + Keyboard and screen reader support + Automatic focus management + Your creativity = Infinite possibilities 😄

ALT Using a custom select element labeled as "Account". The value has the selected user's photo, name, and email address. When the Select is open, there are two account options and a third option to add another account. When the third option is activated, a dialog opens with an input labeled as "Email". Once the form is submitted, the dialog closes and the focus moves back to the Select element with the newly added user as the value. Opening the Select popup again will also show the newly added user.

3
3
94
In January, we received $55 from 8 financial contributors and we spent $16. Our current balance is $1,201. Thank you! 🙏 opencollective.com/ariakit
Ariakit retweeted
Testing a multi-selectable Combobox component with a screen reader. It announces "selected" and "not selected" (because of the "aria-selected" attribute). Focusing on the container element announces the selected items (because of the "aria-multiselectable" attribute).
1
1
33
Ariakit retweeted
Testing the new Ariakit Select component with the other components in the library. It works great with Combobox, which means we can easily create this custom select with a search field. 😍 What else would you like to see?

ALT Using a custom select component with a search field with mouse and keyboard.

6
3
78
Ariakit retweeted
Working on the new Select component. - Proper semantics and screen reader support. - Keyboard navigation. - Typeahead with the popup open or closed. - And more (will share more details soon).

ALT Using a custom select component using the mouse and the keyboard (arrow keys and characters).

1
6
139
Ariakit retweeted
Building a multi-select combo box using Ariakit Combobox and Checkbox components. 🤯

ALT Programming a multi-select combo box in a time-lapse using React

9
11
213
Ariakit retweeted
A lot of UX problems would be solved if popovers, dropdowns, flyouts, etc. were just modal dialogs on mobile.

ALT Programming a popover component that turns into a modal dialog on small screens.

3
17
310
Ariakit retweeted
Building an accessible popover UI with Ariakit. 👌

ALT importing Popover components from "ariakit/popover" and using them in a React function component to create a popover UI.

1
6
63
In December, we received $55 from 8 financial contributors and we spent $16. Our current balance is $1,166. Thank you! 🙏 opencollective.com/ariakit
Ariakit retweeted
Another update on the Form component: dynamic array fields. - Built-in state & focus management. - FormRemove & FormPush components. - Supports native browser validation on each field. - Supports nested objects. And more... 🧵

ALT Creating array fields with the Ariakit Form component.

3
9
96
Ariakit retweeted
The Form component is finally happening: - TypeScript support for field names. - Accessible by default. - Focus management. - Native browser validation. And more... 🧵

ALT Coding a Form component by importing components from the ariakit package. The form has one field (name) with a label. Then, a field error element is added. Finally, a submit handler is added.

9
66
752