forked from neo4j/neo4j-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document neo4j-arc theming customization
- Loading branch information
Showing
4 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
:description: This section describes how styling is implemented in neo4j-arc and how to customize it | ||
|
||
[[neo4j-arc-themes]] | ||
= Theming | ||
|
||
neo4j-arc has full theming support via | ||
https://qubitpi.github.io/styled-components-website/docs/advanced#theming[styled-component] , which provides a theme to | ||
all neo4j-arc components underneath itself via the context API. In the render tree all styled-components will have | ||
access to the provided theme, even when they are multiple levels deep. | ||
|
||
Themes are passed down to a component using the `theme` prop | ||
|
||
Create a file named *themes.ts*: | ||
|
||
[source,typescript] | ||
---- | ||
export const theme = { | ||
frameSidebarBackground: "transparent", | ||
}; | ||
---- | ||
|
||
Load the themes: | ||
|
||
[source,typescript] | ||
---- | ||
import { ThemeProvider } from "styled-components"; | ||
import { theme } from "./themes"; | ||
export default function MyGraphComponent(): JSX.Element { | ||
const themeData = theme; | ||
return ( | ||
<ThemeProvider theme={themeData}> | ||
<GraphVisualizer | ||
... | ||
/> | ||
</ThemeProvider> | ||
); | ||
} | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters