tamagui/tamagui
Fork: 488 Star: 11520 (更新于 2024-11-16 01:31:01)
license: MIT
Language: TypeScript .
Style React fast with 100% parity on React Native, an optional UI kit, and optimizing compiler.
最后发布版本: v1.116.7 ( 2024-10-24 18:09:38)
Style and UI for React (web and native) meet an optimizing compiler
-
@tamagui/core
- Universal style library for React. -
@tamagui/static
- Optimizing compiler that works withcore
andtamagui
. -
tamagui
- UI kit that adapts to every platform.
See tamagui.dev for documentation.
Tamagui lets you share more code between web and native apps without sacrificing the two things that typically suffer when you do: performance and code quality.
It does this with an optimizing compiler that outputs platform-specific optimizations - it turns styled components, even with complex logic or cross-module imports, into a simple div
alongside atomic CSS on the web, or a View with its style objects hoisted on native.
The entirety of Tamagui works at compile time and runtime, and can be set up gradually, with initial usage as simple as importing it and using the base views and styled function.
We recommend checking out the starters with npm create tamagui@latest
, they range from a simple learning example to a production-ready monorepo.
The compiler optimizes most and ultimately flattens a majority of styled components. In the ~500px² responsive browser section of the Tamagui website, 49 of the 55 or so inline styled components are flattened to a div
. The homepage gains nearly 15% on Lighthouse with the compiler on.
Installing Tamagui
To install Tamagui with all its components run:
npm install tamagui @tamagui/config
Next, create a Tamagui config file named tamagui.config.ts
:
import { config } from '@tamagui/config/v3'
import { createTamagui } from 'tamagui'
const tamaguiConfig = createTamagui(config)
// this makes typescript properly type everything based on the config
type Conf = typeof tamaguiConfig
declare module 'tamagui' {
interface TamaguiCustomConfig extends Conf {}
}
export default tamaguiConfig
// depending on if you chose tamagui, @tamagui/core, or @tamagui/web
// be sure the import and declare module lines both use that same name
Note: The v3
config imports the @tamagui/animations-css
driver on web and @tamagui/animations-react-native
on native. You can change these as you please, we provide exports for animationsCSS
and animationsNative
. If you want to use Reanimated, you can copy and paste this code and pass it as animations
to createTamagui
.
Contributing
To contribute to Tamagui reference the contributing guide.
To contribute to documentation reference the writing guide.
最近版本更新:(数据更新于 2024-10-24 22:19:52)
2024-10-24 18:09:38 v1.116.7
2024-10-24 16:26:00 v1.116.6
2024-10-24 15:27:10 v1.116.5
2024-10-24 08:07:25 v1.116.4
2024-10-24 07:31:12 v1.116.3
2024-10-23 08:43:07 v1.116.2
2024-10-22 07:55:48 v1.116.1
2024-10-22 07:03:56 v1.116.0
2024-10-17 17:47:45 v1.115.5
2024-10-16 01:03:06 v1.115.4
主题(topics):
atomic-css, css-in-js, optimizing-compiler, react, react-native, react-native-web, tailwind, typescript, ui, ui-components, vite, webpack
tamagui/tamagui同语言 TypeScript最近更新仓库
2024-11-23 21:18:28 MetaCubeX/metacubexd
2024-11-23 12:44:19 clash-verge-rev/clash-verge-rev
2024-11-23 10:05:04 continuedev/continue
2024-11-23 06:05:56 RSSNext/Follow
2024-11-23 02:27:31 microsoft/TypeScript
2024-11-23 00:25:37 siyuan-note/siyuan