Who is this Sarah person?
“If it looks right, I'm done.”
“What's an ARIA? I don't like opera.”
“I need these twenty obscure features, and a pony.”
•
<button ng-click="triggerDownload()" class="btn"
tooltip="Download as a zip file">
<i class="icon-download-alt"></i>
</button>
<button type="button">I'm a button!</button>
<button type="submit">
Search
<svg role="img" aria-hidden="true">
<use xlink:href="#search"></use>
</svg>
</button>
<button type="submit">
<svg role="img" aria-labelledby="search-title">
<title id="search-title">Search</title>
<use xlink:href="#search"></use>
</svg>
</button>
aria-label.sr-only CSSNone of this is easy!
interface ButtonProperties {
type: 'submit' | 'reset' | 'button';
}
interface IconProperties {
use: string;
label?: string;
}
I also want it to do
[insert 10 extra features, and a pony]
What could go wrong?
type="submit | reset"aria-expanded="true"aria-haspopup="menu"aria-pressed="true"
???
With too many granular details left open-ended...
... you end up with this:
<button aria-haspopup="true" class="btn btn-popup">
Tooltip
<svg role="img">
<use xlink:href="#plus"></use>
</svg>
</button>
or this:
<button aria-pressed="true" aria-expanded="true"
class="btn btn-open btn-pressed">
Open Accordion
<svg role="img" aria-labelledby="icon-title">
<title id="icon-title">Expand accordion</title>
<use xlink:href="#plus"></use>
</svg>
</button>
But without enough flexibility, your component might be abandoned in favor of this:
<div role="button" onclick="ponyDance()">
Ponies for all
<img src="pony.png">
</div>
interface ButtonProperties {
type: 'submit' | 'reset' | 'button' | 'toggle'
| 'menu' | 'accordion';
disabled: boolean;
pressed: boolean;
open: boolean;
}
Don't ask
What it looks like
ask
What it does
You will never be able to:
Instead: