@ 轴- ds/ 主题
(原始内容存档于2018-10-21). AXIS Design System QQ.
설치
npm install @axis-ds/theme
# or
pnpm add @axis-ds/theme
사용법
import { ThemeProvider, useTheme } from '@axis-ds/theme';
export default function App() {
return (
<ThemeProvider defaultTheme="system">
<YourApp />
</ThemeProvider>
);
}
QQ (Next.js App路由器) (英语)
1.5.0 부터 전체가 "use client" 모듈이라,서버也 app/layout.tsx 에서 ThemeProvider {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢 providers.tsx(单位:千美元)'use client') qq( 1. 4. 0 ) qq 导入 qq createContext is not a function {\fn华文仿宋\fs16\1cHD1D1D1}好! {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得怎么样.
// app/layout.tsx (서버 컴포넌트)
import { ThemeProvider } from '@axis-ds/theme';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="ko" suppressHydrationWarning>
<body>
<ThemeProvider defaultTheme="system">{children}</ThemeProvider>
</body>
</html>
);
}
ThemeProvider* 个道具(defaultTheme• 妇女storageKey• 妇女defaultBrand• 妇女brandStorageKey{\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得怎样.children으로.useTheme(){\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得怎样'use client'파일,에서만. {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢Attempted to call useTheme() from the server오류가.- {\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得怎样.
문서
자세한 AXIS 设计系统를.
라이선스
麻省理工学院