Terms
The Terms component displays your terms of usage in a webview with Markdown-formatted content. It also includes a confirmation button that triggers an event when the terms are accepted. You can use Markdown within the content to format text.
Example Usage
The following code snippet creates a Terms Webview:
const url = await webview.terms.create({
ref: 'terms',
onSelect: {
eventName: 'ACCEPTED'
},
title: 'Accept our terms of usage',
tint: '#000',
content: `
# Title
A simple paragraph with text
## Heading 2
- List item 1
- List item 2
- List item 3
`
})
Reference
Property | Type | Example | Description |
---|---|---|---|
ref | string | news-article | (Optional) If provided, the webview will update its content. |
tint | string | #FF0000 | (Optional) The color used for the confirmation button. |
title | string | Select product | Required. A descriptive title shown at the top of the webview. |
onSelect.eventName | string | ACCEPTED | Required. The event name that is triggered when the terms are accepted. |
content | string | Lorem ipsum dolor... | Required. The content displayed in the webview. Markdown formatting is supported. |
button.label | string | I agree and accept | (Optional) The label text of the confirmation button. |
Updated 29 days ago