@unframed/cli 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/skill/unframed/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Builds UI with Unframed web components (@unframed/core, @unframed/r
|
|
|
5
5
|
|
|
6
6
|
# Unframed UI
|
|
7
7
|
|
|
8
|
-
Unframed 0.
|
|
8
|
+
Unframed 0.12.0: accessible UI components as standard custom elements (Lit). Every tag starts with `uf-`. They work in plain HTML and every framework; React, Vue and Angular have wrapper packages for typed props, events and form bindings.
|
|
9
9
|
|
|
10
10
|
## Before writing code
|
|
11
11
|
|
|
@@ -35,6 +35,7 @@ Unframed 0.10.0: accessible UI components as standard custom elements (Lit). Eve
|
|
|
35
35
|
| Component | Tags | Import |
|
|
36
36
|
|---|---|---|
|
|
37
37
|
| Accordion: A stack of sections that expand and collapse. | `<uf-accordion>` `<uf-accordion-item>` | `@unframed/core/accordion` |
|
|
38
|
+
| Alert: Shows a message in the page, by meaning: info, success, warning or danger. | `<uf-alert>` | `@unframed/core/alert` |
|
|
38
39
|
| Avatar: Shows a person's picture, initials or icon. | `<uf-avatar>` | `@unframed/core/avatar` |
|
|
39
40
|
| Badge: Labels a status, a category or a count. | `<uf-badge>` | `@unframed/core/badge` |
|
|
40
41
|
| Breadcrumbs: Shows the path to the current page. | `<uf-breadcrumbs>` `<uf-breadcrumb-item>` | `@unframed/core/breadcrumbs` |
|
|
@@ -45,16 +46,19 @@ Unframed 0.10.0: accessible UI components as standard custom elements (Lit). Eve
|
|
|
45
46
|
| Date picker: Lets users type or pick a date. | `<uf-date-picker>` `<uf-calendar>` | `@unframed/core/date-picker` `@unframed/core/calendar` |
|
|
46
47
|
| Date range picker: Lets users type or pick a start and an end date. | `<uf-date-range-picker>` `<uf-calendar>` | `@unframed/core/date-range-picker` `@unframed/core/calendar` |
|
|
47
48
|
| Dialog: Shows content in a modal window on top of the page. | `<uf-dialog>` | `@unframed/core/dialog` |
|
|
49
|
+
| Divider: Separates groups of content with a line. | `<uf-divider>` | `@unframed/core/divider` |
|
|
48
50
|
| Drawer: A panel that slides in from an edge of the screen. | `<uf-drawer>` | `@unframed/core/drawer` |
|
|
49
51
|
| Dropdown menu: Opens a menu of actions from a button. | `<uf-dropdown>` `<uf-menu>` `<uf-menu-item>` | `@unframed/core/dropdown` `@unframed/core/menu` |
|
|
50
52
|
| File upload: Lets users choose files to upload. | `<uf-file-upload>` | `@unframed/core/file-upload` |
|
|
51
53
|
| Icon: Shows a small symbol. | `<uf-icon>` | `@unframed/core/icon` |
|
|
52
54
|
| Input: Lets users enter a single line of text. | `<uf-input>` | `@unframed/core/input` |
|
|
55
|
+
| Number input: Lets users enter a number, or step it with buttons. | `<uf-number-input>` | `@unframed/core/number-input` |
|
|
53
56
|
| Pagination: Moves between the pages of a long list. | `<uf-pagination>` | `@unframed/core/pagination` |
|
|
54
57
|
| Popover: Shows floating content next to a trigger. | `<uf-popover>` | `@unframed/core/popover` |
|
|
55
58
|
| Progress: Shows how far a task has got. | `<uf-progress>` | `@unframed/core/progress` |
|
|
56
59
|
| Radio group: Lets users pick exactly one option from a list. | `<uf-radio-group>` `<uf-radio>` | `@unframed/core/radio-group` `@unframed/core/radio` |
|
|
57
60
|
| Select: Lets users pick one option from a dropdown list. | `<uf-select>` | `@unframed/core/select` |
|
|
61
|
+
| Skeleton: Holds the place of content while it loads. | `<uf-skeleton>` | `@unframed/core/skeleton` |
|
|
58
62
|
| Slider: Lets users pick a number in a range. | `<uf-slider>` | `@unframed/core/slider` |
|
|
59
63
|
| Spinner: Shows that something is loading. | `<uf-spinner>` | `@unframed/core/spinner` |
|
|
60
64
|
| Switch: Turns a setting on or off. | `<uf-switch>` | `@unframed/core/switch` |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Unframed 0.
|
|
1
|
+
# Unframed 0.12.0 components
|
|
2
2
|
|
|
3
3
|
## Accordion
|
|
4
4
|
|
|
@@ -94,6 +94,119 @@ Add `multiple` to let several items stay open.
|
|
|
94
94
|
|---|---|
|
|
95
95
|
| `--uf-accordion-padding` | Horizontal padding of header and content. |
|
|
96
96
|
|
|
97
|
+
## Alert
|
|
98
|
+
|
|
99
|
+
A message in the page, like "Your trial ends in 3 days" or "We couldn't save
|
|
100
|
+
your changes". Unlike a toast it stays where it is until it's dismissed.
|
|
101
|
+
|
|
102
|
+
`warning` and `danger` alerts are announced right away (`role="alert"`), the
|
|
103
|
+
others politely (`role="status"`). Assistive tech announces an alert when it's
|
|
104
|
+
added to the page or shown, not when the page loads with it.
|
|
105
|
+
|
|
106
|
+
Tags: `<uf-alert>`. Import: `import '@unframed/core/alert';` (or `npx @unframed/cli add alert` to copy the source).
|
|
107
|
+
|
|
108
|
+
### Variants
|
|
109
|
+
|
|
110
|
+
Six colors by meaning, each with its icon. `info` is the default.
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<uf-alert>A new version is available.</uf-alert>
|
|
114
|
+
<uf-alert variant="success">Your changes were published.</uf-alert>
|
|
115
|
+
<uf-alert variant="warning">Your trial ends in 3 days.</uf-alert>
|
|
116
|
+
<uf-alert variant="danger">We couldn't charge your card.</uf-alert>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- `warning` and `danger` alerts are announced right away, the others politely. Assistive tech announces an alert when it appears, so add it to the page (or `show()` it) when the message happens.
|
|
120
|
+
|
|
121
|
+
### Heading and actions
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<uf-alert variant="warning" heading="Your trial ends in 3 days">
|
|
125
|
+
Choose a plan to keep your projects and invoices.
|
|
126
|
+
<uf-button slot="actions" size="sm">Choose a plan</uf-button>
|
|
127
|
+
<uf-button slot="actions" size="sm" variant="ghost">Remind me later</uf-button>
|
|
128
|
+
</uf-alert>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Closable
|
|
132
|
+
|
|
133
|
+
`closable` adds a close button that hides the alert and emits `uf-hide`. `show()` brings it back.
|
|
134
|
+
|
|
135
|
+
```html
|
|
136
|
+
<uf-alert variant="success" closable>Your changes were saved.</uf-alert>
|
|
137
|
+
|
|
138
|
+
<script>
|
|
139
|
+
document.querySelector('uf-alert').addEventListener('uf-hide', () => console.log('closed'));
|
|
140
|
+
</script>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Without an icon, or with your own
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<uf-alert variant="neutral" without-icon>Maintenance on Sunday from 02:00 to 04:00 UTC.</uf-alert>
|
|
147
|
+
<uf-alert variant="accent">
|
|
148
|
+
<uf-icon slot="icon" name="user"></uf-icon>
|
|
149
|
+
John Smith shared a project with you.
|
|
150
|
+
</uf-alert>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### `<uf-alert>` API
|
|
154
|
+
|
|
155
|
+
#### Attributes and properties
|
|
156
|
+
|
|
157
|
+
| Attribute | Property | Type | Default | Description |
|
|
158
|
+
|---|---|---|---|---|
|
|
159
|
+
| `variant` | | `AlertVariant` | `'info'` | Color, icon and urgency, by meaning: `neutral`, `accent`, `info`, `success`, `warning` or `danger`. |
|
|
160
|
+
| `heading` | | `string \| undefined` | | Bold first line. |
|
|
161
|
+
| `closable` | | `boolean` | `false` | Shows a close button that hides the alert. |
|
|
162
|
+
| `without-icon` | `withoutIcon` | `boolean` | `false` | Hides the icon. |
|
|
163
|
+
|
|
164
|
+
#### Methods
|
|
165
|
+
|
|
166
|
+
| Method | Description |
|
|
167
|
+
|---|---|
|
|
168
|
+
| `show()` | Shows the alert again after it was hidden. |
|
|
169
|
+
| `hide()` | Hides the alert, like its close button. |
|
|
170
|
+
|
|
171
|
+
#### Events
|
|
172
|
+
|
|
173
|
+
| Event | Type | Description |
|
|
174
|
+
|---|---|---|
|
|
175
|
+
| `uf-show` | `Event` | The alert was shown with `show()`. |
|
|
176
|
+
| `uf-hide` | `Event` | The alert was hidden, with the close button or `hide()`. |
|
|
177
|
+
|
|
178
|
+
#### Slots
|
|
179
|
+
|
|
180
|
+
| Slot | Description |
|
|
181
|
+
|---|---|
|
|
182
|
+
| (default) | The message. |
|
|
183
|
+
| `heading` | The heading, when you need markup. Overrides `heading`. |
|
|
184
|
+
| `icon` | Replaces the variant's icon. |
|
|
185
|
+
| `actions` | Buttons or links below the message. |
|
|
186
|
+
|
|
187
|
+
#### CSS parts
|
|
188
|
+
|
|
189
|
+
| Part | Description |
|
|
190
|
+
|---|---|
|
|
191
|
+
| `base` | The alert. |
|
|
192
|
+
| `icon` | The icon. |
|
|
193
|
+
| `content` | The wrapper around the heading, message and actions. |
|
|
194
|
+
| `heading` | The heading. |
|
|
195
|
+
| `message` | The message. |
|
|
196
|
+
| `actions` | The wrapper around the actions. |
|
|
197
|
+
| `close-button` | The close button, when `closable` is set. |
|
|
198
|
+
|
|
199
|
+
#### CSS custom properties
|
|
200
|
+
|
|
201
|
+
| Property | Description |
|
|
202
|
+
|---|---|
|
|
203
|
+
| `--uf-alert-bg` | Background color. |
|
|
204
|
+
| `--uf-alert-border-color` | Border color. |
|
|
205
|
+
| `--uf-alert-color` | Text color. |
|
|
206
|
+
| `--uf-alert-icon-color` | Icon color. |
|
|
207
|
+
| `--uf-alert-radius` | Corner radius. |
|
|
208
|
+
| `--uf-alert-padding` | Space inside the alert. |
|
|
209
|
+
|
|
97
210
|
## Avatar
|
|
98
211
|
|
|
99
212
|
A picture of a person or an entity. Shows the image when it loads, the
|
|
@@ -1171,6 +1284,67 @@ Escape, the close button and any element with `data-dialog="close"` close it.
|
|
|
1171
1284
|
| `--uf-dialog-radius` | Corner radius. |
|
|
1172
1285
|
| `--uf-dialog-backdrop` | Backdrop color. |
|
|
1173
1286
|
|
|
1287
|
+
## Divider
|
|
1288
|
+
|
|
1289
|
+
A line between groups of content, across or beside them. Assistive tech
|
|
1290
|
+
announces it as a separator. With a label ("or"), the label is read as plain
|
|
1291
|
+
text and the line around it is decorative.
|
|
1292
|
+
|
|
1293
|
+
Tags: `<uf-divider>`. Import: `import '@unframed/core/divider';` (or `npx @unframed/cli add divider` to copy the source).
|
|
1294
|
+
|
|
1295
|
+
### Between sections, or with a label
|
|
1296
|
+
|
|
1297
|
+
```html
|
|
1298
|
+
<section>Profile</section>
|
|
1299
|
+
<uf-divider></uf-divider>
|
|
1300
|
+
<section>Notifications</section>
|
|
1301
|
+
|
|
1302
|
+
<uf-divider>or</uf-divider>
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1305
|
+
- Screen readers announce a divider as a separator. A label is read as plain text, so keep it short, like "or".
|
|
1306
|
+
|
|
1307
|
+
### Vertical
|
|
1308
|
+
|
|
1309
|
+
Between items in a row. It takes the height of the row.
|
|
1310
|
+
|
|
1311
|
+
```html
|
|
1312
|
+
<div style="display: flex; align-items: center">
|
|
1313
|
+
<uf-button variant="link">Edit</uf-button>
|
|
1314
|
+
<uf-divider orientation="vertical"></uf-divider>
|
|
1315
|
+
<uf-button variant="link">Duplicate</uf-button>
|
|
1316
|
+
</div>
|
|
1317
|
+
```
|
|
1318
|
+
|
|
1319
|
+
### `<uf-divider>` API
|
|
1320
|
+
|
|
1321
|
+
#### Attributes and properties
|
|
1322
|
+
|
|
1323
|
+
| Attribute | Property | Type | Default | Description |
|
|
1324
|
+
|---|---|---|---|---|
|
|
1325
|
+
| `orientation` | | `DividerOrientation` | `'horizontal'` | `horizontal` (across the content) or `vertical` (between items in a row). |
|
|
1326
|
+
|
|
1327
|
+
#### Slots
|
|
1328
|
+
|
|
1329
|
+
| Slot | Description |
|
|
1330
|
+
|---|---|
|
|
1331
|
+
| (default) | An optional label in the middle of the line, like "or". |
|
|
1332
|
+
|
|
1333
|
+
#### CSS parts
|
|
1334
|
+
|
|
1335
|
+
| Part | Description |
|
|
1336
|
+
|---|---|
|
|
1337
|
+
| `base` | The line, or the wrapper around a labelled one. |
|
|
1338
|
+
| `label` | The label. |
|
|
1339
|
+
|
|
1340
|
+
#### CSS custom properties
|
|
1341
|
+
|
|
1342
|
+
| Property | Description |
|
|
1343
|
+
|---|---|
|
|
1344
|
+
| `--uf-divider-color` | Color of the line. |
|
|
1345
|
+
| `--uf-divider-width` | Thickness of the line. |
|
|
1346
|
+
| `--uf-divider-spacing` | Space before and after the line. |
|
|
1347
|
+
|
|
1174
1348
|
## Drawer
|
|
1175
1349
|
|
|
1176
1350
|
A panel that slides in from an edge of the screen, for navigation, filters or
|
|
@@ -1659,6 +1833,115 @@ Errors appear after the user edits the field or tries to submit.
|
|
|
1659
1833
|
| `--uf-field-border-color` | Border color of the box. |
|
|
1660
1834
|
| `--uf-field-radius` | Corner radius of the box. |
|
|
1661
1835
|
|
|
1836
|
+
## Number input
|
|
1837
|
+
|
|
1838
|
+
A field for a number, with buttons to step it down and up. The value is a
|
|
1839
|
+
number, or `null` while the field is empty. Arrow keys step it too, Enter
|
|
1840
|
+
submits the form, and `min`, `max` and `step` validate it like a native
|
|
1841
|
+
number input.
|
|
1842
|
+
|
|
1843
|
+
The buttons are out of the tab order: arrow keys do the same from the field.
|
|
1844
|
+
|
|
1845
|
+
Tags: `<uf-number-input>`. Import: `import '@unframed/core/number-input';` (or `npx @unframed/cli add number-input` to copy the source).
|
|
1846
|
+
|
|
1847
|
+
### Basic
|
|
1848
|
+
|
|
1849
|
+
The value is a number, or `null` while the field is empty. The buttons and the arrow keys step it, within `min` and `max`.
|
|
1850
|
+
|
|
1851
|
+
```html
|
|
1852
|
+
<uf-number-input name="guests" label="Guests" hint="Up to 10" value="2" min="1" max="10"></uf-number-input>
|
|
1853
|
+
```
|
|
1854
|
+
|
|
1855
|
+
### Steps, units and validation
|
|
1856
|
+
|
|
1857
|
+
`step` sets how much the buttons move, and the value must be a multiple of it. Put a unit or a currency in the `prefix` or `suffix` slot.
|
|
1858
|
+
|
|
1859
|
+
```html
|
|
1860
|
+
<uf-number-input label="Price" value="9.5" step="0.5" min="0">
|
|
1861
|
+
<span slot="prefix">€</span>
|
|
1862
|
+
</uf-number-input>
|
|
1863
|
+
<uf-number-input label="Weight" value="250" step="50" min="0" required>
|
|
1864
|
+
<span slot="suffix">g</span>
|
|
1865
|
+
</uf-number-input>
|
|
1866
|
+
```
|
|
1867
|
+
|
|
1868
|
+
### `<uf-number-input>` API
|
|
1869
|
+
|
|
1870
|
+
#### Attributes and properties
|
|
1871
|
+
|
|
1872
|
+
| Attribute | Property | Type | Default | Description |
|
|
1873
|
+
|---|---|---|---|---|
|
|
1874
|
+
| `value` | `defaultValue` | `number \| null` | `null` | Initial value, restored on form reset. Set with the `value` attribute. |
|
|
1875
|
+
| `label` | | `string \| undefined` | | Visible label. |
|
|
1876
|
+
| `hint` | | `string \| undefined` | | Help text below the field. |
|
|
1877
|
+
| `placeholder` | | `string \| undefined` | | Placeholder text. |
|
|
1878
|
+
| `size` | | `FieldSize` | `'md'` | Size of the field. |
|
|
1879
|
+
| `readonly` | | `boolean` | `false` | Makes the field read-only, without the buttons doing anything. |
|
|
1880
|
+
| `min` | | `number \| null` | `null` | Lowest value. |
|
|
1881
|
+
| `max` | | `number \| null` | `null` | Highest value. |
|
|
1882
|
+
| `step` | | `number` | `1` | The buttons and arrow keys move by this much, and the value must be a multiple of it (from `min`). |
|
|
1883
|
+
| `name` | | `string` | `''` | Name submitted with the form. |
|
|
1884
|
+
| `disabled` | | `boolean` | `false` | Disables the control. |
|
|
1885
|
+
| `required` | | `boolean` | `false` | Makes the control required for form submission. |
|
|
1886
|
+
|
|
1887
|
+
#### Properties only
|
|
1888
|
+
|
|
1889
|
+
| Property | Type | Description |
|
|
1890
|
+
|---|---|---|
|
|
1891
|
+
| `value` | `number \| null` | Current value, or `null` while the field is empty. |
|
|
1892
|
+
| `form` | `HTMLFormElement \| null` | Read-only. The form this control belongs to, if any. |
|
|
1893
|
+
| `validity` | `ValidityState` | Read-only. The control's validity state, like a native input's. |
|
|
1894
|
+
| `validationMessage` | `string` | Read-only. The error message shown when the value is invalid. |
|
|
1895
|
+
| `willValidate` | `boolean` | Read-only. Whether the control takes part in form validation. |
|
|
1896
|
+
|
|
1897
|
+
#### Methods
|
|
1898
|
+
|
|
1899
|
+
| Method | Description |
|
|
1900
|
+
|---|---|
|
|
1901
|
+
| `stepUp(count?: unknown)` | Steps the value up by `step` (or `count` steps), like the plus button. |
|
|
1902
|
+
| `stepDown(count?: unknown)` | Steps the value down by `step` (or `count` steps), like the minus button. |
|
|
1903
|
+
| `checkValidity()` | Returns whether the value is valid, without showing an error. |
|
|
1904
|
+
| `reportValidity()` | Returns whether the value is valid, and shows the error if not. |
|
|
1905
|
+
| `setCustomValidity(message: string)` | Sets a custom error message. Pass an empty string to clear it. |
|
|
1906
|
+
|
|
1907
|
+
#### Events
|
|
1908
|
+
|
|
1909
|
+
| Event | Type | Description |
|
|
1910
|
+
|---|---|---|
|
|
1911
|
+
| `input` | `Event` | Fired on every keystroke and every step. |
|
|
1912
|
+
| `change` | `Event` | Fired when the value is committed: blur, Enter or a step. |
|
|
1913
|
+
|
|
1914
|
+
#### Slots
|
|
1915
|
+
|
|
1916
|
+
| Slot | Description |
|
|
1917
|
+
|---|---|
|
|
1918
|
+
| `label` | The label, when you need markup. Overrides `label`. |
|
|
1919
|
+
| `hint` | Help text below the field. Overrides `hint`. |
|
|
1920
|
+
| `prefix` | An icon or text before the number, like a currency. |
|
|
1921
|
+
| `suffix` | An icon or text after the number, like a unit. |
|
|
1922
|
+
|
|
1923
|
+
#### CSS parts
|
|
1924
|
+
|
|
1925
|
+
| Part | Description |
|
|
1926
|
+
|---|---|
|
|
1927
|
+
| `field` | The wrapper around label, control, hint and error. |
|
|
1928
|
+
| `form-label` | The label. |
|
|
1929
|
+
| `box` | The bordered box around the input and the buttons. |
|
|
1930
|
+
| `input` | The native `<input type="number">`. |
|
|
1931
|
+
| `steppers` | The wrapper around the two buttons. |
|
|
1932
|
+
| `decrement` | The minus button. |
|
|
1933
|
+
| `increment` | The plus button. |
|
|
1934
|
+
| `hint` | The hint text. |
|
|
1935
|
+
| `error` | The validation message. |
|
|
1936
|
+
|
|
1937
|
+
#### CSS custom properties
|
|
1938
|
+
|
|
1939
|
+
| Property | Description |
|
|
1940
|
+
|---|---|
|
|
1941
|
+
| `--uf-field-bg` | Background of the box. |
|
|
1942
|
+
| `--uf-field-border-color` | Border color of the box. |
|
|
1943
|
+
| `--uf-field-radius` | Corner radius of the box. |
|
|
1944
|
+
|
|
1662
1945
|
## Pagination
|
|
1663
1946
|
|
|
1664
1947
|
Navigation between the pages of a list or table. Set `pages` and `page`; the
|
|
@@ -2060,6 +2343,67 @@ Built on the native `<select>`: write plain `<option>` and `<optgroup>` children
|
|
|
2060
2343
|
| `--uf-field-border-color` | Border color of the box. |
|
|
2061
2344
|
| `--uf-field-radius` | Corner radius of the box. |
|
|
2062
2345
|
|
|
2346
|
+
## Skeleton
|
|
2347
|
+
|
|
2348
|
+
A grey placeholder in the shape of content that's still loading: lines of
|
|
2349
|
+
text, a block or a circle. It's decorative, hidden from assistive tech: mark
|
|
2350
|
+
the region that's loading with `aria-busy="true"`, and announce the result
|
|
2351
|
+
when it arrives.
|
|
2352
|
+
|
|
2353
|
+
Size it with `width` and `height` in CSS; `text` lines take the height of a
|
|
2354
|
+
line of text, and `circle` stays round.
|
|
2355
|
+
|
|
2356
|
+
Tags: `<uf-skeleton>`. Import: `import '@unframed/core/skeleton';` (or `npx @unframed/cli add skeleton` to copy the source).
|
|
2357
|
+
|
|
2358
|
+
### Shapes
|
|
2359
|
+
|
|
2360
|
+
Lines of text (`lines`), a circle or a block (`rect`), sized with CSS. A shimmer sweeps across them, except for people who asked for less motion.
|
|
2361
|
+
|
|
2362
|
+
```html
|
|
2363
|
+
<div aria-busy="true">
|
|
2364
|
+
<uf-skeleton shape="circle"></uf-skeleton>
|
|
2365
|
+
<uf-skeleton lines="3"></uf-skeleton>
|
|
2366
|
+
|
|
2367
|
+
<uf-skeleton shape="rect"></uf-skeleton>
|
|
2368
|
+
</div>
|
|
2369
|
+
```
|
|
2370
|
+
|
|
2371
|
+
- Skeletons are hidden from screen readers. Mark the region that is loading with `aria-busy="true"`, and remove it when the content arrives.
|
|
2372
|
+
|
|
2373
|
+
### A card while it loads
|
|
2374
|
+
|
|
2375
|
+
```html
|
|
2376
|
+
<uf-card aria-busy="true">
|
|
2377
|
+
<uf-skeleton slot="media" shape="rect" style="height: 8rem"></uf-skeleton>
|
|
2378
|
+
<uf-skeleton slot="header" style="width: 60%"></uf-skeleton>
|
|
2379
|
+
<uf-skeleton lines="2"></uf-skeleton>
|
|
2380
|
+
</uf-card>
|
|
2381
|
+
```
|
|
2382
|
+
|
|
2383
|
+
### `<uf-skeleton>` API
|
|
2384
|
+
|
|
2385
|
+
#### Attributes and properties
|
|
2386
|
+
|
|
2387
|
+
| Attribute | Property | Type | Default | Description |
|
|
2388
|
+
|---|---|---|---|---|
|
|
2389
|
+
| `shape` | | `SkeletonShape` | `'text'` | `text` (lines of text), `rect` (a block, like an image) or `circle` (like an avatar). |
|
|
2390
|
+
| `lines` | | `number` | `1` | Number of lines of a `text` placeholder. |
|
|
2391
|
+
|
|
2392
|
+
#### CSS parts
|
|
2393
|
+
|
|
2394
|
+
| Part | Description |
|
|
2395
|
+
|---|---|
|
|
2396
|
+
| `base` | The placeholder, or the wrapper around its lines. |
|
|
2397
|
+
| `line` | One line of a `text` placeholder. |
|
|
2398
|
+
|
|
2399
|
+
#### CSS custom properties
|
|
2400
|
+
|
|
2401
|
+
| Property | Description |
|
|
2402
|
+
|---|---|
|
|
2403
|
+
| `--uf-skeleton-color` | Background of the placeholder. |
|
|
2404
|
+
| `--uf-skeleton-highlight` | Color of the shimmer that sweeps across it. |
|
|
2405
|
+
| `--uf-skeleton-radius` | Corner radius of `text` and `rect` placeholders. |
|
|
2406
|
+
|
|
2063
2407
|
## Slider
|
|
2064
2408
|
|
|
2065
2409
|
Picks a number in a range by dragging a handle, or with the arrow keys. Built
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Using Unframed 0.
|
|
1
|
+
# Using Unframed 0.12.0 in each framework
|
|
2
2
|
|
|
3
3
|
## HTML & JavaScript
|
|
4
4
|
|
|
@@ -68,8 +68,8 @@ dialog.addEventListener('uf-hide', () => toast('Welcome aboard!', { variant: 'su
|
|
|
68
68
|
<!doctype html>
|
|
69
69
|
<html lang="en">
|
|
70
70
|
<head>
|
|
71
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@unframed/tokens@0.
|
|
72
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@unframed/core@0.
|
|
71
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@unframed/tokens@0.12/dist/tokens.css" />
|
|
72
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@unframed/core@0.12/+esm"></script>
|
|
73
73
|
</head>
|
|
74
74
|
<body>
|
|
75
75
|
<uf-button variant="primary">It works</uf-button>
|