Overview
Uniwind Pro supports Tailwind’sgroup variants natively. A parent component marked with group propagates its interaction state (pressed, focused) to any descendant using group-* variants.
Group variants work on React Native with the same classNames you’d use on the web. Migrating a web codebase stays trivial. No conditional logic, no platform-specific hooks.
Usage
Basic group
Wrap descendants in a component marked withgroup, then use group-active:* (press) or group-focus:* on any child:
Pressable is pressed, both Text color and View background animate to their group-active:* values. On release, they revert.
Named groups
Distinguish specific ancestors by giving a group a name withgroup/{name} syntax. Descendants target that name with group-active/{name}:*:
Multiple descendants
One press fans out to any number of descendants. No tree traversal per press, just a lookup of pre-indexed group descendants:Supported States
| Variant | Triggered by |
|---|---|
group-active:* | Parent is pressed (touch-down) |
group-focus:* | Parent receives focus (TV remote, keyboard, or TextInput tap) |
React Native has no pointer hover. Use
group-active:* for press state. group-hover:* is a web-only Tailwind variant and has no effect in Uniwind native.Supported Group Parents
Only components that drive shadow-tree updates from their own press/focus events can act as agroup container:
| Component | Supported events |
|---|---|
Pressable | press, focus |
Text | press (requires onPress) |
TouchableOpacity, TouchableHighlight, TouchableWithoutFeedback, and TextInput do not act as group parents. Wrap them in a Pressable marked group if you need group propagation around one.Zero Cost for Non-Group Components
If a component doesn’t use anygroup or group-* class, it pays zero cost for this feature:
- No extra hooks, no context subscriptions
- No entry in any group map
- No event handlers wired up
isGroup or hasGroupDependency at link time. Everything else bypasses the group pipeline.
Unsupported Patterns
group-hover
group-hover
React Native has no pointer hover state. Use
group-active:* for press. group-hover:* is not parsed on native.Arbitrary group selectors
Arbitrary group selectors
Web Tailwind supports
group-[.is-published]:block and similar selector-based group variants. These have no equivalent in a non-CSS engine and are not supported on React Native.group-disabled
group-disabled
disabled is a static prop in React Native, not an interaction state. When it changes, React re-renders the subtree and children read their own props. group-disabled:* is parsed but does not trigger shadow tree updates at runtime.Implicit in-*
Implicit in-*
Tailwind 4’s implicit
in-* variants (styling any ancestor match) are not supported. Use explicit group markers instead.Related
Shadow Tree Updates
The C++ engine that powers group propagation
Tailwind: group variants
Reference for Tailwind’s group variant syntax