What's Changed
🚀 Features
Dynamic Components
Slider
component for range selections (#1686)Breadcrumbs
for enhanced navigation (#1794)Single selection Autocomplete
leveraginguseComboBox
anduseComboBoxState
Enhanced Navigation Support
- Integrated React Aria Client side router support (#1764)
RTL Layout Support
UI/UX Enhancements
shouldSelectOnPressUp
prop in Tabs/Tab for tab selection behavior (#1688)- Spinner display for icon-only buttons in loading state (#1800)
- Extended ScrollShadow API with
visibility
management features (#1819) emptyContent
,topContent
,bottomContent
properties for Listbox/Menu/DropdownisActive
prop forNavbarMenuItem
- Button hover effect for improved interactivity
⚙️ Refactors
Design and Interaction Improvements
- Transitioned spacing units from
px
torem
for mobile responsiveness (#1688) - Modified Chip font size to
text-tiny
onsm
size (#1688)
Performance and Dependency Optimization
- Adjusted package dependencies to reduce bundle sizes (#1848)
- Upgraded react-aria packages and framer-motion
TypeScript and Animation Enhancements
- Generic TypeScript support for
Menu
andDropdownMenu
(#1691) - Refined Popover animations
- Transitions added to menu/listbox items
UI/UX Refinements
- Improved Input & Select label animations and positioning
- Animated Textarea height styles
- Enhanced theme object with
hoverOpacity
key disableAutosize
prop for Textarea- Card body padding changed from
p-5
top-3
to be the same padding as the other Card elements
🐛 Fixes
- Popover open state handling for different backdrop types (#1812)
- Resolved ButtonGroup radius property issues
- Fixed Pagination custom-items example with key prop
- Supported Collection Items through
extendVariants
function (#1761)
Documentation and Community
- Numerous documentation updates and fixes
- Warm welcome to new contributors: @hyqshr, @c0sc0s, @anshmourya, @syi0808, @jqkk, @cha2hyun, @NalinPlad, and @ubersan
Breaking Changes
- Popover API changed to improve the arrow implementation, arrow is now a pseudo-element, which allows the popover to also move the arrow altogether, this change impacts the Popover, Tooltip and Select implementations.
Popover changes:
<Popover
showArrow
backdrop="opaque"
placement="right"
classNames={{
- base: "py-3 px-4 border border-default-200 bg-gradient-to-br from-white to-default-300 dark:from-default-100 dark:to-default-50",
- arrow: "bg-default-200",
+ base: [
+ // the "before" pseudo element is now the popover' arrow
+ "before:bg-default-200"
+ ],
+ content: [ // now we need to use the "content" slot to actually modify the popover' content styles
+ "py-3 px-4 border border-default-200",
+ "bg-gradient-to-br from-white to-default-300",
+ "dark:from-default-100 dark:to-default-50",
],
}}
>
<PopoverTrigger>
<Button>Open Popover</Button>
</PopoverTrigger>
<PopoverContent>
{(titleProps) => (
<div className="px-1 py-2">
<h3 className="text-small font-bold" {...titleProps}>
Popover Content
</h3>
<div className="text-tiny">This is the popover content</div>
</div>
)}
</PopoverContent>
</Popover>
Tooltip changes:
<Tooltip
showArrow
placement="right"
content="I am a tooltip"
classNames={{
- base: "py-2 px-4 shadow-xl text-black bg-gradient-to-br from-white to-neutral-400",
- arrow: "bg-neutral-400 dark:bg-white",
+ base: [
+ // the "before" pseudo element is now the popover' arrow
+ "before:bg-neutral-400 dark:before:bg-white",
+ ],
+ content: [ // now we need to use the "content" slot to actually modify the popover' content styles
+ "py-2 px-4 shadow-xl",
+ "text-black bg-gradient-to-br from-white to-neutral-400",
+ ],
}}
>
<Button variant="flat">Hover me</Button>
</Tooltip>
Select changes:
<Select
items={users}
label="Assigned to"
className="max-w-xs"
variant="bordered"
classNames={{
label: "group-data-[filled=true]:-translate-y-5",
trigger: "min-h-unit-16",
listboxWrapper: "max-h-[400px]",
}}
listboxProps={{
itemClasses: {
base: [
"rounded-md",
"text-default-500",
"transition-opacity",
"data-[hover=true]:text-foreground",
"data-[hover=true]:bg-default-100",
"dark:data-[hover=true]:bg-default-50",
"data-[selectable=true]:focus:bg-default-50",
"data-[pressed=true]:opacity-70",
"data-[focus-visible=true]:ring-default-500",
],
},
}}
popoverProps={{
classNames: {
- base: "p-0 border-small border-divider bg-background",
- arrow: "bg-default-200",
+ base: "before:bg-default-200", // the before pseudo element controls the popover's arrow
+ content: "p-0 border-small border-divider bg-background", // now instead of the "base" slot we use the "content" slot
},
}}
renderValue={(items) => {
return items.map((item) => (
<div key={item.key} className="flex items-center gap-2">
<Avatar
alt={item.data.name}
className="flex-shrink-0"
size="sm"
src={item.data.avatar}
/>
<div className="flex flex-col">
<span>{item.data.name}</span>
<span className="text-default-500 text-tiny">({item.data.email})</span>
</div>
</div>
));
}}
>
{(user) => (
<SelectItem key={user.id} textValue={user.name}>
<div className="flex gap-2 items-center">
<Avatar alt={user.name} className="flex-shrink-0" size="sm" src={user.avatar} />
<div className="flex flex-col">
<span className="text-small">{user.name}</span>
<span className="text-tiny text-default-400">{user.email}</span>
</div>
</div>
</SelectItem>
)}
</Select>
);
}`;
Dropdown Changes
<Dropdown
showArrow
classNames={{
- base: "py-1 px-1 border border-default-200 bg-gradient-to-br from-white to-default-200 dark:from-default-50 dark:to-black",
- arrow: "bg-default-200",
+ content: "py-1 px-1 border border-default-200 bg-gradient-to-br from-white to-default-200 dark:from-default-50 dark:to-black", // now instead of the "base" slot we use the "content"
+ base: "before:bg-default-200", // the before pseudo element controls the popover's arrow
}}
>
New Contributors
- @hyqshr made their first contribution in #1663
- @c0sc0s made their first contribution in #1665
- @anshmourya made their first contribution in #1655
- @syi0808 made their first contribution in #1651
- @jqkk made their first contribution in #1757
- @cha2hyun made their first contribution in #1781
- @NalinPlad made their first contribution in #1835
- @ubersan made their first contribution in #1850
Full Changelog: https://github.com/nextui-org/nextui/compare/@nextui-org/accordion@2.0.23...@nextui-org/react@2.2.0