Skip to content

Commit 9f84509

Browse files
author
patched.codes[bot]
committed
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/sdk/stack-theme.mdx
1 parent 50f3ec2 commit 9f84509

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: StackTheme
3+
---
4+
5+
# StackTheme
6+
7+
A component that applies a theme to its children. It merges the provided theme with default values and handles browser-specific styling.
8+
9+
## Parameters
10+
11+
- `theme` (optional): `ThemeConfig` - Custom theme configuration to override default values.
12+
- `children` (optional): `React.ReactNode` - Child components to be wrapped by the theme.
13+
- `nonce` (optional): `string` - A unique identifier for use with Content Security Policy.
14+
15+
## Example
16+
17+
```tsx
18+
import { StackTheme } from '@stackframe/stack';
19+
20+
// Basic usage
21+
function App() {
22+
return (
23+
<StackTheme>
24+
<YourComponent />
25+
</StackTheme>
26+
);
27+
}
28+
29+
// With custom theme
30+
const customTheme = {
31+
dark: { backgroundColor: '#222' },
32+
light: { backgroundColor: '#f0f0f0' }
33+
};
34+
35+
function ThemedApp() {
36+
return (
37+
<StackTheme theme={customTheme} nonce='unique-nonce'>
38+
<YourComponent />
39+
</StackTheme>
40+
);
41+
}
42+
```

0 commit comments

Comments
 (0)