2021-06-22 17:56:17 +00:00
---
class: css
2021-06-23 08:19:35 +00:00
state: needs-love
2021-06-22 17:56:17 +00:00
---
# inline-alert
CSS component for giving inline feedback to the user, generally used for form
element feedback like errors and suchlike.
2021-06-23 08:19:35 +00:00
Potentially an improvement here could be that this could make use of `%horizontal-kv-list`, and do we really need a placeholder per state, can we just use a class?
2021-06-22 17:56:17 +00:00
```hbs preview-template
<label class="type-text">
<span>Input some text</span>
<input type="text" />
<strong class={{or this.type "info"}}>{{capitalize (or this.type "info")}}</strong>
</label>
2021-06-23 08:19:35 +00:00
<figure>
<figcaption>Provide a widget to change the <code>class</code></figcaption>
2021-06-22 17:56:17 +00:00
2021-06-23 08:19:35 +00:00
<select
onchange={{action (mut this.type) value="target.value"}}
>
<option>info</option>
<option>success</option>
<option>warning</option>
<option>error</option>
</select>
2021-06-22 17:56:17 +00:00
2021-06-23 08:19:35 +00:00
</figure>
2021-06-22 17:56:17 +00:00
```
```css
strong.info {
@extend %inline-alert-info;
}
strong.success {
@extend %inline-alert-success;
}
strong.warning {
@extend %inline-alert-warning;
}
strong.error {
@extend %inline-alert-error;
}
```