Guide
Guide
Add a component, render a window, pick a theme.
Install
npx shadcn@latest add @sudokw/primitives-button{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "@gpuix/react"
}
}React 19. @gpuix/native ships prebuilt for Apple Silicon, Linux x64 and
Windows. Any other host builds the binding once, as
apps/playground/README.md
describes.
First component
import { render } from "@gpuix/react";
import { Button } from "@gpuixui/primitives";
import { darkTheme } from "@gpuixui/tokens";
import { ThemeProvider } from "@gpuixui/tokens/react";
render(
<ThemeProvider theme={darkTheme}>
<Button variant="primary" onActivate={save}>
Save changes
</Button>
</ThemeProvider>,
);render takes one element: a fragment at the root paints only its last
child.
Theme
import { getTheme, platformTheme } from "@gpuixui/tokens";
import { ThemeProvider } from "@gpuixui/tokens/react";
const theme = platformTheme(getTheme("dark"), "win32");
<ThemeProvider theme={theme}>{app}</ThemeProvider>;Modes: light, dark. Contrast: default, high. Platforms: darwin,
win32, linux, default.
Next
Edit this page on GitHubapps/docs/content/docs/getting-started/index.mdx