alfresco-ng2-components/docs/insights/widget.component.md
Andy Stark 126e73f5f3 [ADF-2463] Moved user guide pages to a subfolder (#3083)
* [ADF-2463] Moved user guide to a subfolder

* [ADF-2463] Fixed broken links and images
2018-03-16 17:26:39 +00:00

40 lines
1014 B
Markdown

---
Added: v2.0.0
Status: Active
---
# Widget component
Base class for standard and custom widget classes.
## Basic Usage
```ts
import { Component } from '@angular/core';
import { WidgetComponent } from '@alfresco/adf-core';
@Component({
selector: 'custom-editor',
template: `
<div style="color: red">Look, I'm a custom editor!</div>
`
})
export class CustomEditorComponent extends WidgetComponent {}
```
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| readOnly | boolean | false | Does the widget show a read-only value? (ie, can't be edited) |
| field | [FormFieldModel](../core/form-field.model.md) | | Data to be displayed in the field |
## Details
The Widget component is the base class for all standard and custom form widgets. See the
[Form Extensibility and Customisation](../user-guide/extensibility.md) page for full details about
implementing custom widgets.
## See also
- [Extensibility](../user-guide/extensibility.md)