File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments