a11y

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlertDialog

func AlertDialog(parseProps AlertDialogProps) ui.Node

AlertDialog renders a headless alertdialog: role="alertdialog", aria-modal, aria-labelledby/aria-describedby wired to the title/message, and action buttons. Drive open/close from component state and pair with ui.AccessibleOverlay (G10) for focus trap + Esc.

func Combobox

func Combobox(parseProps ComboboxProps) ui.Node

Combobox renders the input/listbox shell expected by screen readers.

func DatePicker

func DatePicker(parseProps DatePickerProps) ui.Node

DatePicker renders a headless grid for one month.

func Listbox

func Listbox(parseProps ListboxProps) ui.Node

Listbox renders a headless listbox with option selection state.

func Menu(parseProps MenuProps) ui.Node

Menu renders a WAI-ARIA menu surface using the core focus/composite primitives.

func RadioGroup

func RadioGroup(parseProps RadioGroupProps) ui.Node

RadioGroup renders a headless radio group following the WAI-ARIA radiogroup pattern: role="radiogroup" wrapping role="radio" options with aria-checked / aria-disabled, and a single roving tab stop (tabindex 0 on the checked radio, or the first enabled one when none is selected; all others tabindex -1). Wire arrow-key navigation with ui.UseCompositeNavigation and reflect the active index back through Item.Selected — so Segmented/Swatch/Toggle controls get correct radiogroup semantics without each reimplementing them.

func Table

func Table(parseProps TableProps) ui.Node

Table renders a semantic data table with stable headers and captions.

Types

type AlertDialogProps

type AlertDialogProps struct {
	ID        string
	Title     string
	Message   string
	Buttons   []DialogButton
	OnDismiss func()
}

AlertDialogProps configures a headless WAI-ARIA alert dialog — the themeable, e2e-drivable replacement for window.confirm/alert (G18).

type ComboboxProps

type ComboboxProps struct {
	ID          string
	Label       string
	Value       string
	Expanded    bool
	ActiveID    string
	Placeholder string
	Items       []Item
}

type DatePickerProps

type DatePickerProps struct {
	ID       string
	Label    string
	Month    time.Month
	Year     int
	Selected int
}

type DialogButton

type DialogButton struct {
	ID      string
	Label   string
	OnClick func()
	// Primary marks the default/confirm action.
	Primary bool
}

DialogButton is one action button in a dialog.

type Item

type Item struct {
	ID       string
	Label    string
	Value    string
	Disabled bool
	Selected bool
}

Item describes one option in headless composite widgets.

type ListboxProps

type ListboxProps struct {
	ID       string
	Label    string
	ActiveID string
	Items    []Item
	// MultiSelect declares the listbox allows multiple selected options. When true the container
	// gets aria-multiselectable="true" — required by WAI-ARIA 1.2 §5.5 so assistive tech announces
	// the multi-select mode (per-option aria-selected alone is not enough).
	MultiSelect bool
}
type MenuProps struct {
	ID       string
	Label    string
	Open     bool
	ActiveID string
	Items    []Item
}

type RadioGroupProps

type RadioGroupProps struct {
	ID          string
	Label       string
	Orientation string // "horizontal" (default) or "vertical"
	Items       []Item
}

RadioGroupProps configures a headless WAI-ARIA radio group. Mark the chosen option with Item.Selected; Item.Disabled removes it from the tab order.

type TableColumn

type TableColumn struct {
	ID     string
	Header string
}

type TableProps

type TableProps struct {
	ID      string
	Caption string
	Columns []TableColumn
	Rows    []map[string]string
}

Jump to

Keyboard shortcuts

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