Skip to main content
UI plugins allow you to completely customize how Yazi looks by overriding built-in components like the status bar, header, file rendering, and more.

Available Components

Yazi’s UI consists of these overrideable components:

Component Structure

UI components follow this pattern:

Required Methods

  • new(area, ...) - Constructor, receives area and context
  • redraw() - Returns UI elements to render
  • reflow() - Returns list of components for layout (optional)

Optional Methods

  • click(event, up) - Handle mouse clicks
  • scroll(event, step) - Handle mouse scroll
  • touch(event, step) - Handle touch events

Creating a Custom Status Bar

Let’s create a custom status bar with a different layout.
1

Create the component file

Create ~/.config/yazi/plugins/components/my-status.lua:
2

Add content methods

Define what to show:
3

Implement redraw

Combine elements:
4

Load the component

In ~/.config/yazi/init.lua:

Customizing the Status Component

You can add custom elements to existing components:

Real Example: Enhanced Status Bar

Here’s a complete example from Yazi’s preset:

Customizing Entity (File) Rendering

The Entity component controls how individual files are displayed:

UI Elements

Line

Container for inline content:

Span

Styled text segment:

Text

Multi-line text:

List

Vertical list of lines:

Table

Tabular data:

Styling

Colors

Attributes

Using Theme Styles

Mouse Events

Best Practices

Don’t recalculate on every redraw:
Always validate before accessing:
Reference theme instead of hardcoding:

Next Steps

Functional Plugins

Add new commands and behaviors

Previewers

Create custom file previewers