Skip to content

Commit 7776fd5

Browse files
Requests to Image/image button components can have an additional header attribute for authentication
1 parent a4a50dc commit 7776fd5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/components.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,29 @@ Image loaded from either remote url or data-url
6161

6262
![image component](images/components_image.jpeg)
6363

64+
<br>
65+
6466
###syntax
6567

6668
- `type`: `"image"`
6769
- `url`: image url
68-
- `style`
70+
- `header`: (optional) in case the image needs authentication and we need to attach a header object to the request
71+
- `style` (optional)
6972
- `corner_radius`: corner radius. use this to make the image rounded
7073
- `width`
7174
- `height`
7275
- `color`: To set the tint color (only for icons)
7376

77+
<br>
78+
7479
###example
7580

7681
{
7782
"type": "image",
7883
"url": "http://i.imgur.com/KUJPgGV.png",
84+
"header": {
85+
"auth_token": "3nfdss3fNdlenghs_dnekgldnvq334hd"
86+
},
7987
"style": {
8088
"width": "50",
8189
"height": "50",
@@ -100,6 +108,7 @@ Can be either a text button or an image button, depending on what attributes are
100108
- `type`: `"button"`
101109
- `text`: button text (pick either `text` or `url`, can't have both)
102110
- `url`: button image url (pick either `text` or `url`, can't have both)
111+
- `header`: (optional) in case the we're using the image button and the image needs authentication and we need to attach a header object to the request
103112
- `style`
104113
- `width`
105114
- `height`
@@ -141,6 +150,9 @@ Use `url` attribute to make it an image button
141150
{
142151
"type": "button",
143152
"url": "https://raw.githubusercontent.com/Jasonette/Jasonpedia/gh-pages/assets/krusty.png",
153+
"header": {
154+
"auth_token": "3nfdss3fNdlenghs_dnekgldnvq334hd"
155+
},
144156
"style": {
145157
"width": "50",
146158
"height": "50",

0 commit comments

Comments
 (0)