docs/src/config/pages.md
68 lines · 2180 bytes
1# Layout config
2
3The layout config determins the position of where each item is placed, mainly their order. The config file can be found in `~/.config/youtube-tui/pages.yml`.
4
5## Example layout config
6
7```yaml
8main_menu:
9 layout:
10 - type: NonCenteredRow
11 items:
12 - SearchBar
13 - SearchFilters
14 - type: CenteredRow
15 items:
16 - Popular
17 - Trending
18 - History
19 - type: NonCenteredRow
20 items:
21 - ItemList
22 - type: NonCenteredRow
23 items:
24 - MessageBar
25 message: Loading main menu...
26 command: key Esc 0 ;; key Up 0 ;; key Left 0 ;; key Enter 0 # this focuses on the search bar
27
28# and much more ...
29```
30
31## Items
32
33Each item is an individual "thing", these things can be optionally selectable, or hoverable by the cursor.
34
35## Rows
36
37A row is a horizontal row of items, it can be either centered (like the buttons) or non centered (which will align to the left).
38
39> Non centered rows are faster and less crash prone compared to centered rows.
40
41Each item are ordered from left to right.
42
43## Message
44
45The message to display when loading the page.
46
47## Command
48
49Command to run when the page loads, you can use the `key` command to select an item on load.
50
51### Items reference
52
53|Item|Can be used in page|Description|
54|---|---|---|
55|MessageBar|Any|The panel (default in the bottom of every page) that displays message and error messages|
56|SearchBar|Any|A text field that searches that entered query|
57|SearchFilters|Any|A button that brings up a popup for modifying search filters|
58|Trending|Any|Loads the trending page|
59|Popular|Any|Loads the popular page|
60|History|Any|Loads the watch history page|
61|ItemList|Main menu/search|Display multiple videos, channels, or playlists in a list|
62|SingleItemInfo|Single item|Display info of one single item (a single video or playlist)|
63|ChannelDisplay|Channel display|Display information of a channel, depending on the page|
64|ChannelMain|Channel display|Loads the main channel page|
65|ChannelVideos|Channel display|Loads the channel videos page|
66|ChannelPlaylists|Channel display|Loads the channel playlists page|
67|ChannelList|Feed|Displays subscribed channels|
68|VideoList|Feed|Displays videos of subscribed channels|