summaryrefslogtreecommitdiff
path: root/docs/src/pages/reference/builtin-components.md
diff options
context:
space:
mode:
authorGravatar Caleb Jasik <calebjasik@jasik.xyz> 2021-08-23 15:43:22 -0500
committerGravatar GitHub <noreply@github.com> 2021-08-23 16:43:22 -0400
commitefb41f22c34948fedfd51ba4e228e807ed7d856a (patch)
treeea5d3a033bb28cdf1578d167afe43551e913cb7d /docs/src/pages/reference/builtin-components.md
parent2fd004dcd99c09fc8eae423c24b31313568f039f (diff)
downloadastro-efb41f22c34948fedfd51ba4e228e807ed7d856a.tar.gz
astro-efb41f22c34948fedfd51ba4e228e807ed7d856a.tar.zst
astro-efb41f22c34948fedfd51ba4e228e807ed7d856a.zip
Add Astro `<Debug/>` component (#675)
* Initial MVP Debug component * Document the prettifying of the input * Just make `<Debug/>` a wrapper around `<Prism/>` lol * feat: add details/summary debug component * chore: remove Props (unused) * fix: prefer `div` to semantic elements * chore: format * fix: prop-drill `class` into components * fix: ensure `astro/components` are evaluated lazily * feat(debug): export debug component from `astro/debug` * fix: minimal example local snowpack config * docs: add debugging docs * chore: add changeset * docs: update debug docs Co-authored-by: Nate Moore <nate@skypack.dev>
Diffstat (limited to 'docs/src/pages/reference/builtin-components.md')
-rw-r--r--docs/src/pages/reference/builtin-components.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/src/pages/reference/builtin-components.md b/docs/src/pages/reference/builtin-components.md
index d148c8ba0..ce64819d9 100644
--- a/docs/src/pages/reference/builtin-components.md
+++ b/docs/src/pages/reference/builtin-components.md
@@ -30,3 +30,22 @@ import { Prism } from 'astro/components';
```
This component provides syntax highlighting for code blocks. Since this never changes in the client it makes sense to use an Astro component (it's equally reasonable to use a framework component for this kind of thing; Astro is server-only by default for all frameworks!).
+
+
+## `<Debug />`
+
+```astro
+---
+import { Debug } from 'astro/debug';
+const serverObject = {
+ a: 0,
+ b: "string",
+ c: {
+ nested: "object"
+ }
+}
+---
+<Debug {serverObject} />
+```
+
+This component provides a way to inspect values on the clientside, without any JavaScript.