feat: tag
Closes #
๐ Description
This PR introduces TagGroup and Tag components for managing tag collections with selection and removal, and ErrorMessage component for validation error messages. Both follow React Aria Components patterns and integrate with HeroUI's design system.
โณ๏ธ Current behavior (updates)
N/A
๐ New behavior
TagGroup & Tag
-
Composable API:
TagGroup,TagGroup.List,Tag,Tag.RemoveButton -
Features:
- Selection modes:
none,single,multiple(controlled/uncontrolled) - Keyboard navigation (Arrow keys, Delete/Backspace)
- Remove button via
Tag.RemoveButton - Disabled states (group and individual)
- On-surface variant support
- Size variants (
sm,md,lg) with group-level inheritance - Render props support
- Selection modes:
- Accessibility: Full ARIA support via React Aria TagGroup primitive
- Styling: BEM-based CSS with interactive states
- Documentation: 10 demos (basic, sizes, disabled, selection modes, controlled, on-surface, error message, prefix, remove button, list data)
ErrorMessage
- Simple API: Standalone component for validation errors
-
Features:
- Automatic
slot="errorMessage"integration - Danger color styling with truncation
- Smooth transitions
- Automatic
- Documentation: 2 demos (basic, TagGroup integration)
New Components:
-
TagGroup,TagGroup.List,Tag,Tag.RemoveButton,ErrorMessage
Additional Changes:
- Enhanced
composeTwRenderPropsutility for render-props support - Added
useListDatahook for list data management - Fixed Storybook link generation for grouped titles
๐ฃ Is this a breaking change (Yes/No):
No
๐ Additional Information
-
useListData Hook: Added for immutable list data management (item operations, selection, filtering). Based on Adobe React Spectrum's
@react-stately/data(copied to avoid bundle size increase). Licensed under Apache License 2.0. -
Storybook Links Fix: Updated
convertStorybookTitleToPathto handle grouped Storybook titles (e.g.,Components/Collections/TagGroup). -
Full TypeScript support and Storybook stories included.
โ ๏ธ No Changeset found
Latest commit: 4f00f57d61d8bf9cf5217621bfb9cdf8af4e4c08
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Review | Updated (UTC) |
|---|---|---|---|
| heroui | Preview, Comment | Dec 14, 2025 6:51pm | |
| heroui-sb | Preview, Comment | Dec 14, 2025 6:51pm |
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
โจ Finishing touches
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
feat/v3-tag
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
npm i https://pkg.pr.new/heroui-inc/heroui/@heroui/react@5971
npm i https://pkg.pr.new/heroui-inc/heroui/@heroui/styles@5971
commit: 4f00f57