> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:select

> Use arc:select as a switch-case block to create complex conditional statements, matching values against arc:case and arc:default keywords.

export const siteNameShort = "Arc";

The `arc:select` keyword is similar to a switch-case block in other programming languages and can be used to create complex conditional statements. The body of `arc:select` can contain one or more [arc:case](./op-arc-case) keywords and one [arc:default](./op-arc-default) keyword.

The value in `arc:select` is matched with those specified in `arc:case`. The body of the `arc:case` statement contains the keywords and statements to execute if the value specified matches the value in the `arc:select` keyword.

The body of the `arc:default` statement is only executed if none of the `arc:case` statements result in a match. The `arc:default` keyword has no parameters and can appear only once in an `arc:select`.

## Parameters

* **value**: The value to compare with those specified in `arc:case` statements.
* **attr**: The attribute whose value is compared with values specified in `arc:case` statements.

## Control Attributes

None

## Example

Set the icon based on the company name. The [arc:case](./op-arc-case) elements match `CompanyA` and `CompanyB` in the `company_name` attribute. If any occurrences are found, take the action associated with that case.

```xml theme={null}
<arc:select value="[company_name]">
  <arc:case value="CompanyA">
    <img src="http://www.companya.com/favicon.ico" />
  </arc:case>
  <arc:case value="CompanyB">
    <img src="http://www.companyb.com/favicon.ico" />
  </arc:case>
  <arc:default>
    <img src="http://www.myhosting.com/generic.ico"/>
  </arc:default>
</arc:select>
```

## See Also

* [arc:case](./op-arc-case): Write cases for `arc:select`.
* [arc:default](./op-arc-default): Write a default case for `arc:select`.
