@scalar/api-reference-react 0.7.19 → 0.7.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +3 -44
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,54 +1,13 @@
|
|
|
1
|
-
# Scalar API Reference React
|
|
1
|
+
# Scalar API Reference Component for React
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@scalar/api-reference-react)
|
|
4
4
|
[](https://www.npmjs.com/package/@scalar/api-reference-react)
|
|
5
5
|
[](https://www.npmjs.com/package/@scalar/api-reference-react)
|
|
6
6
|
[](https://discord.gg/scalar)
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Documentation
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
npm install @scalar/api-reference-react
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
The API Reference package is written in Vue. That shouldn’t stop you from using it in React, though. We have created a client side wrapper in React:
|
|
17
|
-
|
|
18
|
-
> [!WARNING]\
|
|
19
|
-
> This is untested on SSR/SSG!
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
import { ApiReferenceReact } from '@scalar/api-reference-react'
|
|
23
|
-
import '@scalar/api-reference-react/style.css'
|
|
24
|
-
|
|
25
|
-
function App() {
|
|
26
|
-
return (
|
|
27
|
-
<ApiReferenceReact
|
|
28
|
-
configuration={{
|
|
29
|
-
url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml',
|
|
30
|
-
}}
|
|
31
|
-
/>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default App
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
We wrote a [detailed integration guide for React](https://github.com/scalar/scalar/tree/main/documentation/integrations/react.md), too.
|
|
39
|
-
|
|
40
|
-
### Example
|
|
41
|
-
|
|
42
|
-
You can find an example in this repo under [examples/react](https://github.com/scalar/scalar/tree/main/examples/react)
|
|
43
|
-
|
|
44
|
-
## Props
|
|
45
|
-
|
|
46
|
-
ApiReference only takes one prop which is the configuration object.
|
|
47
|
-
|
|
48
|
-
### configuration: ReferenceProps
|
|
49
|
-
|
|
50
|
-
You can find the full configuration options under
|
|
51
|
-
[packages/api-reference](https://github.com/scalar/scalar/tree/main/packages/api-reference).
|
|
10
|
+
[Read the documentation here](https://guides.scalar.com/scalar/scalar-api-references/integrations/react)
|
|
52
11
|
|
|
53
12
|
## Community
|
|
54
13
|
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"testing",
|
|
19
19
|
"react"
|
|
20
20
|
],
|
|
21
|
-
"version": "0.7.
|
|
21
|
+
"version": "0.7.20",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"module": "./dist/index.js",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@scalar/api-reference": "1.31.
|
|
42
|
+
"@scalar/api-reference": "1.31.15",
|
|
43
43
|
"@scalar/types": "0.2.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|