From 93a86230c907bd7b4b561e993fba4bcb5907cf0e Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sat, 30 Mar 2024 18:20:40 +0300 Subject: [PATCH] add docs for svg component --- src/content/index.md | 2 +- src/content/reference/components/image.md | 2 +- src/content/reference/components/index.md | 6 ++++++ src/content/reference/components/svg.md | 20 ++++++++++++++++++++ src/sidebarReference.json | 4 ++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/content/reference/components/svg.md diff --git a/src/content/index.md b/src/content/index.md index a7896db..e650a51 100644 --- a/src/content/index.md +++ b/src/content/index.md @@ -35,7 +35,7 @@ export function TodoItem(props) { export function TodoPage() { const lastId = useRef(3); const [items, setItems] = useState([ - { id: 0, text: 'Walk the dog' }, + { id: 0, text: 'Take a walk' }, { id: 1, text: 'Buy groceries' }, { id: 2, text: 'Prepare dinner' }, ]); diff --git a/src/content/reference/components/image.md b/src/content/reference/components/image.md index d62e20c..abde44d 100644 --- a/src/content/reference/components/image.md +++ b/src/content/reference/components/image.md @@ -3,7 +3,7 @@ title: layout: API --- -`` creates an image component. Alternatively, `` creates a raw image component and `` creates a svg image component (requires `Unity.VectorGraphics` package). +`` creates an image component. Alternatively, `` creates a raw image component and `` creates a svg image component (requires `Unity.VectorGraphics` package). diff --git a/src/content/reference/components/index.md b/src/content/reference/components/index.md index 8da25d6..21b9673 100644 --- a/src/content/reference/components/index.md +++ b/src/content/reference/components/index.md @@ -13,11 +13,17 @@ This page lists the Components supported by ReactUnity in alphabetical order. - icon - image - input +- prefab +- portal +- object - rawimage - render +- richtext - script - scroll - style +- svg +- svgimage - text - toggle - video diff --git a/src/content/reference/components/svg.md b/src/content/reference/components/svg.md new file mode 100644 index 0000000..5f4430c --- /dev/null +++ b/src/content/reference/components/svg.md @@ -0,0 +1,20 @@ +--- +title: +layout: API +--- + +`` can be used to render inline SVG. It requires the `Unity.VectorGraphics` package. + +Can be used with [React Icons](https://react-icons.github.io/react-icons/) or similar libraries too. + + + +```js +export default function App() { + return + + +}; +``` + + diff --git a/src/sidebarReference.json b/src/sidebarReference.json index 0cd1cc8..55274aa 100644 --- a/src/sidebarReference.json +++ b/src/sidebarReference.json @@ -81,6 +81,10 @@ "title": "style", "path": "/reference/components/style" }, + { + "title": "svg", + "path": "/reference/components/svg" + }, { "title": "video", "path": "/reference/components/video"