commandbar

package
v0.0.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

templ: version: v0.3.977

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandBar

func CommandBar(props Props) templ.Component

CommandBar renders an expandable multi-mode command input. Supports text input, file upload, and voice recording modes. Collapsed: placeholder bar with shortcut buttons. Expanded: tabbed interface with mode-specific content.

Types

type CommandBarSignals

type CommandBarSignals struct {
	Mode      string `json:"mode"`      // "" | "text" | "file" | "voice"
	Text      string `json:"text"`      // text input value
	Recording bool   `json:"recording"` // voice recording active
}

CommandBarSignals holds the reactive state for the command bar.

type Props

type Props struct {
	ID          string
	Class       string
	Attributes  templ.Attributes
	Placeholder string   // placeholder text when collapsed (default "Type something...")
	SubmitURL   string   // POST endpoint for text submit
	UploadURL   string   // POST endpoint for file upload (enables file tab)
	VoiceURL    string   // POST endpoint for voice (enables voice tab)
	Suggestions []string // quick-fill suggestion chips in text mode
	FileHint    string   // subtitle in file drop zone (default "Drop a file or click to browse")
	Embedded    bool     // when true: no collapsed state, no close behavior, no outer chrome
}

Props configures the command bar.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL