Skip to content

Commit f72d7b9

Browse files
committed
chore: restore framework integration docs
1 parent f5112d4 commit f72d7b9

4 files changed

Lines changed: 164 additions & 1 deletion

File tree

‎packages/storybook/config/preview.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ const preview = {
5353
options: {
5454
panelPosition: 'bottom',
5555
storySort: {
56-
order: ['Docs', ['Welcome', 'Changelog', 'Framework Integration', 'Styleguide', 'Contributing']],
56+
order: [
57+
'Docs',
58+
[
59+
'Welcome',
60+
'Changelog',
61+
['Framework Integration', ['Angular', 'React', 'Vue']],
62+
'Styleguide',
63+
'Contributing',
64+
],
65+
],
5766
},
5867
},
5968
},
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { Meta } from "@storybook/addon-docs";
2+
3+
<Meta title="Docs/Framework Integration/Angular" />
4+
5+
# Integrate with Angular
6+
7+
We set up a demo project with the Angular CLI to show you how to integrate the components into a freshly generated Angular project.
8+
These instructions are based on `angular@12.0.0` and [`angular-cli@12.0.0`](https://cli.angular.io/).
9+
10+
## Step 1: Install `@inovex.de/elements-angular`
11+
12+
We provide an integration layer package for Angular so you can use the inovex Elements as a native Angular library with full type support.
13+
14+
**Using Angular CLI (recommended):**
15+
16+
```bash
17+
ng add @inovex.de/elements-angular
18+
```
19+
20+
> The `ino-icons` are added to your project automatically when you use the Angular CLI.
21+
22+
23+
**Using npm:**
24+
25+
```shell
26+
npm i @inovex.de/elements-angular
27+
```
28+
29+
30+
## Step 2: Update `angular.json` (npm / yarn only)
31+
32+
> This step is only necessary if you installed the Angular wrapper via npm or yarn.
33+
34+
Add the following entry to the build assets
35+
(`projects.<your-project-name>.architect.build.options.assets`) **and** to the
36+
test assets (`projects.<your-project-name>.architect.test.options.assets`):
37+
38+
```json
39+
// ...
40+
{
41+
"glob": "**/*",
42+
"input": "node_modules/@inovex.de/elements/dist/inovex-elements/ino-icon",
43+
"output": "/ino-icon"
44+
}
45+
// ...
46+
```
47+
48+
## Step 3: Import `InoElementsModule`
49+
50+
The Angular wrapper exposes all `@Input` properties and `@Output` events as
51+
typed Angular directives, giving you full IDE auto-completion and compiler
52+
checks.
53+
54+
Import `InoElementsModule` into your app module (or any shared module):
55+
56+
1. Import the module from `@inovex.de/elements-angular`
57+
2. Add it to your `imports` array — you can optionally pass an `InoElementsConfig`
58+
3. Add `CUSTOM_ELEMENTS_SCHEMA` to the `schemas` array
59+
60+
```typescript
61+
import { BrowserModule } from '@angular/platform-browser';
62+
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
63+
import { InoElementsModule } from '@inovex.de/elements-angular';
64+
import { AppComponent } from './app.component';
65+
66+
@NgModule({
67+
declarations: [AppComponent],
68+
imports: [
69+
BrowserModule,
70+
InoElementsModule.forRoot({}),
71+
],
72+
providers: [],
73+
bootstrap: [AppComponent],
74+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
75+
})
76+
export class AppModule {}
77+
```
78+
79+
> **Tip:** If you have multiple feature modules, import `InoElementsModule` once
80+
> in a shared module and re-export it from there.
81+
82+
## Use the Components
83+
84+
That's it — you are now ready to use any inovex Elements component in your Angular templates!
85+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Meta } from '@storybook/addon-docs';
2+
3+
<Meta title="Docs/Framework Integration/React" />
4+
5+
# Integrate with React
6+
7+
Please follow these steps for integration into React.
8+
9+
## Step 1: Install `@inovex.de/elements-react`
10+
11+
```shell
12+
npm i @inovex.de/elements-react
13+
```
14+
15+
## Step 2: Use the components
16+
17+
You can now use the components just like any other React component. Import the components you want to use:
18+
19+
```tsx
20+
import { InoButton, InoInput } from '@inovex.de/elements-react';
21+
22+
function MyComponent() {
23+
return (
24+
<div>
25+
<InoInput label="email" outline />
26+
<InoInput label="password" outline />
27+
<InoButton type="submit">Sign In</InoButton>
28+
</div>
29+
);}
30+
```
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Meta } from "@storybook/addon-docs";
2+
3+
<Meta title="Docs/Framework Integration/Vue" />
4+
5+
# Integrate with Vue.js
6+
7+
Please follow these steps for integration into Vue.
8+
9+
## Step 1: Install `@inovex.de/elements-vue`
10+
11+
```shell
12+
npm i @inovex.de/elements-vue
13+
```
14+
15+
## Step 2: Register the plugin
16+
17+
Open `src/main.js`, import the plugin, and register it with your Vue app:
18+
19+
```javascript
20+
import { createApp } from 'vue';
21+
import { InoElementsVue } from '@inovex.de/elements-vue';
22+
import App from './App.vue';
23+
24+
const app = createApp(App);
25+
app.use(InoElementsVue);
26+
app.mount('#app');
27+
```
28+
29+
## Step 3: Use the components
30+
31+
You can now use the components just like any other Vue component:
32+
33+
```vue
34+
import { InoButton } from "@inovex.de/elements-vue";
35+
36+
<template>
37+
<InoButton>Click me</InoButton>
38+
</template>
39+
```

0 commit comments

Comments
 (0)