widget

Create interactive forms and UI elements in Emacs buffers with widget.el.

3|Updated Nov 10, 2025
One-click install
npx skills add https://github.com/hugoduncan/library-skills --skill widget
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: widget
Source: https://github.com/hugoduncan/library-skills/tree/main/plugins/emacs-libraries/skills/widget
Command: npx skills add https://github.com/hugoduncan/library-skills --skill widget

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Emacs Widget Library enables creating rich, interactive UI elements directly in text buffers, simplifying configuration interfaces, dialogs, and data entry without external UI frameworks.

Core Features & Use Cases

  • Widget Lifecycle: Create, setup, interact, and read values from widgets.
  • Widget Types: Text inputs (editable-field, text), buttons (push-button, link), and selection controls (checkbox, radio-button-choice, menu-choice, etc.).
  • Value Retrieval: Obtain user input via widget-value and widget-value-set.
  • Navigation & Interaction: Move between widgets with widget-forward and widget-backward.
  • Use Cases: Built-in forms, settings editors, and lightweight UI components in Emacs buffers.

Quick Start

To start:

  • Require the library: (require 'widget) and (eval-when-compile (require 'wid-edit))
  • Create a simple form, then enable widgets with widget-setup:
    (defun simple-form ()
      (interactive)
      (switch-to-buffer "*Simple Form*")
      (kill-all-local-variables)
      (erase-buffer)
      (remove-overlays)
      (widget-insert "Name:\
    

") (setq my-name (widget-create 'editable-field :size 20)) (widget-create 'push-button :notify (lambda (&rest _) (message "Submitted: %s" (widget-value my-name))) "Submit") (use-local-map widget-keymap) (widget-setup))

Frequently Asked Questions about widget

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build interactive forms in Emacs buffers?

Interactive forms in Emacs use the widget library (widget.el and wid-edit.el). Create widgets with `widget-create`, populate a buffer with form elements like editable fields and buttons, call `widget-setup` to enable interaction, and retrieve user input with `widget-value`.

What widget types are available for building Emacs UI elements?

The Emacs widget library provides text inputs (editable-field, text), buttons (push-button, link), and selection controls (checkbox, radio-button-choice, menu-choice). Each type supports configuration options and value retrieval through the widget API.

Can I create configuration interfaces and settings editors in Emacs without external frameworks?

Yes. The widget library enables lightweight UI components directly in text buffers for configuration interfaces, dialogs, and data-entry forms. Manage the widget lifecycle—create, setup, interact, and query values—using built-in widget.el APIs.

How do I navigate and submit data through Emacs widgets?

Move between widgets using `widget-forward` and `widget-backward`. Attach notification callbacks to buttons with `:notify` to capture submissions. Retrieve all entered values with `widget-value` on each widget after user interaction.

What's required to set up and enable widgets in an Emacs buffer?

Require the widget library with `(require 'widget)` and compile-time `(eval-when-compile (require 'wid-edit))`. Create widgets, set the local keymap to `widget-keymap`, and call `widget-setup` to initialize interaction in the buffer.