# Choice Container

## Component Structure

The following code is this component's initial HTML structure. Remember you can change this structure any time by using the [`template()` component built-in function](/documentation/building-blocks/components/built-in-functions.md#get-or-modify-the-html-structure).

```javascript
const choices = this.props.choices.map ((choice) => {
    if (typeof choice.Clickable === 'function') {
        return new Promise ((resolve, reject) => {
            this.engine.assertAsync (choice.Clickable, this.engine).then (() => {
                resolve (`<button data-do="${choice.Do}" ${ choice.Class ? `class="${choice.Class}"`: ''} data-choice="${choice._key}">${choice.Text}</button>`);
            }).catch (() => {
                resolve (`<button data-do="${choice.Do}" ${ choice.Class ? `class="${choice.Class}"`: ''} data-choice="${choice._key}" disabled>${choice.Text}</button>`);
            });

        });
    }
    return Promise.resolve (`<button data-do="${choice.Do}" ${ choice.Class ? `class="${choice.Class}"`: ''} data-choice="${choice._key}">${choice.Text}</button>`);
});

return Promise.all (choices).then ((choices) => `
    <div data-content="wrapper">
        ${ choices.join('') }
    </div>
`);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.monogatari.io/documentation/components/choice-container.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
