Skip to main content

πŸš€ Get Started

Welcome to ascii-ui.nvim β€” a Lua framework for building reactive ASCII user interfaces directly inside Neovim buffers.

These docs are still a work in progress, but you can already start creating components today πŸ’‘


πŸ“‹ Requirements​

  • Neovim 0.11+

πŸ“¦ Installation​

Install ascii-ui.nvim with your favorite plugin manager.
Here’s an example using lazy.nvim:

return {
"rcasia/ascii-ui.nvim",
opts = {},
}

🧱 Create Your First Neovim App​

Let’s create a simple Neovim app that renders a message inside a buffer.

  1. Open Neovim and create a new file for your app:

    nvim hello_world.lua
  2. Add the following code:

    -- hello_world.lua
    local ui = require("ascii-ui")

    -- Define your root component
    local HelloWorld = ui.createComponent("HelloWorld", function()
    return ui.components.Paragraph({ content = "Hello, ascii-ui! πŸ‘‹" })
    end)

    -- Mount the app into a new buffer
    ui.mount(HelloWorld)
  3. Save the file (:w), exit Neovim (:q), and run the script:

    nvim -c "luafile hello_world.lua"

You’ll see β€œHello, ascii-ui! πŸ‘‹β€ rendered directly inside Neovim ✨

This is your first ascii-ui Neovim app β€” from here, you can add components, manage state, and build interactive UIs directly inside Neovim πŸš€


πŸš€ Next Steps​

Now that you’ve built your first app, explore the rest of the framework: