{"id":25900528,"url":"https://github.com/coderdiaz/jacaranda","last_synced_at":"2026-01-24T21:32:31.837Z","repository":{"id":279360646,"uuid":"938512959","full_name":"coderdiaz/jacaranda","owner":"coderdiaz","description":"A lightweight styling library for React Native","archived":false,"fork":false,"pushed_at":"2025-04-23T20:08:50.000Z","size":931,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T09:36:14.579Z","etag":null,"topics":["css-in-js","design-tokens","react-native","style-variant-api","styles","variants"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderdiaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"coderdiaz"}},"created_at":"2025-02-25T04:29:54.000Z","updated_at":"2025-04-23T20:08:54.000Z","dependencies_parsed_at":"2025-06-15T16:38:43.626Z","dependency_job_id":"e50888c7-954c-4bfa-8519-bea12127826c","html_url":"https://github.com/coderdiaz/jacaranda","commit_stats":null,"previous_names":["coderdiaz/jacaranda"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/coderdiaz/jacaranda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdiaz%2Fjacaranda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdiaz%2Fjacaranda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdiaz%2Fjacaranda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdiaz%2Fjacaranda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderdiaz","download_url":"https://codeload.github.com/coderdiaz/jacaranda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdiaz%2Fjacaranda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28737313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T21:19:41.845Z","status":"ssl_error","status_checked_at":"2026-01-24T21:13:38.675Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css-in-js","design-tokens","react-native","style-variant-api","styles","variants"],"created_at":"2025-03-03T02:17:18.971Z","updated_at":"2026-01-24T21:32:31.823Z","avatar_url":"https://github.com/coderdiaz.png","language":"TypeScript","funding_links":["https://github.com/sponsors/coderdiaz"],"categories":[],"sub_categories":[],"readme":"![Discover Jacaranda](./docs/meta-jacaranda.jpg)\n\n![NPM Version](https://img.shields.io/npm/v/jacaranda?style=flat)\n![NPM License](https://img.shields.io/npm/l/jacaranda?style=flat)\n![NPM Downloads](https://img.shields.io/npm/dt/jacaranda?style=flat)\n![GitHub Issues](https://img.shields.io/github/issues/coderdiaz/jacaranda?style=flat)\n![GitHub Stars](https://img.shields.io/github/stars/coderdiaz/jacaranda?style=flat)\n\nProvides a way to styling components in React Native with better experience and composability. The key feature is the ability to create multi-variants styles with a type-safe definition inspired by [Stitches](https://stitches.dev/docs/variants) and [CVA](https://cva.style/docs/getting-started/variants) (for React apps).\n\n## Features\n\n- 🎨 Token-based styling system\n- 🧩 Variant API for conditional styling\n- 🔄 Compound variants for complex style combinations\n- 🧠 Type-safe with full TypeScript support\n- 🏎️ Lightweight and performant\n- 🧪 Fully tested\n\n#### Roadmap\n\n- [x] Variants definition.\n- [x] Default variants.\n- [x] Support to define design tokens.\n- [x] Styled function to styling component using design tokens.\n- [x] Use `Stylesheet.create` instead a simple objects.\n- [x] Access to `props` from styles defined into `styled` components.\n- [x] Type-safe registered tokens inside styles.\n- [ ] Default design tokens.\n\n### How to install\n\nAdd the package to your project using one of the following:\n\n```sh\nyarn add jacaranda\n```\n\n```sh\nnpm install jacaranda\n```\n\n```sh\nnpx expo install jacaranda\n```\n\n### Create your config file\n\nTo configure `Jacaranda`, create a `jacaranda.config.ts` file (`.js` works too) to define your reusable design tokens and import the `defineTokens` function.\n\n```tsx\n// jacaranda.config.ts\nimport { defineTokens } from 'jacaranda';\n```\n\nThis function receives an object with the design tokens.\n\n- `colors`: Define your colors design tokens.\n- `space`: Define your spacing.\n- `fonts`: Define your fonts.\n- `fontSize`: Define your font sizes.\n- `lineHeight`: Define your line heights.\n\nAnd returns a `sva` function that you can use to style your components.\n\n```tsx\n// jacaranda.config.ts\nimport { defineTokens } from 'jacaranda';\n\nexport const { sva, tokens } = defineTokens({\n  colors: {\n    primary50: '#ecfeff',\n    primary100: '#cffafe',\n    primary200: '#a5f3fc',\n    primary300: '#67e8f9',\n    primary400: '#22d3ee',\n    primary500: '#06b6d4',\n    primary600: '#0e93d1',\n    primary700: '#1570ad',\n    secondary50: '#ecfdf5',\n    secondary100: '#d9f9eb',\n    secondary200: '#bbfde8',\n    secondary300: '#86f9d9',\n    secondary400: '#0d9488',\n    secondary500: '#027a7b',\n    secondary600: '#016464',\n    secondary700: '#014747',\n  },\n  fontSize: {\n    xs: 4,\n    sm: 8,\n    md: 16,\n    lg: 24,\n    xl: 32,\n    xxl: 40,\n  },\n});\n```\n\n### Import and use it\n\nAfter the tokens are defined, you can use the design tokens in your components. You'll be importing the `sva` function from the `jacaranda.config.ts` file.\n\n#### Available properties:\n\n- `base`: The base styles for the element.\n- `variants`: The different visual styles for the element.\n- `compoundVariants`: Styles that apply when multiple other variant conditions are met.\n- `defaultVariants`: Set a variant by default when no variant is provided.\n\n```tsx\n// Button.tsx\nimport { TouchableOpacity } from 'react-native';\nimport { type VariantProps } from 'jacaranda';\nimport { sva } from './jacaranda.config';\n\ntype ButtonProps = VariantProps\u003ctypeof buttonStyles\u003e \u0026 {\n  children?: React.ReactNode;\n};\n\nexport const Button = (props: ButtonProps) =\u003e {\n  return (\n    \u003cTouchableOpacity style={buttonStyles(props)}\u003e\n      \u003cText\u003eClick me\u003c/Text\u003e\n    \u003c/TouchableOpacity\u003e\n  );\n};\n\nconst buttonStyles = sva({\n  base: {\n    borderRadius: 8,\n  },\n  variants: {\n    intent: {\n      primary: {\n        backgroundColor: '$colors.primary50',\n      },\n      secondary: {\n        backgroundColor: '$colors.secondary50',\n      },\n    },\n    size: {\n      sm: { paddingHorizontal: 8, paddingVertical: 6 },\n      md: { paddingHorizontal: 12, paddingVertical: 8 },\n      lg: { paddingHorizontal: 16, paddingVertical: 10 },\n    },\n  },\n  defaultVariants: {\n    intent: 'primary',\n    size: 'md',\n  },\n});\n```\n\n### TypeScript\n\n#### Extract variants from a component\n\nYou can use the `VariantProps` type to extract the variants from a component.\n\n```tsx\nimport { type VariantProps } from 'jacaranda';\n\ntype ButtonProps = VariantProps\u003ctypeof buttonStyles\u003e;\n```\n\n### Styled Components with Design Tokens\n\nJacaranda provides a `styled` function similar to `styled-components` that allows you to create styled React Native components with access to your design tokens.\n\n#### Key features:\n\n- Create reusable styled components from any React Native component\n- Access design tokens using the `$` prefix (e.g. `$colors.primary50`)\n- Supports all React Native style properties\n\n```tsx\nimport { View } from 'react-native';\nimport { styled } from './jacaranda.config';\n\nconst StyledView = styled(View)({\n  backgroundColor: '$colors.primary50',\n});\n\nexport const Screen = () =\u003e {\n  return \u003cStyledView\u003e\u003c/StyledView\u003e;\n};\n```\n\n#### Access to `props` for conditional properties:\n\n```tsx\nconst StyledView = styled(View)((props) =\u003e ({\n  backgroundColor: '$colors.primary50',\n}));\n```\n\nCopyright @ since 2025 by Javier Diaz\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderdiaz%2Fjacaranda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderdiaz%2Fjacaranda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderdiaz%2Fjacaranda/lists"}