@gluestack-ui/nativewind-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.24 • Public • Published

@gluestack-ui/nativewind-utils

A utility function package for @gluestack-ui/nativewind

Installation

To install the component, run the following command in your terminal. This will add the component to your project's dependencies and allow you to use it in your project.

npx install @gluestack-ui/nativewind-utils

Usage

// import the tva
import { tva } from '@gluestack-ui/nativewind-utils';

// Understanding the API
const buttonStyle = tva({
  base: 'bg-primary-500',
  variants: {
    size: {
      lg: 'w-6 h-6',
      md: 'w-5 h-5',
      sm: 'w-4 h-4',
    },
  },
});

const buttonText = tva({
  base: 'text-white',
  parentVariants: {
    size: {
      lg: 'text-lg',
      md: 'text-md',
      sm: 'text-sm',
    },
  },
});

// Using the in component
export default ({ size, ...props }) => (
  <Pressable className={buttonStyle({ size })} {...props}>
    <Text className={buttonText({ parentVariants: { size } })}>
      Hello World!
    </Text>
  </Pressable>
);

/@gluestack-ui/nativewind-utils/

    Package Sidebar

    Install

    npm i @gluestack-ui/nativewind-utils

    Weekly Downloads

    3,493

    Version

    1.0.24

    License

    none

    Unpacked Size

    27.9 kB

    Total Files

    61

    Last publish

    Collaborators

    • rajat693
    • sravankumarvelangi
    • vaibhk002
    • daminipandey
    • rayan1810
    • amars29
    • geekgautam
    • gluestackadmin
    • geekashwini
    • vidhi499
    • mayankp06
    • madhavb230100
    • viraj-10
    • rohit_singh
    • meenumakkar
    • surajahmedc