Index of every page on this site: llms.txt
All skills
tristanmanchester avatar

/styling-nativewind-v4-expo

@3323bc9
Run it yourself

Set up, repair, and build components with NativeWind v4 and Tailwind CSS v3 in Expo React Native apps. Use for an explicitly v4 project, v4 configuration failures, className interoperability, or v4 theming; not for NativeWind v5 or generic web Tailwind setup.

Use this Skill: https://skilld.dev/gh/tristanmanchester/agent-skills/styling-nativewind-v4-expo

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespatterns.md

≈744 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Components, variants, and overrides

Class composition is not conflict resolution

Use literal utility strings so Tailwind can discover them. Template concatenation, clsx, and classnames combine strings; they do not guarantee that a later conflicting Tailwind class overrides an earlier one. Define non-conflicting variants, or use an explicitly chosen merging policy.

For NativeWind v4/Tailwind v3, the tailwind-merge maintainer directs users to v2.6.0 (npm install tailwind-merge@^2.6.0). Its current latest major targets Tailwind v4. NativeWind-specific/custom utility groups may need merger configuration and native verification; do not assume a web utility merger understands every extension.

Typed button example

This example deliberately accepts ordinary React children, not Pressable's render-function children. Supporting a render function requires evaluating it with Pressable's state rather than placing the function inside Text.

import type { ComponentProps, ReactNode } from 'react';
import { Pressable, Text } from 'react-native';
import { twMerge } from 'tailwind-merge';

const variants = {
  primary: { container: 'bg-blue-600 active:bg-blue-700', label: 'text-white' },
  secondary: { container: 'bg-zinc-200 dark:bg-zinc-800', label: 'text-zinc-900 dark:text-zinc-50' },
} as const;

type ButtonProps = Omit<ComponentProps<typeof Pressable>, 'children' | 'className'> & {
  children: ReactNode;
  variant?: keyof typeof variants;
  className?: string;
  labelClassName?: string;
};

export function Button({ children, variant = 'primary', className,
  labelClassName, disabled, accessibilityState, ...props }: ButtonProps) {
  const selected = variants[variant];
  return (
    <Pressable
      {...props}
      accessibilityRole={props.accessibilityRole ?? 'button'}
      disabled={disabled}
      accessibilityState={{ ...accessibilityState, disabled: Boolean(disabled) }}
      className={twMerge('rounded-md px-4 py-2', selected.container,
        disabled && 'opacity-50', className)}
    >
      <Text className={twMerge('font-semibold', selected.label, labelClassName)}>
        {children}
      </Text>
    </Pressable>
  );
}

Choose labels/content appropriate to the component; this is a text-labelled button, not a universal arbitrary-layout wrapper. Preserve focus, accessibility labels, disabled semantics, and adequate touch targets in the actual design. Test dark mode, pressed state, font scaling, and any consumer override.

Use a variants library only when its complexity solves a real need. class-variance-authority is the package name for the commonly used cva function; do not install a similarly named package by guessing. Reuse the app's established variant system before adding another dependency.

Sources reviewed 2026-09-13: NativeWind custom components, tailwind-merge compatibility.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo5 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides comprehensive configuration guides and templates for setting up NativeWind v4 in Expo projects. Analysis identified minor security risks, including the recommendation to use a third-party project initialization tool and the potential for indirect prompt injection when auditing repository files for configuration errors.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer8mo

    6/6 files flagged

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 3323bc9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Steadyupdated last month
metadata
{
  "version": "2.0.0",
  "reviewed": "2026-09-13"
}
Other metadata
compatibility
An Expo project using nativewind major 4 and tailwindcss major 3. Native peer versions must match the project's Expo SDK.

README badge

README badge for tristanmanchester/agent-skills/styling-nativewind-v4-expo