@gluestack-ui/themed

中文文档
1.1.73发布于 2025/04/08ISCTypeScriptESM + CJS近 30 天下载 17.8万

A universal themed components for React Native, Next.js & React

原始使用文档
文档目录6 节
  1. Introduction
  2. Documentation
  3. Features
  4. Installing gluestack-ui
  5. Tech Stack
  6. Usage

@gluestack-ui/themed

Introduction

gluestack-ui is a universal UI library that provides optionally styled and accessible components. These components are designed for easy integration into applications developed with React and React Native.

Documentation

You can find detailed documentation for each component, including a list of props and examples, in https://v1.gluestack.io/ui/docs website.

Features

  • Dynamic styles: Using JavaScript expressions, you can create dynamic styles that change based on the state of your components.

  • Server-side rendering (SSR) support: This allows you to use the same styles on the server and the client, making it easy to implement SSR for your React applications..

  • Responsive styling:: This allows you to easily create responsive styles that adapt to different screen sizes and resolutions.

  • Theme support: You can easily define and switch between different themes for your application, allowing for a consistent design across all pages.

  • Frequent updates: We are constantly working on improving the library and adding new components. Follow us on GitHub to stay up-to-date on the latest releases and features.

  • Community support: Need help using the library or have a suggestion for a new feature? Join our Discord channel to connect with the community and get support.

Installing gluestack-ui

To use gluestack-ui components, all you need to install @gluestack-ui/themed and its dependencies

npm i @gluestack-ui/themed @gluestack-style/react [email protected]

Tech Stack

JavaScript, React, React Native, Styled System

Usage

To use the gluestack-ui in your project, follow these steps:

  1. Wrap your application with the GluestackUIProvider provided by @gluestack-ui/themed.
import { GluestackUIProvider } from '@gluestack-ui/themed';
import { config } from '@gluestack-ui/config';

// Write this code snippet at the root of your application
function App({ children }) {
  return <GluestackUIProvider config={config}>{children}</GluestackUIProvider>;
}
  1. Now you can use @gluestack-style/react to style your components by using the styled function provided by the library. For example:
import { Button, ButtonText } from '@gluestack-ui/themed';

const StyledButton = styled(
  Pressable,
  {
    bg: '$red500',
    p: '$3',
  },
  {}
);

const StyledButtonText = styled(Text, {}, {});

export const App = () => {
  return (
    <Button>
      <ButtonText>Awesome Button!</ButtonText>
    </Button>
  );
};

More guides on how to get started are available here.

版本与发布记录

@gluestack-ui/themed 共发布 264 个版本,首次发布于 2023/08/17;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.73latest2025/04/081.6 年前
1.1.722025/04/021.6 年前
1.1.712025/03/111.7 年前
1.1.702025/03/031.7 年前
1.1.692025/02/191.7 年前
1.1.682025/02/191.7 年前

其他发布通道:alpha → 1.1.63。

关于 @gluestack-ui/themed 的常见问题

@gluestack-ui/themed 是什么?

A universal themed components for React Native, Next.js & React

如何安装 @gluestack-ui/themed?

在项目目录运行 npm install @gluestack-ui/themed,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16)、react-dom(>=16)、react-native(>=0.72)、react-native-svg(>=13.4.0)、react-native-web(>=0.19)、@types/react-native(>=0.72)、@gluestack-style/react(>=1.0.57)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gluestack-ui/themed 支持 TypeScript 吗?

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

@gluestack-ui/themed 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gluestack-ui/themed 可以商用吗?

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

@gluestack-ui/themed 的下载量有多少?

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

@gluestack-ui/themed 还在维护吗?

最新版本 1.1.73 发布于 2025/04/08(1.6 年前);至今共发布 264 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/08/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。