A Code block UI component
The code block UI component is based on codemirror 6, wrapped in a Lit webcomponent.
``bash`
npm i @qomponent/qui-code-block
`javascript`
import '@qomponent/qui-code-block';
`html`
foo = bar
- properties
- js
- java
- xml
- json
- yaml
- sql
- html
- css
- sass
- markdown
Add showLineNumbers attribute. Example:
`html`
foo = bar
Add editable attribute. Example:
`html`
foo = bar
You can get the value at any time by looking at the value attribute that you set (it's reflective) or you
can add a listener shiftEnter that will contain the new value in event.detail.content when Shift-Enter is pressed.
`javascript`
let newValue = this.shadowRoot.getElementById('code').getAttribute('value');
Add attribute theme. Value can be dark or light;
To run the example:
`bash``
npm install
npm start
Then go to http://localhost:8080/example
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.