@artsy/palette-mobile

中文文档
24.22.0发布于 2026/11/17MITTypeScriptCommonJS近 30 天下载 4680

Artsy's design system for React Native

原始使用文档
文档目录13 节
  1. Meta
  2. What is Palette?
  3. Does my component belong in Palette?
  4. Looking for home view components?
  5. How to contribute
  6. Local development
  7. Deploying to TestFlight and Play Store
  8. Local Builds
  9. Trigger Cloud Builds via GitHub Actions
  10. Developing Features using Local Versions of Palette
  11. Setup
  12. Repos consuming Palette Mobile
  13. About Artsy

Palette Mobile

@artsy/palette-mobile npm version CircleCI

Artsy's Design System on Mobile

Meta

What is Palette?

Palette is a collection of primitive, product-agnostic elements that help encapsulate Artsy's look and feel at base level. This project is intended to be used across our digital product portfolio.

Does my component belong in Palette?

If the component applies to Artsy as a brand and can/will be used across multiple digital products, then Palette is a great place for it. If it's highly product specific then it's best to leave the component where it's used. We can always move things later!

Looking for home view components?

The server-driven home view architecture launched in Eigen (Q4 2024) makes use of a standard library of home view section components.

Those components may make use of palette-mobile primitives, but they are not defined here. Instead they are defined directly in Eigen and documented in this Notion page.

If the above guidance still doesn't give you a good sense of what to do, please join the mobile practice meetings.

How to install

  • Install main library
yarn add @artsy/palette-mobile
  • Install native peer deps
yarn add react-native-haptic-feedback react-native-linear-gradient react-native-reanimated react-native-svg react-native-safe-area-context

How to contribute

If you'd like to add a new component to Palette please create an issue using the component spec template. That'll give both design and engineering a chance to peek at the proposal and provide feedback before moving forward.

Local development

mise install

If you are still using asdf:

asdf install

Set up using:

yarn install
yarn setup:artsy
yarn install:all

Run using:

yarn ios

or

yarn android

Deploying to TestFlight and Play Store

Local Builds

Build and submit both iOS and Android locally:

brew install eas-cli # First time only
brew install gh # First time only

If Android local build config seems out of sync after changing Example/app.json or native-related dependencies, run:

cd Example
npx expo prebuild --clean

Trigger Cloud Builds via GitHub Actions

yarn deploy-beta

This syncs the version numbers across package.json, Example/package.json, and Example/app.json to match the latest version on main, then force-pushes your current branch to beta-ios and beta-android, which triggers the iOS and Android beta workflows on GitHub Actions. (https://github.com/artsy/palette-mobile/actions).

Developing Features using Local Versions of Palette

When developing new components in Palette, it's often useful to test those components in consuming apps (such as Eigen). However, due to the poor support for symlinks in React Native, this can be difficult. Enter yalc. Yalc is a mini package manager that one can publish to and install from, which makes it easy to test code in realtime from outside of your app.

Note: @artsy/palette-mobile uses Storybooks for developing features; work there first! Then, when ready (and if necessary), test your code locally using the flow described below. You can also publish npm canary releases from the palette-mobile repo by attaching a canary label to your PR.

Setup

  • Install yalc globally:
yarn global add yalc
  • Navigate to palette-mobile in the terminal and start the watcher:
cd palette-mobile
yarn local-palette-dev
  • Navigate back to Eigen and link:
cd eigen
yarn local-palette-dev
yarn start

This will update package.json to point at the yalc-published version of palette.

  • When done developing your local palette feature, be sure to unlink:
yarn local-palette-dev:stop

Repos consuming Palette Mobile

You can add this library using yarn add @artsy/palette-mobile. Don't forget to also add all the peerDependencies to your project.

For connecting Palette to a locally running version of our mobile apps, see these docs.

About Artsy

This project is the work of designers and engineers at Artsy, the world's leading and largest online art marketplace and platform for discovering art. One of our core Engineering Principles is being Open Source by Default which means we strive to share as many details of our work as possible.

You can learn more about this work from our blog and by following @ArtsyOpenSource or explore our public data by checking out our API. If you're interested in a career at Artsy, read through our job postings!

版本与发布记录

@artsy/palette-mobile 共发布 636 个版本,首次发布于 2022/09/02;过去 12 个月发布了 87 个版本。

版本发布日期距今
24.22.0latest2026/11/17今天
24.22.0--canary.534.6903.0canary2026/11/0413 天前
24.21.1--canary.534.6888.02026/11/0413 天前
24.21.1--canary.534.6882.02026/11/0413 天前
24.21.02026/11/0314 天前
24.20.02026/10/2028 天前

关于 @artsy/palette-mobile 的常见问题

@artsy/palette-mobile 是什么?

Artsy's design system for React Native

如何安装 @artsy/palette-mobile?

在项目目录运行 npm install @artsy/palette-mobile,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、react-native(*)、react-native-svg(*)、styled-components(>= 5)、react-native-blurhash(*)、react-native-worklets(*)、react-native-pager-view(*)、react-native-reanimated(*)、@d11/react-native-fast-image(*)、react-native-haptic-feedback(*)、react-native-linear-gradient(*)、react-native-collapsible-tab-view(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@artsy/palette-mobile 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@artsy/palette-mobile 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@artsy/palette-mobile 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js 24.x。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@artsy/palette-mobile 可以商用吗?

@artsy/palette-mobile 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@artsy/palette-mobile 的下载量有多少?

根据 npm 官方下载统计,@artsy/palette-mobile 在 2026/10/07 – 2026/11/05 这 30 天内被下载 4,680 次,日均约 156 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@artsy/palette-mobile 还在维护吗?

最新版本 24.22.0 发布于 2026/11/17(今天);至今共发布 636 个版本,其中过去 12 个月发布了 87 个;首次发布于 2022/09/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。