|
| 1 | +# Generic header button and icons |
| 2 | + |
| 3 | +## HeaderButton |
| 4 | + |
| 5 | +Displays a button to link a internal or external page. |
| 6 | + |
| 7 | +Example: |
| 8 | + |
| 9 | +```yaml |
| 10 | +mountPoints: |
| 11 | + - mountPoint: global.header/component |
| 12 | + importName: HeaderButton |
| 13 | + config: |
| 14 | + priority: 100 |
| 15 | +``` |
| 16 | +
|
| 17 | +Config parameters: |
| 18 | +
|
| 19 | +| Config key | Description | |
| 20 | +| ---------- | ---------------------------------------------------------- | |
| 21 | +| `props` | Required, at least title and to prop needs to be specified | |
| 22 | +| `layout` | Optional CSS | |
| 23 | + |
| 24 | +Props: |
| 25 | + |
| 26 | +| Props | Description | |
| 27 | +| ------------------ | ---------------------------------------------------------------------------------------- | |
| 28 | +| `title` | Required label for the button | |
| 29 | +| `to` | Required internal or external link | |
| 30 | +| `tooltip` | Optional | |
| 31 | +| `color` | Optional, one of `inherit`, `primary`, `secondary`, `default`, default is `inherit` | |
| 32 | +| `size` | Optional, one of `small`, `medium`, `large`, default is `medium` | |
| 33 | +| `variant` | Optional, one of `text`, `outlined`, `contained`, default is `text` | |
| 34 | +| `ariaLabel` | Optional accessibility label | |
| 35 | +| `startIcon` | Optional icon, see `HeaderIcon` > `icon` for more information | |
| 36 | +| `endIcon` | Optional icon, see `HeaderIcon` > `icon` for more information | |
| 37 | +| `externalLinkIcon` | Optional boolean, default is `true`. Shows automatically a small icon for external links | |
| 38 | + |
| 39 | +## HeaderIcon |
| 40 | + |
| 41 | +Shows a non-clickable icon in the header. |
| 42 | + |
| 43 | +```yaml |
| 44 | +mountPoints: |
| 45 | + - mountPoint: global.header/component |
| 46 | + importName: HeaderIcon |
| 47 | + config: |
| 48 | + priority: 100 |
| 49 | +``` |
| 50 | + |
| 51 | +Config parameters: |
| 52 | + |
| 53 | +| Config key | Description | |
| 54 | +| ---------- | ----------------------------- | |
| 55 | +| `props` | Required to specific the icon | |
| 56 | +| `layout` | Optional CSS | |
| 57 | + |
| 58 | +Props: |
| 59 | + |
| 60 | +| Props | Description | |
| 61 | +| ----------- | --------------------------------------------------------------------------------------- | |
| 62 | +| `icon` | The icon can reference a Backstage icon, an inline svg image or a remote icon (url)\*\* | |
| 63 | +| `color` | Optional, one of `inherit`, `primary`, `secondary`, `default`, default is `inherit` | |
| 64 | +| `size` | Optional, one of `small`, `medium`, `large`, default is `medium` | |
| 65 | +| `ariaLabel` | Optional accessibility label | |
| 66 | + |
| 67 | +\*SVG images must start with `<svg`. |
| 68 | + |
| 69 | +\*\*Please note that remote URLs must be accepted in the CSP. |
| 70 | + |
| 71 | +## HeaderIconButton |
| 72 | + |
| 73 | +Shows a clickable icon in the header. |
| 74 | + |
| 75 | +```yaml |
| 76 | +mountPoints: |
| 77 | + - mountPoint: global.header/component |
| 78 | + importName: HeaderIconButton |
| 79 | + config: |
| 80 | + priority: 100 |
| 81 | +``` |
| 82 | + |
| 83 | +Config parameters: |
| 84 | + |
| 85 | +| Config key | Description | |
| 86 | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 87 | +| `props` | Required, at least title and to prop needs to be specified. Title is used as tooltip and for accessability. Both values can be overriden with more specific values. | |
| 88 | +| `layout` | Optional CSS | |
| 89 | + |
| 90 | +Props: |
| 91 | + |
| 92 | +| Props | Description | |
| 93 | +| ----------- | ----------------------------------------------------------------------------------- | |
| 94 | +| `title` | Required information for the button which is used as tooltip and for accessability. | |
| 95 | +| `to` | Required internal or external link | |
| 96 | +| `tooltip` | Optional | |
| 97 | +| `color` | Optional, one of `inherit`, `primary`, `secondary`, `default`, default is `inherit` | |
| 98 | +| `size` | Optional, one of `small`, `medium`, `large`, default is `medium` | |
| 99 | +| `ariaLabel` | Optional accessibility label | |
0 commit comments