Documentation
¶
Index ¶
- func Bool(v bool) *bool
- func Collapsible(config CollapsibleConfig) vdom.Attr
- func Dialog(config DialogConfig) vdom.Attr
- func Draggable(config DraggableConfig) vdom.Attr
- func Dropdown(config DropdownConfig) vdom.Attr
- func FocusTrap(config FocusTrapConfig) vdom.Attr
- func Int(v int) *int
- func Popover(config PopoverConfig) vdom.Attr
- func PopoverContentAttr() vdom.Attr
- func PopoverTriggerAttr() vdom.Attr
- func Portal(config PortalConfig) vdom.Attr
- func Resizable(config ResizableConfig) vdom.Attr
- func RovingFocus(config RovingFocusConfig) vdom.Attr
- func RovingFocusItemAttr() vdom.Attr
- func Sortable(config any) vdom.Attr
- func Tooltip(config TooltipConfig) vdom.Attr
- type CollapsibleConfig
- type DialogConfig
- type DraggableConfig
- type DropdownConfig
- type FocusTrapConfig
- type PopoverConfig
- type PortalConfig
- type ResizableConfig
- type RovingFocusConfig
- type SortableConfig
- type TooltipConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶ added in v0.2.0
Bool returns a pointer to v for hook config fields where false is a meaningful explicit value and nil means "use the client hook default".
func Collapsible ¶ added in v0.2.0
func Collapsible(config CollapsibleConfig) vdom.Attr
Collapsible creates a Collapsible hook attribute.
func Dialog ¶ added in v0.2.0
func Dialog(config DialogConfig) vdom.Attr
Dialog creates a Dialog hook attribute.
func Draggable ¶
func Draggable(config DraggableConfig) vdom.Attr
Draggable creates a Draggable hook attribute.
func Dropdown ¶
func Dropdown(config DropdownConfig) vdom.Attr
Dropdown creates a Dropdown hook attribute.
func FocusTrap ¶ added in v0.2.0
func FocusTrap(config FocusTrapConfig) vdom.Attr
FocusTrap creates a FocusTrap hook attribute.
func Int ¶ added in v0.2.0
Int returns a pointer to v for hook config fields where 0 is a meaningful explicit value and nil means "use the client hook default".
func Popover ¶ added in v0.2.0
func Popover(config PopoverConfig) vdom.Attr
Popover creates a Popover hook attribute.
func PopoverContentAttr ¶ added in v0.2.0
PopoverContentAttr marks the floating content element inside a Popover hook root.
func PopoverTriggerAttr ¶ added in v0.2.0
PopoverTriggerAttr marks the trigger element inside a Popover hook root.
func Portal ¶ added in v0.2.0
func Portal(config PortalConfig) vdom.Attr
Portal creates a Portal hook attribute.
func Resizable ¶ added in v0.2.0
func Resizable(config ResizableConfig) vdom.Attr
Resizable creates a Resizable hook attribute.
func RovingFocus ¶ added in v0.2.0
func RovingFocus(config RovingFocusConfig) vdom.Attr
RovingFocus creates a RovingFocus hook attribute.
func RovingFocusItemAttr ¶ added in v0.2.0
RovingFocusItemAttr marks an item as participating in a RovingFocus hook.
func Tooltip ¶
func Tooltip(config TooltipConfig) vdom.Attr
Tooltip creates a Tooltip hook attribute.
Types ¶
type CollapsibleConfig ¶ added in v0.2.0
type CollapsibleConfig struct {
Open *bool `json:"open,omitempty"`
Duration *int `json:"duration,omitempty"`
HiddenWhenClosed *bool `json:"hiddenWhenClosed,omitempty"`
}
CollapsibleConfig configures the Collapsible hook.
Use it with disclosure-style markup where the trigger owns aria-expanded and aria-controls, and the panel owns the referenced id.
type DialogConfig ¶ added in v0.2.0
type DialogConfig struct {
CloseOnEscape *bool `json:"closeOnEscape,omitempty"`
CloseOnOutside *bool `json:"closeOnOutside,omitempty"`
InitialFocus string `json:"initialFocus,omitempty"`
}
DialogConfig configures the Dialog hook.
The client-side hook provides Escape handling, optional outside-click close, focus trapping, initial focus, scroll locking, and focus restoration.
type DraggableConfig ¶
type DraggableConfig struct {
Axis string `json:"axis,omitempty"` // "x", "y", or "both"
Handle string `json:"handle,omitempty"`
Revert bool `json:"revert,omitempty"`
}
DraggableConfig configures the Draggable hook.
type DropdownConfig ¶
type DropdownConfig struct {
CloseOnEscape *bool `json:"closeOnEscape,omitempty"`
CloseOnClickOutside *bool `json:"closeOnClickOutside,omitempty"`
// Deprecated: use CloseOnClickOutside. Kept for pre-beta migration.
CloseOnClick *bool `json:"-"`
}
DropdownConfig configures the Dropdown hook.
type FocusTrapConfig ¶ added in v0.2.0
type FocusTrapConfig struct {
Active *bool `json:"active,omitempty"`
}
FocusTrapConfig configures the FocusTrap hook.
type PopoverConfig ¶ added in v0.2.0
type PopoverConfig struct {
CloseOnEscape *bool `json:"closeOnEscape,omitempty"`
CloseOnOutside *bool `json:"closeOnOutside,omitempty"`
Side string `json:"side,omitempty"`
Align string `json:"align,omitempty"`
Offset int `json:"offset,omitempty"`
}
PopoverConfig configures the Popover hook.
The client-side hook handles positioning, Escape close, outside-click close, scroll repositioning, and resize repositioning. Mark the trigger element with PopoverTriggerAttr() and the floating panel with PopoverContentAttr().
type PortalConfig ¶ added in v0.2.0
type PortalConfig struct {
Target string `json:"target,omitempty"`
}
PortalConfig configures the Portal hook.
type ResizableConfig ¶ added in v0.2.0
type ResizableConfig struct {
Handles string `json:"handles,omitempty"`
MinWidth int `json:"minWidth,omitempty"`
MaxWidth int `json:"maxWidth,omitempty"`
MinHeight int `json:"minHeight,omitempty"`
MaxHeight int `json:"maxHeight,omitempty"`
Step int `json:"step,omitempty"`
LargeStep int `json:"largeStep,omitempty"`
Label string `json:"label,omitempty"`
}
ResizableConfig configures the Resizable hook.
type RovingFocusConfig ¶ added in v0.2.0
type RovingFocusConfig struct {
ItemSelector string `json:"itemSelector,omitempty"`
DisabledSelector string `json:"disabledSelector,omitempty"`
Orientation string `json:"orientation,omitempty"` // horizontal, vertical, or both
Loop *bool `json:"loop,omitempty"`
ActivateOnFocus *bool `json:"activateOnFocus,omitempty"`
ActiveIndex *int `json:"activeIndex,omitempty"`
}
RovingFocusConfig configures the RovingFocus hook.
Use it with composite widgets such as tablists, menus, listboxes, and toolbars. The hook manages roving tabindex and Arrow/Home/End keyboard focus.
type SortableConfig ¶
type SortableConfig struct {
Group string `json:"group,omitempty"`
Animation int `json:"animation,omitempty"`
GhostClass string `json:"ghostClass,omitempty"`
Handle string `json:"handle,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}
SortableConfig configures the Sortable hook.
type TooltipConfig ¶
type TooltipConfig struct {
Content string `json:"content"`
Placement string `json:"placement,omitempty"` // top, bottom, left, right
Delay int `json:"delay,omitempty"` // ms
Trigger string `json:"trigger,omitempty"` // hover, click, focus
}
TooltipConfig configures the Tooltip hook.