Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@qwik-ui/[email protected]
Minor Changes
100% Lazy execution (by @thejackshelton in #737)
The entire Qwik UI library does not execute code until interaction. Your components are HTML, until the user decides to interact with them.
Bundling improvements
We have reduced the bundle size significantly of the headless library. If you are a Qwik library author, please refer to this issue as it may impact your bundle size as well.
Dot notation
The biggest change of v0.4 is the addition of dot notation to the API. Also known as "namespaced components".
This includes our largest breaking change to Qwik UI yet. We hope it is the largest ever, and want to ensure a much smoother transition going forward. Before we can do that, we need to make sure the API's are consistent across the library.
The component API's have been updated to use dot notation.
We believe that dot notation will significantly improve the developer experience. Below are some of the benefits of dot notation.
Simple Imports
In previous versions, imports needed to be defined for each component.
While this is trivial with three components, it can be a pain with the more "pieces" a component has.
In v0.4, the new import syntax is the following:
TypeScript Autocomplete
The searchability of available components has also been improved. You can now use the autocomplete feature to find a specific sub-component.
Improved legibility
For longer component names, the dot notation is arguably more legible. For example,
Combobox.Listbox
vs.ComboboxListbox
.Migration Cheat Sheet
As an easier way to migrate, we've created a mini cheat sheet below. If you have any questions, or need help migrating, don't hesistate to reach out to us on Discord.
Components named , like are now <Accordion.Root />
With new root components, the main props have been moved to the root component. (for example, props previously on the Popover and Modal panels).
Ex:
For further reference, read the RFC on dot notation.
Popover Refactor
Based on feedback we have received from the community, we have also improved the developer experience of the Popover component.
hover
prop has also been introduced on the root, useful for things like tooltips.<Popover.Root />
that is passed to theusePopover
hook. Refer to the docs for more info.data-open
and `data-closing
attributes instead.data-open
,data-closing
, anddata-closed
data attributes have been added to the popover.<Popover.Root />
There is a new root compomnent. Configurable props have been moved to the root component.
Deprecated Props
:popover-open
. Instead, use thedata-open
attribute for it to style across browsers.popovertarget
prop to the<Popover.Trigger />
component. Same with an id prop on the<Popover.Panel />
component.placement
prop has been deprecated, and combined with thefloating
prop.For example,
floating="right
will now float the popover to the right.Opting out of the floating library
To opt-out of the floating library, set the
floating={false}
on the<Popover.Root />
component.May 2024, Chrome will be adding support for the CSS anchor API. This will allow us to remove the floating UI library entirely when that gains more support across browsers.
Docs Improvements
A couple of docs improvements have been made:
qwikest/icons
package rather than an abstract component you could not use.Modal API Changes (by @thejackshelton in #734)
In a previous release, the following components have been deprecated:
These components were native header, div, and footer elements and did nothing special under the hood. We are deprecating them in order to simplify the API and make it more consistent with the rest of the components.
The new components are:
<Modal.Root>
This is the main container of the modal, and now holds the major props and configuration. Examples include:
<Modal.Panel>
Previously
<Modal />
the modal panel is the dialog element that is rendered on top of the page. Its props have since been moved to the<Modal.Root />
component, please refer to the docs for more information.<Modal.Trigger>
The modal now comes with a default trigger, which will open the modal when clicked.
<Modal.Title>
This computes the accessible name from the string children of the modal.
<Modal.Description>
This computes the accessible description from the string children of the modal.
<Modal.Close>
This is a button that closes the modal when clicked.
Select API Changes (by @thejackshelton in #724)
<SelectOption />
has been renamed to<Select.ItemLabel />
.<Select.Value />
has been renamed to<Select.DisplayValue />
.<Select.Item />
A new component that allows for customize of the list item.
<Select.ItemIndicator />
This component is used to render an icon or other visual element that is displayed next to the
<Select.ItemLabel />
whenever an item is selected.Multi-select
To opt-in to the multi-select mode, set the
multiple
prop totrue
. Please refer to theMultiple Selections
section in the docs for more information.The previous API did not allow for customization of list items. The new API introduces a couple new components:
You can now put anything you'd like in your
<Select.Item />
, just like a normal li tag!There is a new reactive signal called
bind:displayValue
that can be used to read the value of the display text. There is a new docs example that shows this in action with item pills.bind syntax
We have been exploring more with the
bind
syntax.bind:x
is a convention based onbind:value
andbind:checked
, where a signal is passed and two way data binding is enabled.As a general note:
name -> initial value
anything that does not start with
bind:
is a static value.bind:name -> reactive signal
anything that starts with
bind:
is a reactive signal.If you find yourself curious to explore the bind syntax more, try typing
bind:
on a root component in Qwik UI, you should see a list of available things you can reactively customize!Tooltip (by @thejackshelton in #733)
The Tooltip component has been refactored from the ground up to be more accessible and performant.
It is now built on top of the popover primitive, and has a similar API.
It remains in
draft
status, and is not yet ready for production use. We will be working on it more deeply in the near future.Accordion
The Accordion has been refactored from the ground up to be more accessible and performant.
Accordion.Root
behavior="multi"
prop has been deprecated withmultiple
on the<Accordion.Root />
component.animated
prop has been removed. Animations are now automatically detected!onSelectIndexChange# Changelog has been deprecated and removed in favor of
onChange# Changelog.bind:value
prop.value
prop.disabled
prop.Accordion.Item
<Accordion.Item />
component with thevalue
prop.disabled
prop to true on the<Accordion.Item />
component.For more information, please refer to the updated Accordion documentation.
Collapsible
onOpenChange# Changelog prop has been deprecated. Use the
onChange# Changelog prop instead.For more information, please refer to the updated Collapsible documentation.
Deprecated Components
In 0.4, we have deprecated the following headless components:
Most of these components were in a pre-alpha state, duplicates from the styled kit, or were not yet ready for production use. They were lying around in the codebase for a while, and we have gained many insights since then on creating accessible, unstyled, and performant components.
You can expect the Toast and the Tooltip to come back with a much more polished form in a future release.
Patch Changes
@qwik-ui/[email protected]
Minor Changes
tailwind.config.cjs (by @maiieul in #753)
tailwindcss-animate
The tailwind config now uses tailwindcss-animate
Instead of manually defined animations through a custom plugin like
New keyframes
We added
to the tailwind config. You will need those for the styled accordion to be animated.
Modal refactor
Modal.Panel
The Panel now uses tailwindcss-animate and comes built-in with 5
position
variant propsover previous tailwind.config.js home-made plugin
to avoid re-inventing the wheel.
Modal.Title
Title now holds
text-lg font-semibold
classes.Modal.Description
Description now holds
text-muted-foreground
class.Accordion
We changed the accordion animations. So make sure to update your taiwind config accordingly (explained at the beginning of the changeset!).
Patch Changes
✨ new styled select component 🎉 (by @maiieul in #759)
Styled button now uses
transition-all
for every variant shared class (by @maiieul in #753)