Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Here is a self-contained sidebar prompt widget built with HTML, CSS, and vanilla JavaScript. It provides a prompt field, a copy button, and text feedback; it does not send prompts to an AI service. “Zero-dependency” means the example needs no third-party runtime package—not that it requires no code or will automatically satisfy every host site’s Content Security Policy (CSP).

What the widget does—and does not do

The widget is a compact interface for drafting and copying a prompt. It has no API endpoint, model connection, package installation, or framework requirement. To make it generate AI responses, you would need to connect it to a service separately, typically through a server-side endpoint that protects credentials; that integration is outside this example.

The implementation uses standard form controls and keeps its interaction minimal. Its cyberpunk styling is decorative: the prompt remains readable, buttons remain native buttons, and status feedback is written as text rather than communicated by color alone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Full source code

Save this as an HTML file to try the standalone version. For a website sidebar, you can move the markup into the sidebar template and place the CSS and JavaScript in the host site’s asset files, as described below.

#1 Best Overall
BTXETUEL Sayodevice OSU Keypad 12-Key USB Hotswappable Red Mechanical Switch Keyboard
  • 1. With 12 Otuemu Red Speed Switches.
  • 2. HID Standard Keyboard, Plug and Play without driver.
  • 3. Compatible With Windows, Linux, MacOS, Android, Raspberry and it's easy to use for everyone.
  • 4. The function of custom keypad: Shortcut keys, Multi-step operation, Multi-key in one, Copy and Paste, Cut, Undo, Redo, Select all, Play, Pause, Volume, Switch song, Forward, Backward, Custom script, etc.
  • 5. Each button can be set to a different function mode without affecting each other.
<aside class="prompt-widget" aria-labelledby="prompt-widget-title">
  <h2 id="prompt-widget-title">NEON PROMPT // 01</h2>
  <p class="widget-description">Draft a prompt, then copy it to use elsewhere.</p>

  <form class="prompt-form">
    <label for="prompt-input">Your prompt</label>
    <textarea id="prompt-input" name="prompt" rows="5"
      placeholder="Describe what you want help with…"></textarea>
    <div class="widget-actions">
      <button class="copy-button" type="submit">Copy prompt</button>
      <button class="clear-button" type="button">Clear</button>
    </div>
    <p class="widget-status" role="status" aria-live="polite"></p>
  </form>
</aside>

<style>
  .prompt-widget {
    --widget-bg: #10131d;
    --widget-panel: #171c2a;
    --widget-text: #f1f4ff;
    --widget-muted: #b8c0d8;
    --widget-cyan: #6df7ff;
    --widget-pink: #ff5bd6;
    --widget-border: #39445d;
    box-sizing: border-box;
    width: 100%;
    padding: 1.25rem;
    color: var(--widget-text);
    background: var(--widget-bg);
    border: 1px solid var(--widget-border);
    border-radius: 0.75rem;
    font: 1rem/1.5 system-ui, sans-serif;
  }

  .prompt-widget * { box-sizing: border-box; }

  .prompt-widget h2 {
    margin: 0 0 0.4rem;
    color: var(--widget-cyan);
    font-size: 1.1rem;
    letter-spacing: 0.08em;
  }

  .widget-description {
    margin: 0 0 1rem;
    color: var(--widget-muted);
  }

  .prompt-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 650;
  }

  .prompt-form textarea {
    display: block;
    width: 100%;
    min-height: 8rem;
    padding: 0.75rem;
    resize: vertical;
    color: var(--widget-text);
    background: var(--widget-panel);
    border: 1px solid var(--widget-border);
    border-radius: 0.4rem;
    font: inherit;
  }

  .prompt-form textarea::placeholder { color: var(--widget-muted); }

  .widget-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.8rem;
  }

  .widget-actions button {
    min-height: 2.75rem;
    padding: 0.55rem 0.9rem;
    color: var(--widget-text);
    background: var(--widget-panel);
    border: 1px solid var(--widget-cyan);
    border-radius: 0.4rem;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
  }

  .widget-actions .copy-button {
    color: #071216;
    background: var(--widget-cyan);
  }

  .widget-actions button:hover { border-color: var(--widget-pink); }

  .prompt-widget :focus-visible {
    outline: 3px solid var(--widget-pink);
    outline-offset: 3px;
  }

  .widget-status {
    min-height: 1.5em;
    margin: 0.75rem 0 0;
    color: var(--widget-cyan);
  }

  @media (prefers-reduced-motion: no-preference) {
    .prompt-widget {
      animation: widget-arrive 350ms ease-out both;
    }

    @keyframes widget-arrive {
      from { opacity: 0; transform: translateY(0.5rem); }
      to { opacity: 1; transform: translateY(0); }
    }
  }
</style>

<script>
  (() => {
    const widget = document.querySelector(".prompt-widget");
    if (!widget) return;

    const form = widget.querySelector(".prompt-form");
    const input = widget.querySelector("#prompt-input");
    const status = widget.querySelector(".widget-status");
    const clearButton = widget.querySelector(".clear-button");

    form.addEventListener("submit", async (event) => {
      event.preventDefault();
      const prompt = input.value.trim();

      if (!prompt) {
        status.textContent = "Enter a prompt before copying.";
        input.focus();
        return;
      }

      try {
        await navigator.clipboard.writeText(prompt);
        status.textContent = "Prompt copied to the clipboard.";
      } catch {
        status.textContent = "Clipboard access failed. Select and copy the prompt manually.";
        input.focus();
        input.select();
      }
    });

    clearButton.addEventListener("click", () => {
      input.value = "";
      status.textContent = "Prompt cleared.";
      input.focus();
    });
  })();
</script>

Add it to a website sidebar

Use the standalone version

Save the complete example as an HTML file and open it in a browser. This is convenient for inspecting the layout and interaction. Clipboard access may depend on the browser’s security context and permissions, so the page can display the manual-copy fallback instead.

Embed it in an existing site

  1. Place the markup: Add the <aside> block to the sidebar template or content area where the widget should appear. Keep the label’s for value matched to the textarea’s id.
  2. Move the styles: Put the contents of the <style> element in a stylesheet loaded by the site. The CSS is scoped beneath .prompt-widget to reduce unintended effects on surrounding page elements.
  3. Move the script: Put the JavaScript in a separately served file and load it with the site’s normal asset mechanism. If the script is loaded before the sidebar markup, use a deferred script or otherwise ensure the markup exists before the code runs.
  4. Check the real page: Test the widget in the deployed embedding context, including keyboard use, clipboard behavior, reduced-motion preference, and the browser console for CSP errors.

Keyboard access and visible focus

The textarea and buttons are native interactive HTML elements, so they provide built-in keyboard interaction. Users can tab to the controls, type in the field, activate buttons with the keyboard, and see a visible focus outline. Avoid removing outlines globally: MDN’s guidance on keyboard-navigable JavaScript widgets recommends visible focus and discusses using :focus-visible when styling indicators.

Rank #2
Sale
VSD M18 Macro Pad Programmable Keypad, Stream Controller Streaming Deck, Customizable LCD keys, Gaming shortcut keyboard, USB sound board, Trigger actions in OBS, Twitch, YouTube, Works with PC Mac
  • 18 Programmable Keys Macro Keypad: This stream controller deck comes with 18 customizable macro keys (15 LCD visual keys + 3 physical buttons). Users may program single actions or multi-step sequences for daily operation. The keys support in-game combos, app launch and media playback control for multiple usage scenarios. Each LCD key accepts JPG, PNG and GIF images and animations to mark separate functions
  • Single Tap Control: This USB macro keyboard pad supports single tap commands for quick operation. Users can trigger pre-set macros, input text, open files and web pages, adjust media playback, or switch OBS scenes with one tap. The straightforward layout fits gaming, live streaming and professional office task setup
  • One Tap Multi-Shortcut: This macro controller pad streaming deck supports multi-shortcut macro programming for gamers and content creators. Custom shortcuts simplify game combo inputs, video editing, music production and photography workflows. The Operation Follow function runs multiple macro steps in custom order or simultaneous execution for adjustable task control
  • Adjustable RGB Surround Light Ring - VSD M18 gaming streaming deck features an outer RGB light ring with auto color cycle mode. Custom RGB tones are available via device firmware upgrade. The light ring offers adjustable visual lighting for dim gaming, streaming and night work setups.
  • Wide System Compatibility: This VSDinside macro control board works with Windows 11 and newer, macOS 11.0 and newer systems. Connect via USB-C cable for immediate use. It is compatible with mainstream software including OBS, Streamlabs, YouTube, Twitter, Discord, Excel, Word and Photoshop for daily production work. Native Linux system plug-and-play support is not available, while SDK development documents are provided for custom secondary development

The status message uses text as well as color, so success and error states are not distinguished only by hue. If you adapt the widget, preserve a clear label and focus indication, and check the complete interface against applicable accessibility requirements rather than treating this snippet as a compliance certification.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reduced-motion behavior

The brief entrance animation only runs inside @media (prefers-reduced-motion: no-preference). When a visitor asks their operating system or browser to reduce motion, that animation rule does not apply. The static layout and controls remain available either way.

Rank #3
Ne fashion Single Keyboard Switch Game Keypad Programmable Macro PC One Keyboard User-Defined USB Switch Button 1 Key to Enter Password
  • This is a Standard HID Keyboard with Programmable Key,You can set the keyboard buttons. It can as usb pushbutton swith for Game/DIY,Supports Mac/Windows.No Need to Download Software
  • 1.Support any key keyboard eg."enter", "ESC" "A" and so on;2.Support key combination eg. A key to copy/paste,short press to copy, long press to paste/"Ctrl + Shift + s";3.Support multimedia control eg. Cut the song and volume adjustment;4.Supports mouse movement and clicking, , and automatic Enter,after pressing the button;5.Support a key to enter the password,Auto Click A string of characters,like"ijnr00Ed"
  • The keyboard with Adjustable RGB light,cherry mx Red switch, Mechanical Keyboard
  • Package include:1*single key,1*1.5m USB Cable Everyone have different needs,Some special combinations key that we have not listed may not work, Thank you for your understanding.

W3C WAI documents CSS and JavaScript techniques for responding to reduced-motion preferences, including CSS technique C39 and JavaScript technique SCR40. These are techniques for addressing the preference, not a blanket certification of a component.

Content Security Policy and deployment limits

The example shows inline <style> and <script> blocks for readability. A site’s CSP may block those blocks, inline event handlers, or inline styles depending on its directives. A zero-dependency widget can therefore still need changes to fit the host’s policy. MDN’s Content Security Policy guide explains these resource restrictions and their role in reducing cross-site scripting risk.

Rank #4
Mini 2-Key Programmable Keyboard with Hotswappable Mechanical Switches
  • 【Package Listing】1*mini 2-key keyboard,1*5 feet long USB data cable,2*replacement keycaps.
  • 【Key Custom Keyboard】 Open the webpage link "SayoDevice. com",you can set any key combination you desire.
  • 【Multifunctional keyboard】You can also set "Play, Pause, Volume, Switch song, Forward, Backward, Custom script, etc''.
  • 【RGB Light】The keyboard also allows for customizing the RGB lighting settings on the website.
  • 【Compatibility】Compatible with both Windows and Mac OS.
  • Prefer serving the script and stylesheet as separate files when the site’s policy disallows inline code.
  • If the host uses nonces or hashes for approved inline code, follow the site’s existing deployment process rather than weakening its policy to accommodate a demo.
  • Do not assume the snippet will work unchanged in every CMS, theme, or sidebar editor; some sanitize markup or impose additional script restrictions.

The JavaScript reads the textarea value and writes it to the clipboard; it does not insert user text into the page as HTML. If you extend the widget to display generated or user-supplied content, handle that content safely and test the result under the site’s security policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What “zero-dependency” means here

This example relies on browser-provided HTML, CSS, and JavaScript rather than a third-party package or framework. It still depends on the browser’s support for the APIs it uses, the site’s markup and asset-loading setup, and its security policy. The label describes the implementation’s package requirements—not universal compatibility, accessibility conformance, or an AI connection.

Best Value
MOSHOU 12-Key Programmable Macro Pad with Knob, RGB Shortcut Keyboard,Black
  • 12 KEYS With 2 KNOB FULLY PROGRAMMABLE:mini keypad with macro knobs is perfect for making work faster, plays games smoothly etc. The knobs (Rotate Left/Right, Press Down) is programmable, also can be rotated steplessly (Enter Up To 18-Characters at Once).
  • 6 LIGHT MODES SELECTABLE: MODE 0: Lights OFF/ MODE 1: All keys lit up./ MODE 2: Key1 to Key12 Lights Up Sequentially./ MODE 3: Key12 to Key1 Lights Up Sequentially./ MODE 4: Keys Lighting Response./ MODE 5: Default white light. (Note: Lighting modes are only available in Wired Mode.).
  • Triple Mode Connectivity:Supports USB wired, Bluetooth, and 2.4G wireless receiver connections,Please note that all custom settings must be configured and saved in wired mode before using wireless connections.
  • 3-Layer Macro Customization:Supports up to 3 programmable macro layers for different tasks and applications.Wired connection has the highest priority, while Bluetooth or 2.4G will connect based on the first active device.
  • Easy Software Setup with Memory Function:The manual images are designed for this keyboard series and may vary slightly by model. After setup, the keyboard supports memory function to save your customized settings. Please download the corresponding software from the product detail page to start your personalized customization experience.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.