|
| 1 | +--- |
| 2 | +title: Custom widgets |
| 3 | +sidebar_position: 2 |
| 4 | +--- |
| 5 | +import Tabs from '@theme/Tabs'; |
| 6 | +import TabItem from '@theme/TabItem'; |
| 7 | +import CenteredImage from '@site/src/components/CenteredImage'; |
| 8 | +import Centered from '@site/src/components/Centered'; |
| 9 | +import YouTubePlayer from '@site/src/components/YoutubePlayer'; |
| 10 | +import Label from '@site/src/components/Label'; |
| 11 | + |
| 12 | +# Custom widgets |
| 13 | + |
| 14 | +This page demonstrate the custom widgets available in this project. |
| 15 | + |
| 16 | +:::info |
| 17 | +All such widgets are stored within `docs/src/components` directory. |
| 18 | +::: |
| 19 | + |
| 20 | +## Label - Rounded tags |
| 21 | + |
| 22 | +Widget to add labels such as beta features. |
| 23 | + |
| 24 | +<Tabs> |
| 25 | + <TabItem value="code" label="Code"> |
| 26 | + **Import** |
| 27 | + |
| 28 | + Add import line at the top of the markdown file: |
| 29 | + ```markdown |
| 30 | + import Label from '@site/src/components/Label'; |
| 31 | + ``` |
| 32 | + |
| 33 | + **Use** |
| 34 | + |
| 35 | + Place the content to place a Label in your markdown page: |
| 36 | + |
| 37 | + ```markdown |
| 38 | + <Label value="BETA"/> feature |
| 39 | + ``` |
| 40 | + </TabItem> |
| 41 | + <TabItem value="preview" label="Preview" default> |
| 42 | + <Label value="BETA"/> feature |
| 43 | + </TabItem> |
| 44 | +</Tabs> |
| 45 | + |
| 46 | +## CenteredImage - Centered image |
| 47 | + |
| 48 | +Widget to center an image on the page. |
| 49 | + |
| 50 | +<Tabs> |
| 51 | + <TabItem value="code" label="Code"> |
| 52 | + **Import** |
| 53 | + |
| 54 | + Add import line at the top of the markdown file: |
| 55 | + ```markdown |
| 56 | + import CenteredImage from '@site/src/components/CenteredImage'; |
| 57 | + ``` |
| 58 | + |
| 59 | + **Use** |
| 60 | + |
| 61 | + Place the content to center in your markdown page: |
| 62 | + |
| 63 | + ```markdown |
| 64 | + <CenteredImage |
| 65 | + src="/images/doc/initial_setup_popup.png" |
| 66 | + alt="Configuration wizard" |
| 67 | + figureNumber={1} |
| 68 | + /> |
| 69 | + ``` |
| 70 | + </TabItem> |
| 71 | + <TabItem value="preview" label="Preview" default> |
| 72 | + <CenteredImage |
| 73 | + src="/images/doc/initial_setup_popup.png" |
| 74 | + alt="Configuration wizard" |
| 75 | + figureNumber={1} |
| 76 | + /> |
| 77 | + </TabItem> |
| 78 | +</Tabs> |
| 79 | + |
| 80 | + |
| 81 | +## Centered - Centered content |
| 82 | + |
| 83 | +Widget to center content within the page. |
| 84 | + |
| 85 | +<Tabs> |
| 86 | + <TabItem value="code" label="Code"> |
| 87 | + **Import** |
| 88 | + |
| 89 | + Add import line at the top of the markdown file: |
| 90 | + ```markdown |
| 91 | + import Centered from '@site/src/components/Centered'; |
| 92 | + ``` |
| 93 | + |
| 94 | + **Use** |
| 95 | + |
| 96 | + Place the content to center in your markdown page: |
| 97 | + |
| 98 | + ```markdown |
| 99 | + <Centered> |
| 100 | + Some central text |
| 101 | + </Centered> |
| 102 | + ``` |
| 103 | + </TabItem> |
| 104 | + <TabItem value="preview" label="Preview" default> |
| 105 | + <Centered> |
| 106 | + Some central text |
| 107 | + </Centered> |
| 108 | + </TabItem> |
| 109 | +</Tabs> |
| 110 | + |
| 111 | +## YoutubePlayer - Embed Youtube videos |
| 112 | + |
| 113 | +Widget to display YouTube videos. |
| 114 | + |
| 115 | +<Tabs> |
| 116 | + <TabItem value="code" label="Code"> |
| 117 | + **Import** |
| 118 | + |
| 119 | + Add import line at the top of the markdown file: |
| 120 | + ```markdown |
| 121 | + import YoutubePlayer from '@site/src/components/YoutubePlayer'; |
| 122 | + ``` |
| 123 | + |
| 124 | + **Use** |
| 125 | + |
| 126 | + Place the content to place a Youtube player in your markdown page: |
| 127 | + |
| 128 | + ```markdown |
| 129 | + <YouTubePlayer |
| 130 | + videoId="ko5_FA-TdAU" |
| 131 | + author="Cables & Coffee (co-founder)" |
| 132 | + description="Quickly see what you can achieve!" |
| 133 | + /> |
| 134 | + ``` |
| 135 | + </TabItem> |
| 136 | + <TabItem value="preview" label="Preview" default> |
| 137 | + <YouTubePlayer |
| 138 | + videoId="ko5_FA-TdAU" |
| 139 | + author="Cables & Coffee (co-founder)" |
| 140 | + description="Quickly see what you can achieve!" |
| 141 | + /> |
| 142 | + </TabItem> |
| 143 | +</Tabs> |
0 commit comments