# Widget gallery

> A picture of 48 tui components, each drawn by a small real program and checked against a golden file, so you can see a widget before you use it.

Web: https://tui.nizaami.com/widget-gallery/

Each picture is one component, drawn by a small real program (after the keys named in its test) and rendered from the cell grid the program produced, so it shows what the component looks like and nothing else. A test compares the text of every picture with a golden file in [internal/tools/widgetshots](https://github.com/ows4444/tui/tree/code/internal/tools/widgetshots), so the gallery cannot drift from the code. Every package is documented at [pkg.go.dev](https://pkg.go.dev/github.com/ows4444/tui); [Widgets](https://tui.nizaami.com/widgets/) says how they fit together.

## Button

Package [`button`](https://pkg.go.dev/github.com/ows4444/tui/button).

````text
[ Save changes ]
````

## Button group

Package [`buttongroup`](https://pkg.go.dev/github.com/ows4444/tui/buttongroup).

````text
[ Day ] [ Week ] [ Month ]
````

## Checkbox

Package [`checkbox`](https://pkg.go.dev/github.com/ows4444/tui/checkbox).

````text
[ ] Remember me
````

## Toggle

Package [`toggle`](https://pkg.go.dev/github.com/ows4444/tui/toggle).

````text
(○  ) Dark mode
````

## Radio group

Package [`radiogroup`](https://pkg.go.dev/github.com/ows4444/tui/radiogroup).

````text
( ) Small
( ) Medium
( ) Large
````

## Slider

Package [`slider`](https://pkg.go.dev/github.com/ows4444/tui/slider).

````text
 ████████●░░░░░░░░░░░
````

## Rating

Package [`rating`](https://pkg.go.dev/github.com/ows4444/tui/rating).

````text
 ○○○○○
````

## Tabs

Package [`tabs`](https://pkg.go.dev/github.com/ows4444/tui/tabs).

````text
 Overview  [Logs]  Settings
````

## Breadcrumb

Package [`breadcrumb`](https://pkg.go.dev/github.com/ows4444/tui/breadcrumb).

````text
 Home / Docs / Widgets
````

## Pagination

Package [`pagination`](https://pkg.go.dev/github.com/ows4444/tui/pagination).

````text
[1] 2  …  12
````

## Accordion

Package [`accordion`](https://pkg.go.dev/github.com/ows4444/tui/accordion).

````text
> ▾ Install
    go get github.com/ows4444/tui
  ▸ Run
````

## Picker

Package [`picker`](https://pkg.go.dev/github.com/ows4444/tui/picker).

````text
  Berlin
> Lisbon
  Oslo
````

## Multi-select

Package [`multiselect`](https://pkg.go.dev/github.com/ows4444/tui/multiselect).

````text
  [x] Tests
  [ ] Lint
> [x] Docs
````

## Tree view

Package [`treeview`](https://pkg.go.dev/github.com/ows4444/tui/treeview).

````text
> ▾ src
      main.go
    ▸ util
    README.md
````

## Data table

Package [`datatable`](https://pkg.go.dev/github.com/ows4444/tui/datatable).

````text
  name   qty
  ──────────
  apple  3
> pear   5
  plum   8
````

## Text input

Package [`textinput`](https://pkg.go.dev/github.com/ows4444/tui/textinput).

````text
/ hello
````

## Password input

Package [`passwordinput`](https://pkg.go.dev/github.com/ows4444/tui/passwordinput).

````text
••••••
````

## Email input

Package [`emailinput`](https://pkg.go.dev/github.com/ows4444/tui/emailinput).

````text
ada@x.io
````

## Number input

Package [`numberinput`](https://pkg.go.dev/github.com/ows4444/tui/numberinput).

````text
42
````

## One-time code

Package [`otpinput`](https://pkg.go.dev/github.com/ows4444/tui/otpinput).

````text
[1][2][3]< >[ ][ ]
````

## Tag input

Package [`taginput`](https://pkg.go.dev/github.com/ows4444/tui/taginput).

````text
 go   tui   terminal
````

## Loading bar

Package [`loadingbar`](https://pkg.go.dev/github.com/ows4444/tui/loadingbar).

````text
██████████░░░░░░░░░░░░░░░░░░░░
````

## Scrollbar

Package [`scrollbar`](https://pkg.go.dev/github.com/ows4444/tui/scrollbar).

````text
░
█
░
░
░
````

## Skeleton

Package [`skeleton`](https://pkg.go.dev/github.com/ows4444/tui/skeleton).

````text
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
````

## Date picker

Package [`datepicker`](https://pkg.go.dev/github.com/ows4444/tui/datepicker).

````text
Su Mo Tu We Th Fr Sa
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
````

## Color picker

Package [`colorpicker`](https://pkg.go.dev/github.com/ows4444/tui/colorpicker).

## Confirm

Package [`confirm`](https://pkg.go.dev/github.com/ows4444/tui/confirm).

````text
Delete this file?  [Yes]   No
````

## Avatar

Package [`avatar`](https://pkg.go.dev/github.com/ows4444/tui/avatar).

````text
▗▄██▄▄▄▖
▐█▖▝ ▐██
██▌ ▖▐█▌
▝▀▀▀██▀▘
````

## Carousel

Package [`carousel`](https://pkg.go.dev/github.com/ows4444/tui/carousel).

````text
first slide
   ● ○ ○
````

## Transfer list

Package [`transferlist`](https://pkg.go.dev/github.com/ows4444/tui/transferlist).

````text
 Available (4)  │  Chosen (0)
 alpha          │
 beta           │
 gamma          │
 delta          │
````

## Menu

Package [`menu`](https://pkg.go.dev/github.com/ows4444/tui/menu).

````text
  File
> Edit
  View
````

## Command palette

Package [`commandpalette`](https://pkg.go.dev/github.com/ows4444/tui/commandpalette).

````text
o
> Open file — ctrl+p
  Toggle theme — ctrl+t
````

## Stopwatch

Package [`clockview`](https://pkg.go.dev/github.com/ows4444/tui/clockview).

````text
00:00:00
````

## Viewport

Package [`viewport`](https://pkg.go.dev/github.com/ows4444/tui/viewport).

````text
line two
line three
line four
line five
line six
````

## Log view

Package [`logview`](https://pkg.go.dev/github.com/ows4444/tui/logview).

````text
12:00:01 INFO  server started
12:00:02 WARN  slow request /api/items
12:00:03 ERROR upstream timed out
````

## Form

Package [`form`](https://pkg.go.dev/github.com/ows4444/tui/form).

````text
Account
User: ada
Role: < admin >
````

## Hex view

Package [`hexview`](https://pkg.go.dev/github.com/ows4444/tui/hexview).

````text
0000  74 75 69 3a 20 61 20 47  6f 20 74 65 72 6d 69 6e  |tui: a Go termin|
0010  61 6c 20 55 49 20 6c 69  62 72 61 72 79 00 01 02  |al UI library...|
0020  20 68 65 78 20 76 69 65  77 0a                    | hex view.|
````

## Tooltip

Package [`tooltip`](https://pkg.go.dev/github.com/ows4444/tui/tooltip).

````text
Project settings

Name      tui
License   MIT
┌────────────────────────┐
│ Save the file (ctrl+s) │
└────────────────────────┘
Owner     you
Branch    code
````

## Hover card

Package [`hovercard`](https://pkg.go.dev/github.com/ows4444/tui/hovercard).

````text
┌───────────────────────────┐
│ tui                       │
│                           │
│ A Go terminal UI library. │
│ No dependencies.          │
└───────────────────────────┘
Status    stable
Owner     you
Branch    code
````

## Popover

Package [`popover`](https://pkg.go.dev/github.com/ows4444/tui/popover).

````text
Project settings

Name      tui
License   MIT
┌───────────────────────┐
│                       │
│ Anchored near a point │
│                       │
└───────────────────────┘
````

## Menu bar

Package [`menubar`](https://pkg.go.dev/github.com/ows4444/tui/menubar).

````text
Project settings
┌───────┐
│> Open │ tui
│  Save │ MIT
│  Quit │ Go
└───────┘ terminals
Status    stable
Owner     you
Branch    code
````

## Notification center

Package [`notificationcenter`](https://pkg.go.dev/github.com/ows4444/tui/notificationcenter).

````text
Project settings

┌──────────────────────────────────────┐
│                                      │
│ Build finished                       │
│ Disk almost full                     │
│                                      │
└──────────────────────────────────────┘
Branch    code
````

## File picker

Package [`filepicker`](https://pkg.go.dev/github.com/ows4444/tui/filepicker).

````text
  docs/
> LICENSE
  README.md
  main.go
````

## Dialog

Package [`dialog`](https://pkg.go.dev/github.com/ows4444/tui/dialog).

````text
Project settings
┌────────────────────────┐
│                        │
│ Delete file            │
│                        │
│ This cannot be undone. │
│                        │
└────────────────────────┘
Branch    code
````

## Toast

Package [`toast`](https://pkg.go.dev/github.com/ows4444/tui/toast).

````text
Project settings

Name      tui
┌────────────────────┐
│                    │
│ Saved successfully │
│                    │
└────────────────────┘
Branch    code
````

## Context menu

Package [`contextmenu`](https://pkg.go.dev/github.com/ows4444/tui/contextmenu).

````text
Project settings

┌─────────────────┐
│  Copy    ctrl+c │
│> Paste   ctrl+v │
│ ─────────────── │
│  Delete         │
└─────────────────┘
Branch    code
````

## Drawer

Package [`drawer`](https://pkg.go.dev/github.com/ows4444/tui/drawer).

````text
Project settings
┌──────────────────────────┐
│                          │
│ Filters                  │
│   [x] open               │
│   [ ] closed             │
│                          │
└──────────────────────────┘
Branch    code
````

## Help screen

Package [`helpscreen`](https://pkg.go.dev/github.com/ows4444/tui/helpscreen).

````text
┌─────────────────┐
│                 │
│ [enter] submit  │
│ [esc] cancel    │
│ [?] help        │
│                 │
└─────────────────┘
Owner     you
Branch    code
````
