Code generation
React
This will generate a jsx-file with React component (and type definitions .d.ts
if you use TypeScript):
Components are ready to be embedded, like in MDX.
The examples on this website are rendered with this approach.
Property | Description |
---|---|
viewId | Typed enumeration of your views |
interactive | Clicking on the view opens a modal with the views browser. Default value is true . |
background | Options: dots , lines , cross , transparent , solid , or undefined .Default value is dots . |
overlay | Customize the views browser overlay. Check the available types. |
Any other property will be passed to the underlying div
element.
Webcomponent
You can use it in your HTML:
By default, this will generate a likec4-view
webcomponent.
To change the prefix use option -w, --webcomponent-prefix
.
For example:
Typed Model
Generate a TypeScript file with LikeC4Views
object, which contains all diagrams and their metadata.