Configuration
All configuration options for the Exlitem search widget — attributes, window config, and defaults.
The widget can be configured via HTML attributes on the element, a global JavaScript object, or a combination of both.
#HTML Attributes
The simplest way to configure the widget is with attributes directly on the <exlitem-search> element:
<exlitem-search
api-key="exl_pub_live_abc123"
theme="dark"
placeholder="Search for a medical expert…"
specialty="Medical Malpractice"
></exlitem-search>
#Attribute Reference
| Attribute | Type | Default | Description |
|---|---|---|---|
api-key | string | — | Required. Your publishable API key. |
theme | "light" | "dark" | "auto" | "light" | Color theme. "auto" follows the user's system preference. |
placeholder | string | "Search expert witnesses…" | Placeholder text for the search input. |
specialty | string | — | Lock searches to a specific specialty (e.g. "Patent Litigation"). |
state | string | — | Lock searches to a specific US state (e.g. "California"). |
cta-text | string | "View all results on Exlitem" | Text for the call-to-action link below results. |
cta-url | string | "https://exlitem.com/search" | URL the CTA link points to. |
primary-color | string | "#E8A016" | Brand color for buttons and accents (any valid CSS color). |
#Window Config Object
For more complex setups or when you want to configure the widget from JavaScript, use the window.ExlitemWidgetConfig object. Define it before loading the widget script:
<script>
window.ExlitemWidgetConfig = {
apiKey: 'exl_pub_live_abc123',
theme: 'dark',
placeholder: 'Search by specialty, name, or location…',
ctaText: 'See all experts on Exlitem',
};
</script>
<script src="https://cdn.exlitem.com/widget/exlitem-search.js"></script>
#Config Object Properties
| Property | Attribute Equivalent | Type |
|---|---|---|
apiKey | api-key | string |
theme | theme | string |
placeholder | placeholder | string |
restrictSpecialty | specialty | string |
restrictState | state | string |
ctaText | cta-text | string |
ctaUrl | cta-url | string |
primaryColor | primary-color | string |
apiUrl | — | string (advanced: override API endpoint) |
#Priority Order
When the same setting is specified in multiple places, the widget resolves values in this order (highest priority first):
- HTML attributes on the element
window.ExlitemWidgetConfigobject- Built-in defaults
This means HTML attributes always win. For example, if you set theme="light" on the element but theme: "dark" in the window config, the widget will use light theme.
#Multiple Widgets
You can place multiple widgets on the same page, each with different configurations:
<exlitem-search
api-key="exl_pub_live_abc123"
specialty="Medical Malpractice"
placeholder="Find a medical expert…"
></exlitem-search>
<exlitem-search
api-key="exl_pub_live_abc123"
specialty="Patent Litigation"
placeholder="Find a patent expert…"
></exlitem-search>
All widgets share the same API key but can have different specialty locks, placeholders, and themes.