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

PropertyTypeExampleDescription
refstringnews-article(Optional) If provided, the webview will update its content.
tintstring#FF0000(Optional) The color used for the confirmation button.
titlestringSelect productRequired. A descriptive title shown at the top of the webview.
onSelect.eventNamestringACCEPTEDRequired. The event name that is triggered when the terms are accepted.
contentstringLorem ipsum dolor...Required. The content displayed in the webview. Markdown formatting is supported.
button.labelstringI agree and accept(Optional) The label text of the confirmation button.