Skip to content

Commit 0dff7aa

Browse files
committed
Merge branch 'master' into base-16-styles
2 parents 75a6327 + 7555339 commit 0dff7aa

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Name|Type|Default|Description
3434
`src`|`JSON Object`|None|This property contains your input JSON
3535
`name`|`string`|"root"|Contains the name of your root node
3636
`collapsed`|`boolean`|`false`|When set to `true`, all nodes will be collapsed by default
37+
`theme`|`string`|"rjv-default"|RJV supports base-16 themes. Check out the [list of supported themes here](https://github.com/gaearon/base16-js/tree/master/src). A custom "rjv-default" theme applies by default.
3738
`indentWidth`|`integer`|4|Set the indent-width for nested objects
3839
`enableClipboard`|`boolean`|`true`|When set to `true`, the user can copy objects and arrays to clipboard
3940
`displayObjectSize`|`boolean`|`true`|When set to `true`, objects and arrays are labeled with size
@@ -46,7 +47,19 @@ Name|Type|Default|Description
4647
* Different classes are applied to different types for style interaction
4748

4849
### Customizing Style
49-
update or override `src/style/_variables.scss` to apply your own theme.
50+
RJV now supports base-16 themes!
51+
52+
You can specify a `theme` prop when you instantiate your rjv component.
53+
```
54+
<ReactJson src={my_important_json} theme="monokai" />
55+
```
56+
Check out the [list of supported themes here](https://github.com/gaearon/base16-js/tree/master/src).
57+
58+
#### Monokai theme example
59+
![alt text](https://github.com/mac-s-g/react-json-view/blob/master/doc/output-example-monokai.png?raw=true "Base-16 Theme Example")
60+
61+
#### Solarized theme example
62+
![alt text](https://github.com/mac-s-g/react-json-view/blob/master/doc/output-example-solarized.png?raw=true "Base-16 Theme Example")
5063

5164
### Contributing to the source code:
5265
#### Standard Workflow
@@ -85,6 +98,3 @@ All node modules are installed within the container, so make sure to rebuild you
8598

8699
### To-Do's
87100
1. Add Tests!
88-
2. improve customizability
89-
* allow specific keys to be expanded/collapsed by default
90-
* add a few different themes on top of `_variables.scss`

0 commit comments

Comments
 (0)