gluestack-ui-v5:variants

Create type-safe custom variants for gluestack-ui v5 components using tva.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/sombek/fitness-guidance-app --skill gluestack-ui-v5-variants-sombek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gluestack-ui-v5:variants
Source: https://github.com/sombek/fitness-guidance-app/tree/main/mobile/.agents/skills/gluestack-ui-v5/variants
Command: npx skills add https://github.com/sombek/fitness-guidance-app --skill gluestack-ui-v5-variants-sombek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Repeated className patterns and one-off style overrides fragment a React Native design system. This Skill guides you through consolidating repeated styles into reusable, type-safe component variants for gluestack-ui v5 using tva (Tailwind Variant Authority). ## Core Features & Use Cases - Variant Creation with tva: Define base styles, variant dimensions, default variants, and compound variants for custom components like badges, cards, and buttons. - Extending Existing Components: Add new variants (gradient, glass, neon) to Gluestack components while preserving their built-in variant options. - Parent-Child Variant Relationships: Use React context and parentVariants so sub-components like CardHeader respond to the parent Card's variant state. - Use Case: You notice the same status pill styles repeated across your app. Convert them into a StatusPill component with active, error, and pending variants using semantic tokens only. ## Quick Start Ask the AI to create a Badge component with success, warning, and error variants for gluestack-ui v5 using tva and semantic tokens.

Frequently Asked Questions about gluestack-ui-v5:variants

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create custom variants for gluestack-ui components?

Use tva from @gluestack-ui/utils/nativewind-utils to define base styles, variant dimensions, and defaultVariants, then apply the generated function to your component's className. Wrap the result in a typed React component that accepts variant props and supports className overrides via the class parameter.

How to add new variants to an existing Gluestack Button?

Define additional variant styles with tva, then create a wrapper component whose variant type unions the original options with your new ones. Route built-in variants to the standard Button props and apply custom variant classes through className for the new options.

What is tva in gluestack-ui v5?

tva is Tailwind Variant Authority, a utility for creating type-safe, composable Tailwind class variants. It supports base styles, multiple variant dimensions, compoundVariants for specific combinations, and parentVariants so child components respond to parent state.

Can child components respond to parent variant state?

Yes, share the parent's variant values through React context and define parentVariants in the child's tva config. Children like CardHeader then receive the parent's variant and colorScheme to compute their own styles.

Why are my tva variant classes not applying?

Check that your Tailwind config includes the tva patterns, verify className merge order, and ensure no conflicting inline styles override the generated classes. For parentVariants, confirm the context provider wraps the child components.

When should I not create a component variant?

Skip variants for one-off custom styles, simple modifications achievable with existing props plus className, and styles that belong in the global design system. Variants are for repeated patterns, brand-specific styles, and prop-driven conditional styling.