Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bwva authored Sep 9, 2024
1 parent 9c3209b commit 02f8f89
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,23 @@ The spinner can be placed in your HTML as an inline-block element with the follo
```html
<x-spinner></x-spinner>
```
_Note: Custom web components always require closing tags._

The above basic spinner will inherit the text color and size of its containing element, and rotate a single border quadrant clockwise once per second.

_Note: Custom web components always require closing tags._
The spinner element accepts several attributes to vary its appearance and behavior. Attributes may be applied in markup like any other HTML element.

```html
<x-spinner rotor-style='dotted' speed='0.5'></x-spinner>
```
See "Attributes" below for details.

In the HTML spinner tag, the usual attributes, such as `id=` or `style=`, may be assigned:
The usual HTML attributes, such as `id=` or `style=`, may also be assigned in the HTML spinner markup:
```html
<x-spinner style="font-style:italic;"></x-spinner>
```
[ Wait - _font-style_? See `prefix` and `suffix` attributes below. ]

See "Attributes" below for details.

### Scripting
A spinner element may be added programmatically by calling `new SpinnerElement` to create the spinner, and then appending the spinner to the HTML element where you want it to appear. You may use Javascript's built-in .setAttribute method to set any attributes, and the .style attribute itself to set style properties; this may be done before or after appending the spinner to the HTML.
```
Expand Down

0 comments on commit 02f8f89

Please sign in to comment.