Skip to content

Commit ac2c06b

Browse files
docs: moved "how to use" section below the example
I think this makes more sense then the bottom.
1 parent 8f81270 commit ac2c06b

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

docs/plugins/component.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export default ({ Component }) => Component.register(
1515
);
1616
```
1717

18+
Now that you've added your own `Component` plugin you can simply use it using its's ID as the element name. Like so: `<my-component />`, or `<MyComponent>`, or one of its many automatically generated aliases.
19+
1820
## Adding Fields or Functions
1921

2022
You might want your component to use attributes. You store those in fields. To add fields, you can use the component extract utility as follows:
@@ -63,18 +65,6 @@ There are a couple alterations to it though:
6365

6466
There are a couple of requirements for any instance of `Component`. The functions/fields you'll need to implement can be found in the [`#lib/core/components/interfaces.ts.`](https://github.com/Tygo-van-den-Hurk/Slyde/blob/main/lib/core/components/interfaces.ts) file. Depending on the version you have installed these requirements might be different then that the links says. Check both major versions to find out if they are compatible.
6567

66-
## How to use
67-
68-
Now that you've added your own `Component` plugin you can simply use it using its's ID as the element name. Like so:
69-
70-
```XML
71-
<presentation>
72-
<slide>
73-
<my-component />
74-
</slide>
75-
</presentation>
76-
```
77-
7868
## Overriding existing Components
7969

8070
Since plugins load after the original `Component`s load you can override existing `Component` names. This is intentional, in case an existing `Component` by that name does not suit your needs, however I do recommend adding it under a different name instead, however you got the option.

0 commit comments

Comments
 (0)