Documentation
¶
Index ¶
- func Alert(opts AlertOpts) templ.Component
- func AlertActions() templ.Component
- func AlertActionsAttrs(attrs templ.Attributes) templ.Component
- func AlertAttrs(opts AlertOpts, attrs templ.Attributes) templ.Component
- func AlertContent() templ.Component
- func AlertContentAttrs(attrs templ.Attributes) templ.Component
- func AlertDescription() templ.Component
- func AlertDescriptionAttrs(attrs templ.Attributes) templ.Component
- func AlertIcon() templ.Component
- func AlertIconAttrs(attrs templ.Attributes) templ.Component
- func AlertTitle(level int) templ.Component
- func AlertTitleAttrs(level int, attrs templ.Attributes) templ.Component
- func AsyncPlaceholder() templ.Attributes
- func Aura(opts AuraOpts) templ.Component
- func AuraAttrs(opts AuraOpts, attrs templ.Attributes) templ.Component
- func Autohide(opts AutohideOpts) templ.Component
- func AutohideAttrs(opts AutohideOpts, attrs templ.Attributes) templ.Component
- func Avatar(opts AvatarOpts) templ.Component
- func AvatarAttrs(opts AvatarOpts, attrs templ.Attributes) templ.Component
- func Avatars(opts AvatarsOpts) templ.Component
- func AvatarsAttrs(opts AvatarsOpts, attrs templ.Attributes) templ.Component
- func AvatarsOverflow() templ.Component
- func AvatarsOverflowCount() templ.Component
- func Badge(opts BadgeOpts) templ.Component
- func BadgeAttrs(opts BadgeOpts, attrs templ.Attributes) templ.Component
- func Boundary(opts BoundaryOpts) templ.Component
- func BoundaryAttrs(opts BoundaryOpts, attrs templ.Attributes) templ.Component
- func Breadcrumb(items []BreadcrumbItem) templ.Component
- func BreadcrumbAttrs(items []BreadcrumbItem, attrs templ.Attributes) templ.Component
- func BreadcrumbSep() templ.Component
- func BreadcrumbSepAttrs(attrs templ.Attributes) templ.Component
- func BreadcrumbWith(items []BreadcrumbItem, opts BreadcrumbOpts, attrs templ.Attributes) templ.Component
- func Button(opts ButtonOpts) templ.Component
- func ButtonAttrs(opts ButtonOpts, attrs templ.Attributes) templ.Component
- func ButtonGroup(opts ButtonGroupOpts) templ.Component
- func ButtonGroupAttrs(opts ButtonGroupOpts, attrs templ.Attributes) templ.Component
- func Card(opts CardOpts) templ.Component
- func CardActions() templ.Component
- func CardActionsAttrs(attrs templ.Attributes) templ.Component
- func CardAttrs(opts CardOpts, attrs templ.Attributes) templ.Component
- func CardBody() templ.Component
- func CardBodyAttrs(attrs templ.Attributes) templ.Component
- func CardDescription() templ.Component
- func CardDescriptionAttrs(attrs templ.Attributes) templ.Component
- func CardFooter() templ.Component
- func CardFooterAttrs(attrs templ.Attributes) templ.Component
- func CardHeader() templ.Component
- func CardHeaderAttrs(attrs templ.Attributes) templ.Component
- func CardMedia() templ.Component
- func CardMediaAttrs(attrs templ.Attributes) templ.Component
- func CardTitle() templ.Component
- func CardTitleAttrs(attrs templ.Attributes) templ.Component
- func Carousel(opts CarouselOpts) templ.Component
- func CarouselAttrs(opts CarouselOpts, attrs templ.Attributes) templ.Component
- func CarouselDotTemplate() templ.Component
- func CarouselNext() templ.Attributes
- func CarouselPause() templ.Attributes
- func CarouselPrev() templ.Attributes
- func CarouselSlide(value string) templ.Component
- func CarouselSlideAttrs(value string, attrs templ.Attributes) templ.Component
- func CarouselTrack() templ.Component
- func CarouselTrackAttrs(attrs templ.Attributes) templ.Component
- func CarouselWhenPaused() templ.Component
- func CarouselWhenPausedAttrs(attrs templ.Attributes) templ.Component
- func CarouselWhenPlaying() templ.Component
- func CarouselWhenPlayingAttrs(attrs templ.Attributes) templ.Component
- func Checkbox(opts CheckboxOpts) templ.Component
- func CheckboxAttrs(opts CheckboxOpts, attrs templ.Attributes) templ.Component
- func Clipcopy(opts ClipcopyOpts) templ.Component
- func ClipcopyAttrs(opts ClipcopyOpts, attrs templ.Attributes) templ.Component
- func ClipcopyCopied() templ.Component
- func ClipcopyCopiedAttrs(attrs templ.Attributes) templ.Component
- func ClipcopyIdle() templ.Component
- func ClipcopyIdleAttrs(attrs templ.Attributes) templ.Component
- func ColorField[N Number](opts ColorFieldOpts[N]) templ.Component
- func ColorFieldAttrs[N Number](opts ColorFieldOpts[N], attrs templ.Attributes) templ.Component
- func Combobox(opts ComboboxOpts) templ.Component
- func ComboboxAttrs(opts ComboboxOpts, attrs templ.Attributes) templ.Component
- func ComboboxEmpty() templ.Component
- func ComboboxEmptyAttrs(attrs templ.Attributes) templ.Component
- func ContextMenu(opts ContextMenuOpts) templ.Component
- func ContextMenuAttrs(opts ContextMenuOpts, attrs templ.Attributes) templ.Component
- func ContextMenuTrigger() templ.Component
- func ContextMenuTriggerAttrs(attrs templ.Attributes) templ.Component
- func Datalist(opts DatalistOpts) templ.Component
- func DatalistAttrs(opts DatalistOpts, attrs templ.Attributes) templ.Component
- func Dialog(opts DialogOpts) templ.Component
- func DialogAttrs(opts DialogOpts, attrs templ.Attributes) templ.Component
- func DialogBody() templ.Component
- func DialogBodyAttrs(attrs templ.Attributes) templ.Component
- func DialogClose() templ.Attributes
- func DialogDescription() templ.Component
- func DialogDescriptionAttrs(attrs templ.Attributes) templ.Component
- func DialogFooter() templ.Component
- func DialogFooterAttrs(attrs templ.Attributes) templ.Component
- func DialogHeader() templ.Component
- func DialogHeaderAttrs(attrs templ.Attributes) templ.Component
- func DialogTitle() templ.Component
- func DialogTitleAttrs(attrs templ.Attributes) templ.Component
- func DialogTrigger() templ.Attributes
- func Drawer(opts DrawerOpts) templ.Component
- func DrawerAttrs(opts DrawerOpts, attrs templ.Attributes) templ.Component
- func DrawerBody() templ.Component
- func DrawerBodyAttrs(attrs templ.Attributes) templ.Component
- func DrawerClose() templ.Attributes
- func DrawerDescription() templ.Component
- func DrawerDescriptionAttrs(attrs templ.Attributes) templ.Component
- func DrawerFooter() templ.Component
- func DrawerFooterAttrs(attrs templ.Attributes) templ.Component
- func DrawerHeader() templ.Component
- func DrawerHeaderAttrs(attrs templ.Attributes) templ.Component
- func DrawerTitle() templ.Component
- func DrawerTitleAttrs(attrs templ.Attributes) templ.Component
- func DrawerTrigger() templ.Attributes
- func Elastic(opts ElasticOpts) templ.Component
- func ElasticAttrs(opts ElasticOpts, attrs templ.Attributes) templ.Component
- func EmptyQuery() templ.Component
- func EmptyQueryAttrs(attrs templ.Attributes) templ.Component
- func EmptyResults() templ.Component
- func EmptyResultsAttrs(attrs templ.Attributes) templ.Component
- func Icon(name string) templ.Component
- func IconAttrs(name string, attrs templ.Attributes) templ.Component
- func IconBase() string
- func IconWith(name, base string) templ.Component
- func IfNetwork(opts IfNetworkOpts) templ.Component
- func IfNetworkAttrs(opts IfNetworkOpts, attrs templ.Attributes) templ.Component
- func IfPlatform(opts IfPlatformOpts) templ.Component
- func IfPlatformAttrs(opts IfPlatformOpts, attrs templ.Attributes) templ.Component
- func InputGroup() templ.Component
- func InputGroupAttrs(attrs templ.Attributes) templ.Component
- func Item(opts ItemOpts) templ.Attributes
- func Kbd(opts KbdOpts) templ.Component
- func KbdAttrs(opts KbdOpts, attrs templ.Attributes) templ.Component
- func KbdGroup() templ.Component
- func KbdGroupAttrs(attrs templ.Attributes) templ.Component
- func Keys(opts KeysOpts) templ.Component
- func KeysAttrs(opts KeysOpts, attrs templ.Attributes) templ.Component
- func Layout(opts LayoutOpts) templ.Component
- func LayoutAttrs(opts LayoutOpts, attrs templ.Attributes) templ.Component
- func Lightbox(opts LightboxOpts) templ.Component
- func LightboxAttrs(opts LightboxOpts, attrs templ.Attributes) templ.Component
- func LightboxClose() templ.Attributes
- func LightboxContent() templ.Attributes
- func LightboxTitle() templ.Attributes
- func LightboxTrigger() templ.Attributes
- func Link(opts LinkOpts) templ.Component
- func LinkAttrs(opts LinkOpts, attrs templ.Attributes) templ.Component
- func Menu(opts MenuOpts) templ.Component
- func MenuAttrs(opts MenuOpts, attrs templ.Attributes) templ.Component
- func MenuItem(opts MenuItemOpts) templ.Component
- func MenuItemAttrs(opts MenuItemOpts, attrs templ.Attributes) templ.Component
- func NavGroup(opts NavGroupOpts) templ.Component
- func NavGroupAttrs(opts NavGroupOpts, attrs templ.Attributes) templ.Component
- func NavGroupItem() templ.Attributes
- func OptGroup(opts OptGroupOpts) templ.Component
- func OptGroupAttrs(opts OptGroupOpts, attrs templ.Attributes) templ.Component
- func Option(opts OptionOpts) templ.Component
- func OptionAttrs(opts OptionOpts, attrs templ.Attributes) templ.Component
- func OptionTrigger() templ.Component
- func OptionTriggerAttrs(attrs templ.Attributes) templ.Component
- func Pagination(opts PaginationOpts) templ.Component
- func PaginationAttrs(opts PaginationOpts, attrs templ.Attributes) templ.Component
- func Persist(opts PersistOpts) templ.Component
- func PersistAttrs(opts PersistOpts, attrs templ.Attributes) templ.Component
- func PersistFor(opts PersistOpts) templ.Component
- func Popover(opts PopoverOpts) templ.Component
- func PopoverAsyncRetry() templ.Attributes
- func PopoverAttrs(opts PopoverOpts, attrs templ.Attributes) templ.Component
- func PopoverClose() templ.Attributes
- func PopoverContent() templ.Attributes
- func PopoverTrigger() templ.Attributes
- func Progress[N Number](opts ProgressOpts[N]) templ.Component
- func ProgressAttrs[N Number](opts ProgressOpts[N], attrs templ.Attributes) templ.Component
- func ProgressMarkAt[N Number](value N) templ.Component
- func ProgressMarkAtAttrs[N Number](value N, attrs templ.Attributes) templ.Component
- func Radio(opts RadioOpts) templ.Component
- func RadioAttrs(opts RadioOpts, attrs templ.Attributes) templ.Component
- func RadioGroup(opts RadioGroupOpts) templ.Component
- func RadioGroupAttrs(opts RadioGroupOpts, attrs templ.Attributes) templ.Component
- func Rating(opts RatingOpts) templ.Component
- func RatingAttrs(opts RatingOpts, attrs templ.Attributes) templ.Component
- func Resizable[N Number](opts ResizableOpts[N]) templ.Component
- func ResizableAttrs[N Number](opts ResizableOpts[N], attrs templ.Attributes) templ.Component
- func ResizableIcon(handle string) templ.Attributes
- func Revealable(opts RevealableOpts) templ.Component
- func RevealableAttrs(opts RevealableOpts, attrs templ.Attributes) templ.Component
- func Select(opts SelectOpts) templ.Component
- func SelectAttrs(opts SelectOpts, attrs templ.Attributes) templ.Component
- func SelectEmpty() templ.Component
- func SelectEmptyAttrs(attrs templ.Attributes) templ.Component
- func SetIconBase(base string)
- func SetIconFS(f fs.FS)
- func Sidebar(opts SidebarOpts) templ.Component
- func SidebarAttrs(opts SidebarOpts, attrs templ.Attributes) templ.Component
- func SidebarClose() templ.Attributes
- func SidebarContent() templ.Attributes
- func SidebarFooter() templ.Component
- func SidebarFooterAttrs(attrs templ.Attributes) templ.Component
- func SidebarHeader() templ.Component
- func SidebarHeaderAttrs(attrs templ.Attributes) templ.Component
- func Skeleton(opts SkeletonOpts) templ.Component
- func SkeletonAttrs(opts SkeletonOpts, attrs templ.Attributes) templ.Component
- func Slider[N Number](opts SliderOpts[N]) templ.Component
- func SliderAnchor() templ.Component
- func SliderAttrs[N Number](opts SliderOpts[N], attrs templ.Attributes) templ.Component
- func SliderMarkAt[N Number](value N) templ.Component
- func SliderMarkAtAttrs[N Number](value N, attrs templ.Attributes) templ.Component
- func SliderRange[N Number](opts SliderRangeOpts[N]) templ.Component
- func SliderRangeAttrs[N Number](opts SliderRangeOpts[N], attrs templ.Attributes) templ.Component
- func SliderThumb() templ.Component
- func Sortable(opts SortableOpts) templ.Component
- func SortableAttrs(opts SortableOpts, attrs templ.Attributes) templ.Component
- func SortableHandle() templ.Component
- func SortableHandleAttrs(attrs templ.Attributes) templ.Component
- func SortableItem(id string) templ.Component
- func SortableItemAttrs(id string, attrs templ.Attributes) templ.Component
- func SortableNoDrag() templ.Attributes
- func SortablePlaceholder() templ.Component
- func Spinner() templ.Component
- func SpinnerAttrs(attrs templ.Attributes) templ.Component
- func SpinnerProgress[N Number](opts SpinnerOpts[N]) templ.Component
- func SpinnerProgressAttrs[N Number](opts SpinnerOpts[N], attrs templ.Attributes) templ.Component
- func SubMenu(opts SubMenuOpts) templ.Component
- func SubMenuAttrs(opts SubMenuOpts, attrs templ.Attributes) templ.Component
- func Switch(opts SwitchOpts) templ.Component
- func SwitchAttrs(opts SwitchOpts, attrs templ.Attributes) templ.Component
- func Tab(value, active string) templ.Component
- func TabList(ariaLabel string) templ.Component
- func TabPanel(value, active string) templ.Component
- func Tabs(opts TabsOpts) templ.Component
- func TabsAttrs(opts TabsOpts, attrs templ.Attributes) templ.Component
- func TextInput(opts TextInputOpts) templ.Component
- func TextInputAttrs(opts TextInputOpts, attrs templ.Attributes) templ.Component
- func Textarea(opts TextareaOpts) templ.Component
- func TextareaAttrs(opts TextareaOpts, attrs templ.Attributes) templ.Component
- func Toast(opts ToastOpts) templ.Component
- func ToastAttrs(opts ToastOpts, attrs templ.Attributes) templ.Component
- func Toaster(opts ToasterOpts) templ.Component
- func ToasterAttrs(opts ToasterOpts, attrs templ.Attributes) templ.Component
- func Toggle(opts ToggleOpts) templ.Component
- func ToggleAttrs(opts ToggleOpts, attrs templ.Attributes) templ.Component
- func ToggleGroup(opts ToggleGroupOpts) templ.Component
- func ToggleGroupAttrs(opts ToggleGroupOpts, attrs templ.Attributes) templ.Component
- func ToggleOff() templ.Component
- func ToggleOffAttrs(attrs templ.Attributes) templ.Component
- func ToggleOn() templ.Component
- func ToggleOnAttrs(attrs templ.Attributes) templ.Component
- func Tooltip(opts TooltipOpts) templ.Component
- func TooltipAttrs(opts TooltipOpts, attrs templ.Attributes) templ.Component
- func TooltipContent() templ.Attributes
- func Tree() templ.Component
- func TreeActions() templ.Component
- func TreeActionsAttrs(attrs templ.Attributes) templ.Component
- func TreeAttrs(attrs templ.Attributes) templ.Component
- func TreeItem(expanded bool) templ.Component
- func TreeItemAttrs(expanded bool, attrs templ.Attributes) templ.Component
- func TreeLabel() templ.Component
- func TreeLabelAttrs(attrs templ.Attributes) templ.Component
- func TreeText() templ.Component
- func TreeTextAttrs(attrs templ.Attributes) templ.Component
- type AlertOpts
- type AlertVariant
- type AlignContent
- type AlignItems
- type AlignSelf
- type Attr
- type AuraOpts
- type AutohideOpts
- type AutohideSide
- type AvatarOpts
- type AvatarsOpts
- type Axis
- type BadgeOpts
- type BadgeVariant
- type BoundaryOpts
- type BoundaryScopes
- type BreadcrumbItem
- type BreadcrumbOpts
- type ButtonGroupOpts
- type ButtonOpts
- type ButtonVariant
- type CSSUnit
- type CardOpts
- type CardVariant
- type CarouselAlign
- type CarouselOpts
- type CheckboxOpts
- type ClipcopyOpts
- type Collapse
- type ColorFieldOpts
- type ComboboxOpts
- type ContextMenuOpts
- type DatalistOpts
- type DialogOpts
- type Dismissible
- type DrawerOpts
- type ElasticOpts
- type FlexBasis
- type FlexDirection
- type FlexWrap
- type Gap
- type IfNetworkOpts
- type IfPlatformOpts
- type ItemOpts
- type ItemSize
- type JustifyContent
- type KbdOpts
- type KeysOpts
- type LayoutOpts
- type LightboxOpts
- type LightboxTransition
- type LinkOpts
- type LinkVariant
- type MenuItemOpts
- type MenuMode
- type MenuOpts
- type MinHeight
- type NavGroupOpts
- type Number
- type OptGroupOpts
- type OptionOpts
- type Orientation
- type Overflow
- type PaginationOpts
- type PersistOpts
- type Placement
- type Platform
- type PopoverFollowScroll
- type PopoverOpts
- type PopoverTriggerAction
- type ProgressMark
- type ProgressOpts
- type RadioGroupOpts
- type RadioOpts
- type RatingOpts
- type ResizableHandles
- type ResizableOpts
- type RevealableOpts
- type RevealableVariant
- type SelectOpts
- type Side
- type SidebarOpts
- type SkeletonOpts
- type SkeletonVariant
- type SliderMark
- type SliderOpts
- type SliderRangeOpts
- type SortableOpts
- type SpinnerOpts
- type SubMenuOpts
- type SwitchOpts
- type TabsOpts
- type TextInputCase
- type TextInputFormat
- type TextInputInputmode
- type TextInputOpts
- type TextInputType
- type TextareaOpts
- type ToastOpts
- type ToastVariant
- type ToasterOpts
- type ToasterPosition
- type ToggleGroupOpts
- type ToggleOpts
- type ToggleVariant
- type TooltipOpts
- type TypeaheadMatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alert ¶
Alert renders <neo-alert>, a CSS-only message surface for status, warning, and error callouts. Compose its parts with the child components AlertIcon, AlertContent, AlertTitle, AlertDescription, and AlertActions. Set role via AlertAttrs to control how assertively the message is announced (e.g. "status" or "alert").
func AlertActions ¶
AlertActions renders the optional action row below the description, typically holding Button controls. Use only as a child of AlertContent.
func AlertActionsAttrs ¶
func AlertActionsAttrs(attrs templ.Attributes) templ.Component
AlertActionsAttrs is AlertActions with an extra attribute set.
func AlertAttrs ¶
func AlertAttrs(opts AlertOpts, attrs templ.Attributes) templ.Component
AlertAttrs is Alert with an extra attribute set (typically `role`).
func AlertContent ¶
AlertContent renders the content column holding the title, description, and actions. Use only as a direct child of Alert or AlertAttrs, alongside an optional AlertIcon.
func AlertContentAttrs ¶
func AlertContentAttrs(attrs templ.Attributes) templ.Component
AlertContentAttrs is AlertContent with an extra attribute set.
func AlertDescription ¶
AlertDescription renders the supporting message text below the title. Muted colour, no default margin. Use only as a child of AlertContent.
func AlertDescriptionAttrs ¶
func AlertDescriptionAttrs(attrs templ.Attributes) templ.Component
AlertDescriptionAttrs is AlertDescription with an extra attribute set.
func AlertIcon ¶
AlertIcon renders the optional leading icon column. Use only as a direct child of Alert or AlertAttrs. The icon is decorative (aria-hidden). The alert's meaning must come from its title and description text, not the glyph. Wrap an Icon as the child.
func AlertIconAttrs ¶
func AlertIconAttrs(attrs templ.Attributes) templ.Component
AlertIconAttrs is AlertIcon with an extra attribute set. The icon stays decorative; do not pass aria-hidden.
func AlertTitle ¶
AlertTitle renders the alert title as a heading. level selects the heading element (1-6); pick the level that fits the alert's place in the page outline (values outside 1-6 fall back to <h2>). Use only as a child of AlertContent.
func AlertTitleAttrs ¶
func AlertTitleAttrs(level int, attrs templ.Attributes) templ.Component
AlertTitleAttrs is AlertTitle with an extra attribute set.
func AsyncPlaceholder ¶
func AsyncPlaceholder() templ.Attributes
AsyncPlaceholder marks the loading-state region of an async component (Select, Combobox, Popover, Drawer, Sidebar). The host shows it while a load is in flight and restores it before a retry. Spread onto the element so the author keeps its tag (div, neo-layout, template).
func Aura ¶ added in v0.2.0
Aura renders <neo-aura>, a decorative light that circles the element it wraps, with a glow behind it. Wrap one element with an opaque background. CSS sets the look, with --neo-aura-gradient for the light and --neo-aura-spin-duration and --neo-aura-pulse-duration for the motion. The ring follows the wrapped element's measured corner radius; --neo-aura-radius overrides it.
func AuraAttrs ¶ added in v0.2.0
func AuraAttrs(opts AuraOpts, attrs templ.Attributes) templ.Component
AuraAttrs is Aura with an extra attribute set.
func Autohide ¶ added in v0.4.0
func Autohide(opts AutohideOpts) templ.Component
Autohide renders <neo-autohide>, a sticky bar that hides on scroll down and slides back on scroll up. Keyboard focus or an element with an open attribute inside keeps it on screen. Style the child, not the element, which stays in place while the bar slides.
func AutohideAttrs ¶ added in v0.4.0
func AutohideAttrs(opts AutohideOpts, attrs templ.Attributes) templ.Component
AutohideAttrs is Autohide with an extra attribute set.
func Avatar ¶
func Avatar(opts AvatarOpts) templ.Component
Avatar renders <neo-avatar>, a style-only avatar frame. Pass Src/Alt for the common image case, or omit Src and provide fallback children.
func AvatarAttrs ¶
func AvatarAttrs(opts AvatarOpts, attrs templ.Attributes) templ.Component
AvatarAttrs is Avatar with an extra attribute set.
func Avatars ¶
func Avatars(opts AvatarsOpts) templ.Component
Avatars renders <neo-avatars>, an overlapping row of avatar images. Children stay in light DOM so server patches can replace, append, or remove avatars directly; the host only toggles visibility and maintains the +N overflow circle. Add a direct <template data-neo-avatars-overflow> child to replace the generated overflow circle with custom content such as a popover trigger; descendants marked data-neo-avatars-overflow-count receive the current hidden count.
func AvatarsAttrs ¶
func AvatarsAttrs(opts AvatarsOpts, attrs templ.Attributes) templ.Component
AvatarsAttrs is Avatars with an extra attribute set.
func AvatarsOverflow ¶
AvatarsOverflow declares custom content for the +N overflow circle. The host clones this <template data-neo-avatars-overflow> in place of the generated circle (e.g. a popover trigger). Mark a descendant with AvatarsOverflowCount to show the hidden count. Place it as a direct child of Avatars.
func AvatarsOverflowCount ¶
AvatarsOverflowCount renders the [data-neo-avatars-overflow-count] placeholder the host fills with the current hidden count. Use inside AvatarsOverflow.
func Badge ¶
Badge renders <neo-badge>, a small inline label / chip for status, counts, tags, and category markers. No JS; visuals from morpheus.css.
func BadgeAttrs ¶
func BadgeAttrs(opts BadgeOpts, attrs templ.Attributes) templ.Component
BadgeAttrs is Badge with an extra attribute set.
func Boundary ¶
func Boundary(opts BoundaryOpts) templ.Component
Boundary renders <neo-boundary>, a region that overlays inside it (popover, select, menu, ...) treat as their local document and viewport for dismiss, positioning, scroll-follow, and stacking. Children stay in light DOM. Scope which concerns the boundary owns via BoundaryOpts.Scopes.
func BoundaryAttrs ¶
func BoundaryAttrs(opts BoundaryOpts, attrs templ.Attributes) templ.Component
BoundaryAttrs is Boundary with an extra attribute set.
func Breadcrumb ¶
func Breadcrumb(items []BreadcrumbItem) templ.Component
Breadcrumb renders <neo-breadcrumb> with items and chevron separators interleaved as authored slot content. At wide widths every child stays visible; at narrower widths the host folds middle items into an overflow popover. First paint matches the upgraded wide-mode rendering so there's no hydration flash.
func BreadcrumbAttrs ¶
func BreadcrumbAttrs(items []BreadcrumbItem, attrs templ.Attributes) templ.Component
BreadcrumbAttrs is Breadcrumb with an extra attribute set.
func BreadcrumbSep ¶
BreadcrumbSep renders a separator between manually-authored <neo-breadcrumb> children. BreadcrumbWith inserts a chevron on its own; use this only when hand-authoring children with a different separator. aria-hidden is set so assistive tech skips it.
func BreadcrumbSepAttrs ¶
func BreadcrumbSepAttrs(attrs templ.Attributes) templ.Component
BreadcrumbSepAttrs is BreadcrumbSep with an extra attribute set.
func BreadcrumbWith ¶
func BreadcrumbWith( items []BreadcrumbItem, opts BreadcrumbOpts, attrs templ.Attributes, ) templ.Component
BreadcrumbWith is Breadcrumb with BreadcrumbOpts and an extra attribute set.
func Button ¶
func Button(opts ButtonOpts) templ.Component
Button prerenders <neo-button> with role/tabindex matching the upgraded state, which lets the host paint once with no flicker.
func ButtonAttrs ¶
func ButtonAttrs(opts ButtonOpts, attrs templ.Attributes) templ.Component
ButtonAttrs is Button with an extra attribute set.
func ButtonGroup ¶
func ButtonGroup(opts ButtonGroupOpts) templ.Component
ButtonGroup renders <neo-buttongroup>. In segmented mode (Value non-empty), set the matching child via `<neo-button value="...">`.
func ButtonGroupAttrs ¶
func ButtonGroupAttrs(opts ButtonGroupOpts, attrs templ.Attributes) templ.Component
ButtonGroupAttrs is ButtonGroup with an extra attribute set.
func Card ¶
Card renders <neo-card>, a surface container with optional data-neo-card-{media,header,title,description,actions,body,footer} slots. No JS; visuals live in morpheus.css. Authors who want a different layout can ignore the slots and style their own children; the slots are just consistent spacing/typography presets.
func CardActions ¶
func CardActionsAttrs ¶
func CardActionsAttrs(attrs templ.Attributes) templ.Component
CardActionsAttrs is CardActions with an extra attribute set.
func CardAttrs ¶
func CardAttrs(opts CardOpts, attrs templ.Attributes) templ.Component
CardAttrs is Card with an extra attribute set.
func CardBodyAttrs ¶
func CardBodyAttrs(attrs templ.Attributes) templ.Component
CardBodyAttrs is CardBody with an extra attribute set.
func CardDescription ¶
func CardDescriptionAttrs ¶
func CardDescriptionAttrs(attrs templ.Attributes) templ.Component
CardDescriptionAttrs is CardDescription with an extra attribute set.
func CardFooter ¶
func CardFooterAttrs ¶
func CardFooterAttrs(attrs templ.Attributes) templ.Component
CardFooterAttrs is CardFooter with an extra attribute set.
func CardHeader ¶
func CardHeaderAttrs ¶
func CardHeaderAttrs(attrs templ.Attributes) templ.Component
CardHeaderAttrs is CardHeader with an extra attribute set.
func CardMedia ¶
CardMedia and the other card content slots (CardHeader, CardTitle, CardDescription, CardActions, CardBody, CardFooter) each render one data-neo-card-* element (the title is an <h3>, the description a <p>, the rest <div>s) carrying the kit's spacing/typography presets. Place them as children of Card, which supplies the data-neo-card-inner frame; don't add one.
func CardMediaAttrs ¶
func CardMediaAttrs(attrs templ.Attributes) templ.Component
CardMediaAttrs is CardMedia with an extra attribute set.
func CardTitleAttrs ¶
func CardTitleAttrs(attrs templ.Attributes) templ.Component
CardTitleAttrs is CardTitle with an extra attribute set.
func Carousel ¶
func Carousel(opts CarouselOpts) templ.Component
Carousel renders <neo-carousel>. Children compose the track, slides, and any nav / dots.
func CarouselAttrs ¶
func CarouselAttrs(opts CarouselOpts, attrs templ.Attributes) templ.Component
CarouselAttrs is Carousel with an extra attribute set.
func CarouselDotTemplate ¶
CarouselDotTemplate emits a <template data-neo-carousel-dot> child of <neo-carousel>. The host's shadow root clones the template's content into each dot button for custom inner markup; absent leaves the buttons empty (default CSS-styled circle).
func CarouselNext ¶
func CarouselNext() templ.Attributes
func CarouselPause ¶
func CarouselPause() templ.Attributes
CarouselPause marks a control that toggles autoplay; the host flips the host `paused` attribute on click. Only meaningful with AutoPlay.
func CarouselPrev ¶
func CarouselPrev() templ.Attributes
CarouselPrev / CarouselNext mark author-supplied previous / next controls. Spread onto a button; the host wires the click and the disabled state at the track ends.
func CarouselSlide ¶
CarouselSlide emits one <neo-carousel-slide>. Pair `value` with the parent carousel's Value to pick the initial slide.
func CarouselSlideAttrs ¶
func CarouselSlideAttrs(value string, attrs templ.Attributes) templ.Component
CarouselSlideAttrs is CarouselSlide with an extra attribute set.
func CarouselTrack ¶
CarouselTrack wraps the scrollable rail. Slides go inside.
func CarouselTrackAttrs ¶
func CarouselTrackAttrs(attrs templ.Attributes) templ.Component
CarouselTrackAttrs is CarouselTrack with an extra attribute set.
func CarouselWhenPaused ¶
func CarouselWhenPausedAttrs ¶
func CarouselWhenPausedAttrs(attrs templ.Attributes) templ.Component
CarouselWhenPausedAttrs is CarouselWhenPaused with an extra attribute set.
func CarouselWhenPlaying ¶
CarouselWhenPlaying / CarouselWhenPaused mark the 2 label faces inside a CarouselPause control; the host shows the one matching autoplay state.
func CarouselWhenPlayingAttrs ¶
func CarouselWhenPlayingAttrs(attrs templ.Attributes) templ.Component
CarouselWhenPlayingAttrs is CarouselWhenPlaying with an extra attribute set.
func Checkbox ¶
func Checkbox(opts CheckboxOpts) templ.Component
Checkbox prerenders <neo-checkbox> with role/aria-checked/tabindex matching the upgraded state, which lets the host paint once with no flicker.
func CheckboxAttrs ¶
func CheckboxAttrs(opts CheckboxOpts, attrs templ.Attributes) templ.Component
CheckboxAttrs is Checkbox with an extra attribute set.
func Clipcopy ¶
func Clipcopy(opts ClipcopyOpts) templ.Component
Clipcopy wraps a clickable trigger so a click copies a value and the host carries a `copied` attribute for visual feedback. The first child is the trigger; nest `[data-neo-clipcopy-idle]` / `[data-neo-clipcopy-copied]` spans inside it for state-flipped labels.
func ClipcopyAttrs ¶
func ClipcopyAttrs(opts ClipcopyOpts, attrs templ.Attributes) templ.Component
ClipcopyAttrs is Clipcopy with an extra attribute set.
func ClipcopyCopied ¶
func ClipcopyCopiedAttrs ¶
func ClipcopyCopiedAttrs(attrs templ.Attributes) templ.Component
ClipcopyCopiedAttrs is ClipcopyCopied with an extra attribute set.
func ClipcopyIdle ¶
ClipcopyIdle / ClipcopyCopied mark the 2 state faces nested inside the trigger. The host swaps them when the `copied` attribute flips. Place both inside the trigger element passed to Clipcopy.
func ClipcopyIdleAttrs ¶
func ClipcopyIdleAttrs(attrs templ.Attributes) templ.Component
ClipcopyIdleAttrs is ClipcopyIdle with an extra attribute set.
func ColorField ¶
func ColorField[N Number](opts ColorFieldOpts[N]) templ.Component
ColorField renders <neo-color-field>, a 2D saturation/value picker.
func ColorFieldAttrs ¶
func ColorFieldAttrs[N Number](opts ColorFieldOpts[N], attrs templ.Attributes) templ.Component
ColorFieldAttrs is ColorField with an extra attribute set.
func Combobox ¶
func Combobox(opts ComboboxOpts) templ.Component
Combobox renders <neo-combobox>. Children provide the option data as Option / OptGroup (shared with Select), optionally wrapped in a Datalist; a [data-neo-async-placeholder] child marks async loading. This wrapper never injects a container. To address the options from a server-driven patch, wrap them in a Datalist with id="<host-id>-options" yourself. The browser component owns the trigger/search/listbox in shadow DOM. Patches target the light option data, never the live scroll container.
func ComboboxAttrs ¶
func ComboboxAttrs(opts ComboboxOpts, attrs templ.Attributes) templ.Component
ComboboxAttrs is Combobox with an extra attribute set.
func ComboboxEmpty ¶
ComboboxEmpty marks its children as the empty-state trigger face, which is cloned into the trigger when nothing is selected and never shown as a listbox row. Place it as a child of Combobox.
@neo.Combobox(neo.ComboboxOpts{Clearable: neo.Set(true)}) {
@neo.ComboboxEmpty() {
<span class="muted">Unassigned</span>
}
@neo.Option(neo.OptionOpts{Value: neo.Set("a")}) { ... }
}
func ComboboxEmptyAttrs ¶
func ComboboxEmptyAttrs(attrs templ.Attributes) templ.Component
ComboboxEmptyAttrs is ComboboxEmpty with an extra attribute set.
func ContextMenu ¶
func ContextMenu(opts ContextMenuOpts) templ.Component
ContextMenu renders <neo-contextmenu>. Children must be one direct [data-neo-contextmenu-trigger] target and exactly one <neo-menu> (its Menu wrapper) holding the rows. It opens that menu at the pointer; all menu behavior is the nested Menu's.
func ContextMenuAttrs ¶
func ContextMenuAttrs(opts ContextMenuOpts, attrs templ.Attributes) templ.Component
ContextMenuAttrs is ContextMenu with an extra attribute set.
func ContextMenuTrigger ¶
ContextMenuTrigger renders the [data-neo-contextmenu-trigger] child a ContextMenu opens its menu from. Emits a <div>. The trigger can be any element; for an inline or <button> trigger, mark your own element with data-neo-contextmenu-trigger instead. Place it as a child of ContextMenu alongside the <neo-menu>.
func ContextMenuTriggerAttrs ¶
func ContextMenuTriggerAttrs(attrs templ.Attributes) templ.Component
ContextMenuTriggerAttrs is ContextMenuTrigger with an extra attribute set.
func Datalist ¶
func Datalist(opts DatalistOpts) templ.Component
Datalist renders <neo-datalist> with Option / OptGroup children. It is not a rendered or interactive component, only an option-data source, modeled on native <datalist>. Use it inline inside a control, or stand-alone with an ID and point controls at it via their List field. An inline datalist takes precedence over any external datalist a control references.
func DatalistAttrs ¶
func DatalistAttrs(opts DatalistOpts, attrs templ.Attributes) templ.Component
DatalistAttrs is Datalist with an extra attribute set.
func Dialog ¶
func Dialog(opts DialogOpts) templ.Component
Dialog renders <neo-dialog>, a modal dialog wrapping a native <dialog>. The host owns trigger/close wiring and ARIA; the browser owns modal lifecycle (top-layer, focus trap, scroll lock, Esc). Children must include a `[data-neo-dialog-trigger]` and a `<dialog>` element. Any `[data-neo-dialog-close]` descendant closes on click; standard layout slots are `[data-neo-dialog-header]`, `-title`, `-description`, `-body`, `-footer`.
func DialogAttrs ¶
func DialogAttrs(opts DialogOpts, attrs templ.Attributes) templ.Component
DialogAttrs is Dialog with an extra attribute set.
func DialogBody ¶
func DialogBodyAttrs ¶
func DialogBodyAttrs(attrs templ.Attributes) templ.Component
DialogBodyAttrs is DialogBody with an extra attribute set.
func DialogClose ¶
func DialogClose() templ.Attributes
DialogClose marks any descendant inside the dialog as a close control; clicking it dismisses the dialog.
func DialogDescription ¶
func DialogDescriptionAttrs ¶
func DialogDescriptionAttrs(attrs templ.Attributes) templ.Component
DialogDescriptionAttrs is DialogDescription with an extra attribute set.
func DialogFooter ¶
func DialogFooterAttrs ¶
func DialogFooterAttrs(attrs templ.Attributes) templ.Component
DialogFooterAttrs is DialogFooter with an extra attribute set.
func DialogHeader ¶
DialogHeader and the other dialog layout slots (DialogTitle, DialogDescription, DialogBody, DialogFooter) each render one data-neo-dialog-* element with the kit's spacing/typography presets. Place them inside the dialog's <dialog> element.
func DialogHeaderAttrs ¶
func DialogHeaderAttrs(attrs templ.Attributes) templ.Component
DialogHeaderAttrs is DialogHeader with an extra attribute set.
func DialogTitle ¶
func DialogTitleAttrs ¶
func DialogTitleAttrs(attrs templ.Attributes) templ.Component
DialogTitleAttrs is DialogTitle with an extra attribute set.
func DialogTrigger ¶
func DialogTrigger() templ.Attributes
DialogTrigger marks the element that opens the dialog on click. Spread onto any focusable element (the host wires aria-haspopup / aria-controls).
func Drawer ¶
func Drawer(opts DrawerOpts) templ.Component
Drawer renders <neo-drawer>, a modal side-sheet wrapping a native <dialog>. The host owns trigger/close wiring and ARIA; the browser owns modal lifecycle (top-layer, focus trap, scroll lock, Esc). Children must include a single `<dialog>` and may include any number of `[data-neo-drawer-trigger]` / `[data-neo-drawer-close]` descendants.
func DrawerAttrs ¶
func DrawerAttrs(opts DrawerOpts, attrs templ.Attributes) templ.Component
DrawerAttrs is Drawer with an extra attribute set.
func DrawerBody ¶
func DrawerBodyAttrs ¶
func DrawerBodyAttrs(attrs templ.Attributes) templ.Component
DrawerBodyAttrs is DrawerBody with an extra attribute set.
func DrawerClose ¶
func DrawerClose() templ.Attributes
DrawerClose marks any descendant inside the drawer as a close control; clicking it dismisses the drawer.
func DrawerDescription ¶
func DrawerDescriptionAttrs ¶
func DrawerDescriptionAttrs(attrs templ.Attributes) templ.Component
DrawerDescriptionAttrs is DrawerDescription with an extra attribute set.
func DrawerFooter ¶
func DrawerFooterAttrs ¶
func DrawerFooterAttrs(attrs templ.Attributes) templ.Component
DrawerFooterAttrs is DrawerFooter with an extra attribute set.
func DrawerHeader ¶
DrawerHeader and the other drawer layout slots (DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter) each render one data-neo-drawer-* element with the kit's spacing/typography presets. Place them inside the drawer's <dialog> element.
func DrawerHeaderAttrs ¶
func DrawerHeaderAttrs(attrs templ.Attributes) templ.Component
DrawerHeaderAttrs is DrawerHeader with an extra attribute set.
func DrawerTitle ¶
func DrawerTitleAttrs ¶
func DrawerTitleAttrs(attrs templ.Attributes) templ.Component
DrawerTitleAttrs is DrawerTitle with an extra attribute set.
func DrawerTrigger ¶
func DrawerTrigger() templ.Attributes
DrawerTrigger marks the element that opens the drawer on click. Spread onto any focusable element (the host wires aria-haspopup / aria-controls).
func Elastic ¶
func Elastic(opts ElasticOpts) templ.Component
Elastic renders <neo-elastic>, a block container that smoothly animates its height when the inner content's natural size changes. On hydration the children are wrapped in [data-neo-elastic-content].
func ElasticAttrs ¶
func ElasticAttrs(opts ElasticOpts, attrs templ.Attributes) templ.Component
ElasticAttrs is Elastic with an extra attribute set.
func EmptyQuery ¶
EmptyQuery is the span the host fills with the current search text. Place it inside EmptyResults; it takes no children of its own.
func EmptyQueryAttrs ¶
func EmptyQueryAttrs(attrs templ.Attributes) templ.Component
EmptyQueryAttrs is EmptyQuery with an extra attribute set.
func EmptyResults ¶
EmptyResults marks the no-matches region of an option list (Select, Combobox, suggest TextInput). The host shows it when the search yields nothing. Nest an EmptyQuery to echo the current query.
func EmptyResultsAttrs ¶
func EmptyResultsAttrs(attrs templ.Attributes) templ.Component
EmptyResultsAttrs is EmptyResults with an extra attribute set.
func Icon ¶
Icon renders <neo-icon name="..."> with the SVG body inlined from the configured icon FS, eliminating the upgrade-time fetch flash on first paint. The custom element still upgrades and re-fetches when the theme changes.
`data-neo-icon-base` carries the URL prefix the inlined SVG came from. The JS upgrade only adopts the inlined markup when it matches the prefix it'd resolve from --neo-icon-base. A user on a theme with its own icon set then re-fetches the right icons instead of keeping the default-theme SVG the server pre-rendered.
func IconAttrs ¶
func IconAttrs(name string, attrs templ.Attributes) templ.Component
IconAttrs is Icon with an extra attribute set.
func IconBase ¶
func IconBase() string
IconBase returns the URL prefix tagged onto the host so the client upgrade can verify the inlined SVG matches the runtime base.
func IconWith ¶
IconWith renders <neo-icon> with a per-instance `base` override (this element only, vs. the global SetIconBase). The SVG is still server-inlined for first paint; the upgrade re-fetches from `base` when it differs from data-neo-icon-base.
func IfNetwork ¶ added in v0.2.0
func IfNetwork(opts IfNetworkOpts) templ.Component
IfNetwork shows its children only in the connection state opts.Online names.
func IfNetworkAttrs ¶ added in v0.2.0
func IfNetworkAttrs(opts IfNetworkOpts, attrs templ.Attributes) templ.Component
IfNetworkAttrs is IfNetwork with an extra attribute set.
func IfPlatform ¶ added in v0.2.0
func IfPlatform(opts IfPlatformOpts) templ.Component
IfPlatform shows its children only on the platforms opts selects.
func IfPlatformAttrs ¶ added in v0.2.0
func IfPlatformAttrs(opts IfPlatformOpts, attrs templ.Attributes) templ.Component
IfPlatformAttrs is IfPlatform with an extra attribute set.
func InputGroup ¶
InputGroup renders <neo-input-group>, the layout wrapper that flushes leading/trailing addons against an inner input under a shared border. DOM order decides placement. Anything before the inner input renders on the left, anything after on the right.
Direct children are recognized automatically:
span / neo-kbd / neo-kbd-group : static text or shortcut hint neo-icon : leading/trailing icon direct button / neo-button / neo-toggle : automatic clickable control
The inner field is either a plain `<input>` or a `<neo-textinput>`.
func InputGroupAttrs ¶
func InputGroupAttrs(attrs templ.Attributes) templ.Component
InputGroupAttrs is InputGroup with an extra attribute set.
func Item ¶
func Item(opts ItemOpts) templ.Attributes
Item builds the neo-* child-layout attributes for a flex child. Spread the result onto the element inside a Layout:
<aside style="flex-basis: var(--neo-size-sidebar)" { neo.Item(neo.ItemOpts{NoShrink: neo.Set(true)})... }>
<main { neo.Item(neo.ItemOpts{Grow: neo.Set(true), MinWidth0: neo.Set(true)})... }>
func Kbd ¶
Kbd renders <neo-kbd>, an inline indicator for one keyboard key. Children are the key glyph or text. Compose multiple keys via KbdGroup.
func KbdAttrs ¶
func KbdAttrs(opts KbdOpts, attrs templ.Attributes) templ.Component
KbdAttrs is Kbd with an extra attribute set.
func KbdGroupAttrs ¶
func KbdGroupAttrs(attrs templ.Attributes) templ.Component
KbdGroupAttrs is KbdGroup with an extra attribute set.
func KeysAttrs ¶
func KeysAttrs(opts KeysOpts, attrs templ.Attributes) templ.Component
KeysAttrs is Keys with an extra attribute set (e.g. data-on:* event handlers, data-attr:disabled). Caller attrs override on collision.
func Layout ¶
func Layout(opts LayoutOpts) templ.Component
Layout renders <neo-layout>, the CSS-only Flexbox layout primitive. Every option maps to the flex container property of the same name, which makes the markup read like the CSS it produces. Defaults to a row, like display:flex; set Direction: Column for a vertical stack. Use Item for per-child flex behaviour.
func LayoutAttrs ¶
func LayoutAttrs(opts LayoutOpts, attrs templ.Attributes) templ.Component
LayoutAttrs is Layout with an extra attribute set.
func Lightbox ¶
func Lightbox(opts LightboxOpts) templ.Component
Lightbox renders <neo-lightbox>. The body must contain one or more trigger children and one content child, marked via the helper splats LightboxTrigger, LightboxContent and LightboxClose:
@neo.Lightbox(neo.LightboxOpts{}) {
<neo-button { neo.LightboxTrigger()... }>Open</neo-button>
<div { neo.LightboxContent()... }>
<img src="/photo.jpg" alt="A photo"/>
<neo-button { neo.LightboxClose()... }>Close</neo-button>
</div>
}
The author owns the element types; the helpers add only the data-attribute the JS uses to wire ARIA + open / close handling.
func LightboxAttrs ¶
func LightboxAttrs(opts LightboxOpts, attrs templ.Attributes) templ.Component
LightboxAttrs is Lightbox with an extra attribute set.
func LightboxClose ¶
func LightboxClose() templ.Attributes
LightboxClose marks any descendant of the content as a close control; clicking it dismisses the overlay.
func LightboxContent ¶
func LightboxContent() templ.Attributes
LightboxContent marks the element projected into the overlay surface. See Lightbox for a complete example.
func LightboxTitle ¶
func LightboxTitle() templ.Attributes
LightboxTitle marks the element that names the dialog; the JS points the surface's aria-labelledby at it.
func LightboxTrigger ¶
func LightboxTrigger() templ.Attributes
LightboxTrigger marks an element as a lightbox trigger. Repeat it on any number of children; all of them open the same overlay. The JS wires aria-haspopup / aria-expanded / aria-controls and the open handler onto each. Use on any focusable element.
func Link ¶
Link renders <a data-neo-link>, the kit's styled anchor. Variant selects the inline-anchor look or one of the <neo-button> styles.
func LinkAttrs ¶
func LinkAttrs(opts LinkOpts, attrs templ.Attributes) templ.Component
LinkAttrs is Link with an extra attribute set.
func Menu ¶
Menu renders <neo-menu>, a triggerless menu panel. Nest it directly inside a <neo-button> (the button becomes the dropdown trigger) or a ContextMenu (opened at the pointer). Its children are the rows (MenuItem / SubMenu / <hr>); it owns all keyboard/submenu behavior.
func MenuAttrs ¶
func MenuAttrs(opts MenuOpts, attrs templ.Attributes) templ.Component
MenuAttrs is Menu with an extra attribute set.
func MenuItem ¶
func MenuItem(opts MenuItemOpts) templ.Component
MenuItem renders <neo-menuitem>, a leaf entry inside a Menu or SubMenu.
func MenuItemAttrs ¶
func MenuItemAttrs(opts MenuItemOpts, attrs templ.Attributes) templ.Component
MenuItemAttrs is MenuItem with an extra attribute set.
func NavGroup ¶
func NavGroup(opts NavGroupOpts) templ.Component
NavGroup renders <neo-navgroup>, the kit's roving-tabindex keyboard navigation host. Mark each focusable child with `data-neo-navgroup-item`.
func NavGroupAttrs ¶
func NavGroupAttrs(opts NavGroupOpts, attrs templ.Attributes) templ.Component
NavGroupAttrs is NavGroup with an extra attribute set.
func NavGroupItem ¶
func NavGroupItem() templ.Attributes
NavGroupItem marks a focusable child as a roving-tabindex stop. Spread onto each navigable element (button, link, li, custom element); the host moves focus across the marked items with arrow keys.
func OptGroup ¶
func OptGroup(opts OptGroupOpts) templ.Component
OptGroup wraps related Option children under a non-focusable section header inside a Select. Use it the same way as Option, but nest options inside its body:
@neo.Select(neo.SelectOpts{...}) {
@neo.OptGroup(neo.OptGroupOpts{Label: neo.Set("Production")}) {
@neo.Option(neo.OptionOpts{Value: neo.Set("prod-eu")}) { EU production }
}
}
func OptGroupAttrs ¶
func OptGroupAttrs(opts OptGroupOpts, attrs templ.Attributes) templ.Component
OptGroupAttrs is OptGroup with an extra attribute set.
func Option ¶
func Option(opts OptionOpts) templ.Component
Option renders <neo-option> for use as a child of Select.
func OptionAttrs ¶
func OptionAttrs(opts OptionOpts, attrs templ.Attributes) templ.Component
OptionAttrs is Option with an extra attribute set.
func OptionTrigger ¶
OptionTrigger marks its children as an option's trigger face, the markup the kit clones into the trigger when this option is selected, distinct from the option's (often richer) listbox row. Hidden in the list. Shared by Select and Combobox. Place it as a child of Option:
@neo.Option(neo.OptionOpts{Value: neo.Set("evelyn")}) {
@neo.OptionTrigger() { <span class="chip">Evelyn</span> }
<div class="person-card">...rich list row...</div>
}
Without it the trigger falls back to the option's `label` (plain text), then the option's own body.
func OptionTriggerAttrs ¶
func OptionTriggerAttrs(attrs templ.Attributes) templ.Component
OptionTriggerAttrs is OptionTrigger with an extra attribute set.
func Pagination ¶
func Pagination(opts PaginationOpts) templ.Component
Pagination renders <neo-pagination>. The component builds its own structure on connect (Prev / boundary / window / boundary / Next) and adapts that structure via ResizeObserver, mirroring <neo-breadcrumb>'s "render full -> measure -> degrade" pattern.
Pass `<template data-neo-pagination-prev>` and/or `<template data-neo-pagination-next>` children to customise the content inside the prev / next buttons (icon, text, custom span). The default content is a single chevron-left / chevron-right icon, rendering both buttons as icon-only at every viewport.
@neo.Pagination(neo.PaginationOpts{Page: neo.Set(5), Pages: neo.Set(25)}) {
<template data-neo-pagination-prev>
@neo.Icon("chevron-left")
<span>Previous</span>
</template>
<template data-neo-pagination-next>
<span>Next</span>
@neo.Icon("chevron-right")
</template>
}
func PaginationAttrs ¶
func PaginationAttrs(opts PaginationOpts, attrs templ.Attributes) templ.Component
PaginationAttrs is Pagination with an extra attribute set.
func Persist ¶
func Persist(opts PersistOpts) templ.Component
Persist wraps `<neo-persist>` around its first child.
func PersistAttrs ¶
func PersistAttrs(opts PersistOpts, attrs templ.Attributes) templ.Component
PersistAttrs is Persist with an extra attribute set.
func PersistFor ¶
func PersistFor(opts PersistOpts) templ.Component
PersistFor is the childless reference-mode form (target by opts.For).
func Popover ¶
func Popover(opts PopoverOpts) templ.Component
Popover renders <neo-popover>. Body must contain one trigger child and one content child, marked via the helper splats PopoverTrigger, PopoverContent and PopoverClose:
@neo.Popover(neo.PopoverOpts{}) {
<neo-button { neo.PopoverTrigger()... }>Open</neo-button>
<div { neo.PopoverContent()... }>
<p>Hello</p>
<neo-button { neo.PopoverClose()... }>Got it</neo-button>
</div>
}
The author owns the element types; the helpers add only the data-attribute the JS uses to wire ARIA + click handling.
func PopoverAsyncRetry ¶
func PopoverAsyncRetry() templ.Attributes
PopoverAsyncRetry marks a button inside async-failure content so a click re-fires the load action. Used by the async-content wrappers (Select, Combobox, Drawer, Sidebar) that render their failed state into the panel.
func PopoverAttrs ¶
func PopoverAttrs(opts PopoverOpts, attrs templ.Attributes) templ.Component
PopoverAttrs is Popover with an extra attribute set.
func PopoverClose ¶
func PopoverClose() templ.Attributes
PopoverClose marks any descendant of PopoverContent as a close control; clicking it dismisses the popover.
func PopoverContent ¶
func PopoverContent() templ.Attributes
PopoverContent marks an element as the popover's panel body. See Popover for a complete example.
func PopoverTrigger ¶
func PopoverTrigger() templ.Attributes
PopoverTrigger marks an element as the popover's trigger. The JS reads [data-neo-popover-trigger] on a direct child to find this element and wires aria-haspopup / aria-expanded / aria-controls + the toggle-on-click handler onto it. Use on any focusable element (button, neo-button, anchor, custom element).
func Progress ¶
func Progress[N Number](opts ProgressOpts[N]) templ.Component
Progress renders <neo-progress> as the bare host, with only attributes plus the progressbar ARIA semantics and any author marks as light children. The JS host builds the painted bar (header, track + fill, marks) into a shadow root on connect, kept out of light DOM so a Datastar fat-morph can't wipe it, letting a plain `value` change ease instead of snapping.
func ProgressAttrs ¶
func ProgressAttrs[N Number](opts ProgressOpts[N], attrs templ.Attributes) templ.Component
ProgressAttrs is Progress with an extra attribute set.
func ProgressMarkAt ¶
ProgressMarkAt declares one rail mark as a light-DOM child of <neo-progress>. The host reads these [data-neo-progress-mark] children on connect and builds the anchor dot plus its label (the children; omit them for a bare dot). value is the numeric position; marks outside [min, max] are skipped. The server-prerendered Progress takes marks via ProgressOpts.Marks instead.
func ProgressMarkAtAttrs ¶
func ProgressMarkAtAttrs[N Number](value N, attrs templ.Attributes) templ.Component
ProgressMarkAtAttrs is ProgressMarkAt with an extra attribute set.
func Radio ¶
Radio renders <neo-radio>, used as a child of RadioGroup. Wrap the radio + label in a <label> so clicking the label activates the radio (same wrapping-label pattern as <neo-checkbox> / <neo-switch>).
func RadioAttrs ¶
func RadioAttrs(opts RadioOpts, attrs templ.Attributes) templ.Component
RadioAttrs is Radio with an extra attribute set.
func RadioGroup ¶
func RadioGroup(opts RadioGroupOpts) templ.Component
RadioGroup renders <neo-radio-group> with `<neo-radio>` children (use Radio). The host owns selection, keyboard nav, and roving-tabindex; each radio is a marker the group reads `value` and `disabled` from.
func RadioGroupAttrs ¶
func RadioGroupAttrs(opts RadioGroupOpts, attrs templ.Attributes) templ.Component
RadioGroupAttrs is RadioGroup with an extra attribute set.
func Rating ¶
func Rating(opts RatingOpts) templ.Component
Rating prerenders <neo-rating> with the same symbol markup and ARIA the JS host would build on connect, which lets the control paint once with no upgrade flicker. The host's reconcile() adopts the prerendered [data-neo-rating-symbols] subtree when its shape matches (symbol count == max, same icon) instead of rebuilding it.
func RatingAttrs ¶
func RatingAttrs(opts RatingOpts, attrs templ.Attributes) templ.Component
RatingAttrs is Rating with an extra attribute set.
func Resizable ¶
func Resizable[N Number](opts ResizableOpts[N]) templ.Component
Resizable prerenders <neo-resizable> with each handle's icon already inlined.
func ResizableAttrs ¶
func ResizableAttrs[N Number](opts ResizableOpts[N], attrs templ.Attributes) templ.Component
ResizableAttrs is Resizable with an extra attribute set.
func ResizableIcon ¶
func ResizableIcon(handle string) templ.Attributes
ResizableIcon marks a custom handle glyph with the handle it belongs to (e.g. "bottom-right"), matching a ResizableOpts.HandleIcons key. Spread onto the glyph element passed through HandleIcons.
func Revealable ¶
func Revealable(opts RevealableOpts) templ.Component
Revealable wraps content in <neo-revealable>, a spoiler that hides its children behind an animated grain veil until activated, then re-conceals after RehideAfter ms and whenever the content is patched. The author children are the secret.
func RevealableAttrs ¶
func RevealableAttrs(opts RevealableOpts, attrs templ.Attributes) templ.Component
RevealableAttrs is Revealable with an extra attribute set.
func Select ¶
func Select(opts SelectOpts) templ.Component
Select renders <neo-select>. Children provide the option data as Option / OptGroup, optionally wrapped in a Datalist; a [data-neo-async-placeholder] child marks async loading. This wrapper never injects a container. To address the options from a server-driven patch, wrap them in a Datalist with id="<host-id>-options" yourself. The browser component owns the trigger/panel/listbox in shadow DOM. Patches target the light option data, never the live scroll container.
func SelectAttrs ¶
func SelectAttrs(opts SelectOpts, attrs templ.Attributes) templ.Component
SelectAttrs is Select with an extra attribute set.
func SelectEmpty ¶
SelectEmpty marks its children as the empty-state trigger face for a Select. It renders a <neo-option value="" data-neo-select-empty> that is cloned into the trigger when nothing is selected and never shown as a listbox row. Mirrors ComboboxEmpty. Place it as a child of Select, typically with Clearable so the user can return to it.
func SelectEmptyAttrs ¶
func SelectEmptyAttrs(attrs templ.Attributes) templ.Component
SelectEmptyAttrs is SelectEmpty with an extra attribute set.
func SetIconBase ¶
func SetIconBase(base string)
SetIconBase tells the client which URL prefix the SSR-inlined SVGs were sourced from. Default is "/static/icons". Apps mounting icons at a different URL update this so the JS-side adoption check (--neo-icon-base) lines up.
func SetIconFS ¶
SetIconFS overrides the filesystem Icon reads SVG bytes from and invalidates the cache. Concurrent renders during the swap see either the old or the new value, never both.
func Sidebar ¶
func Sidebar(opts SidebarOpts) templ.Component
Sidebar renders <neo-sidebar>, a side-anchored panel that auto- switches between in-flow column (wide) and fixed overlay (narrow). Children typically include `[data-neo-sidebar-header]`, `[data-neo-sidebar-content]`, and `[data-neo-sidebar-footer]` slots.
func SidebarAttrs ¶
func SidebarAttrs(opts SidebarOpts, attrs templ.Attributes) templ.Component
SidebarAttrs is Sidebar with an extra attribute set.
func SidebarClose ¶
func SidebarClose() templ.Attributes
SidebarClose marks an element that collapses the sidebar on click (overlay mode). Spread onto any focusable element.
func SidebarContent ¶
func SidebarContent() templ.Attributes
SidebarContent marks the scrollable middle region between header and footer. Spread onto the element so the author keeps the right tag (<nav> for a navigation landmark, <div> otherwise).
func SidebarFooter ¶
func SidebarFooterAttrs ¶
func SidebarFooterAttrs(attrs templ.Attributes) templ.Component
SidebarFooterAttrs is SidebarFooter with an extra attribute set.
func SidebarHeader ¶
SidebarHeader and SidebarFooter render the header / footer slots carrying the kit's spacing presets.
func SidebarHeaderAttrs ¶
func SidebarHeaderAttrs(attrs templ.Attributes) templ.Component
SidebarHeaderAttrs is SidebarHeader with an extra attribute set.
func Skeleton ¶
func Skeleton(opts SkeletonOpts) templ.Component
Skeleton renders <neo-skeleton>, a gently-pulsing loading placeholder. It has no intrinsic size. Set dimensions via inline style or CSS. No JS; visuals from morpheus.css; honours `prefers-reduced-motion`.
func SkeletonAttrs ¶
func SkeletonAttrs(opts SkeletonOpts, attrs templ.Attributes) templ.Component
SkeletonAttrs is Skeleton with an extra attribute set.
func Slider ¶
func Slider[N Number](opts SliderOpts[N]) templ.Component
Slider renders <neo-slider> as the bare host, with attributes plus optional light-DOM children (SliderMarkAt, SliderAnchor, SliderThumb). The JS host builds the painted slider (header, track + fill + thumb, marks) into a shadow root on connect, kept out of light DOM so a Datastar fat-morph can't wipe it, letting a plain `value` change ease instead of snapping.
func SliderAnchor ¶
SliderAnchor declares the glyph template for the rail anchor dots. The host reads this <template data-neo-slider-anchor> light-DOM child on connect and clones its content into every anchor (e.g. an icon). Place it as a child of Slider / SliderRange.
func SliderAttrs ¶
func SliderAttrs[N Number](opts SliderOpts[N], attrs templ.Attributes) templ.Component
SliderAttrs is Slider with an extra attribute set.
func SliderMarkAt ¶
SliderMarkAt declares one rail mark as a light-DOM child of <neo-slider> / <neo-slider-range>. The host reads these [data-neo-slider-mark] children on connect and builds the anchor dot plus its label (the children; omit them for a bare dot). value is the numeric position; marks outside [min, max] are skipped. The attribute-only Slider takes marks via SliderOpts.Marks instead.
func SliderMarkAtAttrs ¶
func SliderMarkAtAttrs[N Number](value N, attrs templ.Attributes) templ.Component
SliderMarkAtAttrs is SliderMarkAt with an extra attribute set.
func SliderRange ¶
func SliderRange[N Number](opts SliderRangeOpts[N]) templ.Component
SliderRange renders <neo-slider-range>. Unlike Slider, this wrapper does not server-prerender markup; the 2-thumb / fill-between layout is built on connect, and there's no JS adopt() path. The kit's `:not(:defined)` placeholder reserves a header + track skeleton so layout doesn't shift on upgrade.
func SliderRangeAttrs ¶
func SliderRangeAttrs[N Number](opts SliderRangeOpts[N], attrs templ.Attributes) templ.Component
SliderRangeAttrs is SliderRange with an extra attribute set.
func SliderThumb ¶
SliderThumb declares the glyph template for the drag thumb. The host reads this <template data-neo-slider-thumb> light-DOM child on connect and clones its content into the thumb. Place it as a child of Slider / SliderRange.
func Sortable ¶
func Sortable(opts SortableOpts) templ.Component
Sortable renders <neo-sortable>. Give each child item a stable `id` so the reorder events' order arrays are meaningful.
func SortableAttrs ¶
func SortableAttrs(opts SortableOpts, attrs templ.Attributes) templ.Component
SortableAttrs is Sortable with an extra attribute set.
func SortableHandle ¶
SortableHandle is the drag grip. Inside a SortableItem it limits dragging to itself, leaving the rest free for buttons, links, and selection.
func SortableHandleAttrs ¶
func SortableHandleAttrs(attrs templ.Attributes) templ.Component
SortableHandleAttrs is SortableHandle with an extra attribute set.
func SortableItem ¶
SortableItem emits one item; id is what the reorder events report. Add a SortableHandle child to restrict the drag grip, else the whole item is draggable.
func SortableItemAttrs ¶
func SortableItemAttrs(id string, attrs templ.Attributes) templ.Component
SortableItemAttrs is SortableItem with an extra attribute set.
func SortableNoDrag ¶
func SortableNoDrag() templ.Attributes
SortableNoDrag marks an interactive descendant (button, link, input) so a pointer-down on it starts no drag, leaving the control usable. Spread onto the element. Only needed when the whole item is draggable (no SortableHandle).
func SortablePlaceholder ¶
SortablePlaceholder customizes the drop-gap indicator (default: a dashed slot outline). Its children render inside the same-size gap, replacing the default markup. It is an inert <template> and never itself a sortable item.
func Spinner ¶
Spinner renders the bare indeterminate <neo-spinner>. The JS host owns the SVG ring in its shadow root.
func SpinnerAttrs ¶
func SpinnerAttrs(attrs templ.Attributes) templ.Component
SpinnerAttrs is Spinner with an extra attribute set.
func SpinnerProgress ¶
func SpinnerProgress[N Number](opts SpinnerOpts[N]) templ.Component
SpinnerProgress renders a determinate circular progress ring (the round counterpart of Progress). No text is drawn on the ring; with opts.Tooltip the value (plus Unit) is shown in a wrapping <neo-tooltip> on hover/focus. With opts.Indeterminate it falls back to the indeterminate spin while keeping any label / ARIA wiring.
func SpinnerProgressAttrs ¶
func SpinnerProgressAttrs[N Number](opts SpinnerOpts[N], attrs templ.Attributes) templ.Component
SpinnerProgressAttrs is SpinnerProgress with an extra attribute set.
func SubMenu ¶
func SubMenu(opts SubMenuOpts) templ.Component
SubMenu renders <neo-submenu>, a nested menu that opens to the side of its parent row.
func SubMenuAttrs ¶
func SubMenuAttrs(opts SubMenuOpts, attrs templ.Attributes) templ.Component
SubMenuAttrs is SubMenu with an extra attribute set.
func Switch ¶
func Switch(opts SwitchOpts) templ.Component
Switch prerenders <neo-switch> with role/aria-checked/tabindex matching the upgraded state, which lets the host paint once with no flicker.
func SwitchAttrs ¶
func SwitchAttrs(opts SwitchOpts, attrs templ.Attributes) templ.Component
SwitchAttrs is Switch with an extra attribute set.
func Tab ¶
Tab emits <neo-tab value="..."> with ARIA + tabindex matching the upgraded state (active tab focusable, inactive aria-selected="false").
func TabList ¶
TabList emits <neo-tablist>, the row of Tab triggers. Place it as the first child of Tabs, before the TabPanel elements. ariaLabel names the tablist (omit for none).
func Tabs ¶
Tabs prerenders <neo-tabs value="..."> in the upgraded state. Inactive panels get `hidden`; the active tab gets aria-selected="true" + tabindex="0". Use with Tab and TabPanel children.
func TabsAttrs ¶
func TabsAttrs(opts TabsOpts, attrs templ.Attributes) templ.Component
TabsAttrs is Tabs with an extra attribute set.
func TextInput ¶
func TextInput(opts TextInputOpts) templ.Component
TextInput renders <neo-textinput>. The native field lives in the component's shadow root. The host carries the options/passthrough attributes and the light DOM stays empty; the field appears on upgrade.
func TextInputAttrs ¶
func TextInputAttrs(opts TextInputOpts, attrs templ.Attributes) templ.Component
TextInputAttrs is TextInput with an extra attribute set. attrs carries native passthrough and arbitrary attributes (style, aria-*, data-* / Datastar bindings) and overrides any colliding typed field.
func Textarea ¶
func Textarea(opts TextareaOpts) templ.Component
Textarea renders <neo-textarea>. The native field lives in the component's shadow root. The host carries the options/passthrough attributes and the light DOM stays empty; the field appears on upgrade.
func TextareaAttrs ¶
func TextareaAttrs(opts TextareaOpts, attrs templ.Attributes) templ.Component
TextareaAttrs is Textarea with an extra attribute set. attrs carries native passthrough and arbitrary attributes (style, aria-*, data-* / Datastar bindings) and overrides any colliding typed field.
func Toast ¶
Toast renders a <neo-toast> child for <neo-toaster>. The markup (variant icon, close button, role/aria-live) lives in the toast's own shadow root; author content goes into named slots ("title", "description", "action"). Example:
@neo.Toast(neo.ToastOpts{Variant: neo.Set(neo.ToastVariantSuccess)}) {
<span slot="title">Saved</span>
<span slot="description">Profile updated.</span>
}
func ToastAttrs ¶
func ToastAttrs(opts ToastOpts, attrs templ.Attributes) templ.Component
ToastAttrs is Toast with an extra attribute set.
func Toaster ¶
func Toaster(opts ToasterOpts) templ.Component
Toaster renders <neo-toaster>, which lays out and animates <neo-toast> children. Authors can drop toasts in declaratively (the host adopts via MutationObserver) or call the imperative API (NeoToast.success / .error / .promise / ...); both flow through the same lifecycle.
func ToasterAttrs ¶
func ToasterAttrs(opts ToasterOpts, attrs templ.Attributes) templ.Component
ToasterAttrs is Toaster with an extra attribute set.
func Toggle ¶
func Toggle(opts ToggleOpts) templ.Component
Toggle prerenders <neo-toggle> with role/aria-pressed/tabindex matching the upgraded state, which lets the host paint once with no flicker.
func ToggleAttrs ¶
func ToggleAttrs(opts ToggleOpts, attrs templ.Attributes) templ.Component
ToggleAttrs is Toggle with an extra attribute set.
func ToggleGroup ¶
func ToggleGroup(opts ToggleGroupOpts) templ.Component
ToggleGroup renders <neo-toggle-group>, a container that coordinates selection across its child Toggle instances.
func ToggleGroupAttrs ¶
func ToggleGroupAttrs(opts ToggleGroupOpts, attrs templ.Attributes) templ.Component
ToggleGroupAttrs is ToggleGroup with an extra attribute set.
func ToggleOff ¶
ToggleOff / ToggleOn mark the 2 state faces. The host shows the matching span for the current pressed state. Place both inside Toggle.
func ToggleOffAttrs ¶
func ToggleOffAttrs(attrs templ.Attributes) templ.Component
ToggleOffAttrs is ToggleOff with an extra attribute set.
func ToggleOnAttrs ¶
func ToggleOnAttrs(attrs templ.Attributes) templ.Component
ToggleOnAttrs is ToggleOn with an extra attribute set.
func Tooltip ¶
func Tooltip(opts TooltipOpts) templ.Component
Tooltip renders <neo-tooltip>, a hover/focus tooltip built on the same positioning primitives as <neo-popover> with tooltip semantics (no focus stealing, no click dismissal, pointer-events: none, role="tooltip", aria-describedby on the trigger). The first non- content child is the trigger.
func TooltipAttrs ¶
func TooltipAttrs(opts TooltipOpts, attrs templ.Attributes) templ.Component
TooltipAttrs is Tooltip with an extra attribute set.
func TooltipContent ¶
func TooltipContent() templ.Attributes
TooltipContent marks the rich-content panel child, used instead of TooltipOpts.Text when the tooltip needs markup. Spread onto the content element so the author keeps its tag.
func Tree ¶
Tree renders <neo-tree>. Author nested <neo-tree-item>s as direct children; the shadow root takes care of chevron and animation markup.
func TreeActions ¶
TreeActions holds row-level controls (buttons, badges) after the text. Place inside TreeLabel.
func TreeActionsAttrs ¶
func TreeActionsAttrs(attrs templ.Attributes) templ.Component
TreeActionsAttrs is TreeActions with an extra attribute set.
func TreeAttrs ¶
func TreeAttrs(attrs templ.Attributes) templ.Component
TreeAttrs is Tree with an extra attribute set.
func TreeItem ¶
TreeItem renders one <neo-tree-item>. Set `expanded` on branches you want open at first paint. Branch state is derived at runtime from the presence of nested <neo-tree-item> children. Callers only pick the `expanded` flag.
func TreeItemAttrs ¶
func TreeItemAttrs(expanded bool, attrs templ.Attributes) templ.Component
TreeItemAttrs is TreeItem with an extra attribute set.
func TreeLabel ¶
TreeLabel renders the row content. The shadow wraps this in a row container with the chevron prepended; authors only supply what goes after the chevron.
func TreeLabelAttrs ¶
func TreeLabelAttrs(attrs templ.Attributes) templ.Component
TreeLabelAttrs is TreeLabel with an extra attribute set.
func TreeText ¶
TreeText is the label's text region; it takes the remaining row width so a trailing TreeActions cluster aligns to the end. Place inside TreeLabel.
func TreeTextAttrs ¶
func TreeTextAttrs(attrs templ.Attributes) templ.Component
TreeTextAttrs is TreeText with an extra attribute set.
Types ¶
type AlertOpts ¶
type AlertOpts struct {
Variant Attr[AlertVariant]
}
type AlertVariant ¶
type AlertVariant string
AlertVariant picks the semantic colour treatment for <neo-alert>. Zero value (AlertVariantNeutral) renders a neutral alert and emits no `variant` attribute.
const ( AlertVariantNeutral AlertVariant = "" AlertVariantInfo AlertVariant = "info" AlertVariantSuccess AlertVariant = "success" AlertVariantWarning AlertVariant = "warning" AlertVariantDanger AlertVariant = "danger" )
type AlignContent ¶
type AlignContent string
AlignContent sets <neo-layout> align-content (distribution of wrapped lines). Takes effect only with Wrap. Zero value emits no attribute.
const ( AlignContentDefault AlignContent = "" AlignContentFlexStart AlignContent = "flex-start" AlignContentFlexEnd AlignContent = "flex-end" AlignContentCenter AlignContent = "center" AlignContentSpaceBetween AlignContent = "space-between" AlignContentSpaceAround AlignContent = "space-around" AlignContentSpaceEvenly AlignContent = "space-evenly" AlignContentStretch AlignContent = "stretch" )
type AlignItems ¶
type AlignItems string
AlignItems sets <neo-layout> align-items (cross-axis alignment). Values are the literal CSS keywords; zero value emits no attribute.
const ( AlignItemsDefault AlignItems = "" AlignItemsFlexStart AlignItems = "flex-start" AlignItemsFlexEnd AlignItems = "flex-end" AlignItemsCenter AlignItems = "center" AlignItemsStretch AlignItems = "stretch" AlignItemsBaseline AlignItems = "baseline" )
type AlignSelf ¶
type AlignSelf string
AlignSelf overrides the parent's cross-axis alignment for one child (neo-align-self). Zero value emits no attribute.
type Attr ¶
type Attr[T any] struct { // contains filtered or unexported fields }
Attr is an optional Templ parameter. The zero value is "not set" and renders no attribute, which keeps an explicit zero/empty/false distinct from unset. Construct a set value with Set.
func Set ¶
Set marks a value present. It renders even when it is the zero value (Set("") renders name="", Set(false) renders name="false").
func (Attr[T]) Attrs ¶
func (a Attr[T]) Attrs(name string) templ.Attributes
Attrs renders the attribute under name when set, else nothing (spread it with { a.Attrs("name")... }). A set bool renders as a bare attribute for true and name="false" for false, matching the boolean command contract; every other type renders name="value".
type AutohideOpts ¶ added in v0.4.0
type AutohideOpts struct {
// Side is the edge the bar sticks to. Unset is top.
Side Attr[AutohideSide]
// Tolerance is the pixels to scroll in 1 direction before the bar hides or shows.
// Unset is 8.
Tolerance Attr[int]
// Disabled stops hiding. The bar stays on screen like a plain sticky bar.
Disabled Attr[bool]
// ShowAtEnd shows the bar when the scroll reaches the end. Unset is true.
ShowAtEnd Attr[bool]
}
type AutohideSide ¶ added in v0.4.0
type AutohideSide string
AutohideSide is the edge a <neo-autohide> bar sticks to.
const ( AutohideSideTop AutohideSide = "top" AutohideSideBottom AutohideSide = "bottom" )
type AvatarsOpts ¶
type AvatarsOpts struct {
// CollapseAt is the maximum number of authored avatars to show before
// the remainder are folded into the +N overflow circle. Zero means no
// authored cap; the host still collapses when horizontal space runs out.
CollapseAt Attr[int]
// OverflowCount adds server-known people that are not present as avatar
// children. The generated +N circle shows hidden children plus this count.
OverflowCount Attr[int]
AriaLabel Attr[string]
}
type Axis ¶
type Axis string
Axis is the 2-value layout choice for components that only flip between horizontal and vertical. Zero value (AxisDefault) defers to the host's own default and emits no `orientation` attribute. Use Orientation instead for components that also lay out as a grid.
type BadgeOpts ¶
type BadgeOpts struct {
Variant Attr[BadgeVariant]
}
type BadgeVariant ¶
type BadgeVariant string
BadgeVariant is the visual style enum for <neo-badge>. Zero value (BadgeVariantNeutral) renders the default neutral chip and emits no `variant` attribute.
const ( BadgeVariantNeutral BadgeVariant = "" BadgeVariantPrimary BadgeVariant = "primary" BadgeVariantSecondary BadgeVariant = "secondary" BadgeVariantDanger BadgeVariant = "danger" BadgeVariantOutline BadgeVariant = "outline" )
type BoundaryOpts ¶
type BoundaryOpts struct {
Scopes Attr[BoundaryScopes]
}
BoundaryOpts is the typed attribute surface for <neo-boundary>.
type BoundaryScopes ¶
BoundaryScopes selects which overlay concerns a <neo-boundary> owns. The zero value keeps the element default (dismiss + positioning) and emits no attribute; any non-zero field emits an explicit scope="..." token list that replaces the default. NoDismiss / NoPositioning drop a default scope; Scroll / Stacking add an opt-in one.
type BreadcrumbItem ¶
BreadcrumbItem describes one entry in a Breadcrumb trail. An empty Href marks the item as the current page (rendered as a non-link with aria-current="page"); typically only the last item.
type BreadcrumbOpts ¶
type BreadcrumbOpts struct {
Placement Attr[Placement]
ScreenOffset Attr[CSSUnit]
// FollowScroll forwards a popover scroll-follow mode to the
// overflow popover.
FollowScroll Attr[PopoverFollowScroll]
ClampPlacement Attr[bool]
MinFitHeight Attr[CSSUnit]
MinFitWidth Attr[CSSUnit]
MinOpenHeight Attr[CSSUnit]
MinOpenWidth Attr[CSSUnit]
}
BreadcrumbOpts forwards the kit's popover-host attributes onto the overflow <neo-popover>. MinFitHeight / MinFitWidth accept any CSS length or the literal "content".
type ButtonGroupOpts ¶
type ButtonGroupOpts struct {
// Value flips the host into segmented-control mode
// (matching child gets aria-checked="true", host gains role="radiogroup");
// empty leaves a plain visual cluster.
Value Attr[string]
// Orientation defaults to horizontal; pass [AxisVertical] for a stacked column.
Orientation Attr[Axis]
// AutoActivate selects on focus rather than requiring
// Space/Enter/click.
AutoActivate Attr[bool]
AriaLabel Attr[string]
}
type ButtonOpts ¶
type ButtonVariant ¶
type ButtonVariant string
ButtonVariant is the visual style enum for <neo-button>. ButtonVariantDefault is the neutral-styling variant and is what an unset (zero-value) Variant maps to.
const ( ButtonVariantDefault ButtonVariant = "default" ButtonVariantPrimary ButtonVariant = "primary" ButtonVariantSecondary ButtonVariant = "secondary" ButtonVariantGhost ButtonVariant = "ghost" ButtonVariantDanger ButtonVariant = "danger" ButtonVariantAnchor ButtonVariant = "anchor" )
type CSSUnit ¶
type CSSUnit = string
CSSUnit is a CSS size value, a number plus a unit such as "1rem", "0px", "2em", "50%", "12ch" or "40vh". Zero value means "unset". A few fields also accept a keyword such as "content"; see the field's own doc.
type CardOpts ¶
type CardOpts struct {
Variant Attr[CardVariant]
// Orientation stacks the card's slots top-to-bottom by default;
// [AxisHorizontal] places the media slot on the left and the remaining
// slots in a column on the right (media must be the first child).
// Card is CSS-only. An unsupported raw-HTML value falls back to the
// vertical default without a runtime warning.
Orientation Attr[Axis]
}
type CardVariant ¶
type CardVariant string
CardVariant picks the surface treatment. Zero value (CardVariantDefault) renders a filled card with a subtle border; CardVariantOutline drops the fill and keeps the border; CardVariantElevated drops the border and adds a soft shadow.
const ( CardVariantDefault CardVariant = "" CardVariantOutline CardVariant = "outline" CardVariantElevated CardVariant = "elevated" )
type CarouselAlign ¶
type CarouselAlign string
CarouselAlign picks the snap alignment of each slide inside the track. Zero value (CarouselAlignStart) lines slides up with the track's leading edge.
const ( CarouselAlignStart CarouselAlign = "" CarouselAlignCenter CarouselAlign = "center" CarouselAlignEnd CarouselAlign = "end" )
type CarouselOpts ¶
type CarouselOpts struct {
// Value is the active slide value. Empty -> first slide.
// Reflected to the host's `value` attribute.
Value Attr[string]
// Orientation is the stacking direction, "horizontal" (default) or "vertical";
// it also sets the scroll and drag axis.
Orientation Attr[Axis]
// Align is the snap alignment of each slide.
Align Attr[CarouselAlign]
// PerView is the slides per view. Zero -> 1 (full-width hero).
// Use a negative value for "auto" (slides keep their intrinsic widths).
PerView Attr[int]
// Spacing is the gap between slides.
// Empty -> kit default (--neo-carousel-spacing).
Spacing Attr[CSSUnit]
// Loop wraps past the ends.
Loop Attr[bool]
// Touch enables native gesture scrolling (default).
// touch="false" makes the track `overflow: hidden; touch-action: none`;
// prev/next and keyboard still work.
Touch Attr[bool]
// AutoPlay starts the autoplay timer at the given millisecond
// interval. Zero leaves autoplay off.
AutoPlay Attr[int]
// AutoPlayStep advances this many slides per autoplay tick when
// PerView is greater than 1. Zero keeps the default 1-slide step.
AutoPlayStep Attr[int]
// Paused is the initial state of the `paused` attribute
// (only meaningful with AutoPlay).
Paused Attr[bool]
// AriaLabel names the carousel landmark.
AriaLabel Attr[string]
// Easing is the programmatic-scroll easing. Bare duration ("600ms")
// pairs with the theme's --neo-easing; full pair ("700ms
// cubic-bezier(...)") is used verbatim. Empty falls back to native
// smooth, or, if the theme sets --neo-easing, that curve at 400ms.
Easing Attr[string]
// AnimatePatch makes external `value` patches animate (with Easing)
// instead of jumping. Off by default. A patch then sets the slide
// instantly, which keeps fat morphs from animating on every state sync.
// The carousel's own nav animates regardless.
AnimatePatch Attr[bool]
// HighlightActive dims non-active slides via --neo-carousel-slide-inactive-opacity.
// Opt-in so author content isn't washed out by default.
HighlightActive Attr[bool]
// Skips clicks on interactive content inside the slide.
ClickNav Attr[bool]
// unaffected (handled natively). Skipped when touch is disabled.
DragNav Attr[bool]
// Dots enables the dot-pagination markup (rendered in the host's
// shadow root). Author positions / styles via `::part(dots)` /
// `::part(dot)` and customizes per-dot inner markup with
// <template data-neo-carousel-dot>.
Dots Attr[bool]
// AutoActivate mirrors neo-tabs. Arrow keys on a focused dot also
// commit the focused slide. Without it, Enter / Space commits.
AutoActivate Attr[bool]
// Step overrides the per-press slide advance for prev / next / arrow.
// Zero -> per-view (page mode); 1 or N picks finer stepping.
Step Attr[int]
}
type CheckboxOpts ¶
type CheckboxOpts struct {
Checked Attr[bool]
// Indeterminate paints a dash and sets aria-checked="mixed";
// it takes precedence over Checked for ARIA, but user input still
// clears the mixed state.
Indeterminate Attr[bool]
Disabled Attr[bool]
// Size is "" (default) or "sm" (compact).
Size Attr[string]
AriaLabel Attr[string]
}
type ClipcopyOpts ¶
type ClipcopyOpts struct {
// Value is the literal string copied on click; takes precedence over For.
Value Attr[string]
// For is the id of an element whose textContent should be copied.
// Useful when the value is already on the page so the copied
// payload tracks the rendered content.
For Attr[string]
// CopiedDuration is in ms; 0 falls back to the kit default
// (1500ms). For sticky copied state until next click, pass
// `copied-duration="0"` via [ClipcopyAttrs] (the struct can't
// represent it without a 3-valued field).
CopiedDuration Attr[int]
}
type Collapse ¶
type Collapse string
Collapse folds a row to a single column below a container-width tier. A Neo extension with no CSS equivalent. Zero value never collapses.
type ColorFieldOpts ¶
type ComboboxOpts ¶
type ComboboxOpts struct {
// Value seeds the initial selection (comma-separated list in
// Multiple mode, single option value otherwise). In Multiple mode an
// option value must not contain a comma; the separator is unescaped.
Value Attr[string]
// Name is the form field name. The control is form-associated and, with
// a Name set, submits its value in a native <form>. Multiple mode submits
// one entry per selected value under the same name, like <select multiple>.
Name Attr[string]
// Disabled makes the control non-interactive. The trigger drops out of
// the tab order and ignores clicks and keys.
Disabled Attr[bool]
// Size is the control-size step ("sm" | "lg"); empty is the default
// size. Shared with the other row controls so they line up.
Size Attr[string]
// List points at a shared <neo-datalist> by id (like native
// <input list>) to source options. An inline datalist or directly
// authored options take precedence.
List Attr[string]
// Placeholder is shown on the trigger when nothing is selected.
// Empty falls back to the host default "Select…".
Placeholder Attr[string]
// SearchPlaceholder is the search input placeholder (default
// "Search…").
SearchPlaceholder Attr[string]
// SearchDebounce coalesces keystrokes for this many ms before
// dispatching `neo-combobox-search` (and running the local filter /
// live-search loading reset); 0 dispatches on every keystroke.
SearchDebounce Attr[int]
// Async mirrors [Select] semantics; without it, a
// [data-neo-async-placeholder] child triggers lazy-by-default
// loading (kit caches options across opens).
Async Attr[bool]
LiveSearch Attr[bool]
// Multiple switches to multi-select mode (toggling, popover stays
// open on activation, comma-joined label list).
Multiple Attr[bool]
// Clearable lets Backspace/Delete on the focused trigger return to
// no selection.
Clearable Attr[bool]
// Caret overrides the trigger's caret icon name (default
// "chevrons-up-down"). Resolved through <neo-icon> and follows the
// active icon theme. Set("") hides the caret entirely.
Caret Attr[string]
AriaLabel Attr[string]
Placement Attr[Placement]
ScreenOffset Attr[CSSUnit]
// FollowScroll forwards a popover scroll-follow mode to the inner
// popover. Defaults to [PopoverFollowScrollUntilTriggerInvisible] so
// the popover closes once its trigger scrolls off-screen; pass
// [PopoverFollowScrollAlways] to keep it anchored across scrolls, or
// [PopoverFollowScrollOff] to disable.
FollowScroll Attr[PopoverFollowScroll]
ClampPlacement Attr[bool]
MinFitHeight Attr[CSSUnit]
MinFitWidth Attr[CSSUnit]
MinOpenHeight Attr[CSSUnit]
MinOpenWidth Attr[CSSUnit]
// PopoverFitContent sizes the popover to its option rows instead of
// forcing the trigger width. It is still capped by
// --neo-popover-max-width and the viewport.
PopoverFitContent Attr[bool]
}
type ContextMenuOpts ¶
type ContextMenuOpts struct {
Mode Attr[MenuMode]
// Open seeds the open state (server-rendered expanded menu).
Open Attr[bool]
ScreenOffset Attr[CSSUnit]
ClampPlacement Attr[bool]
MinFitHeight Attr[CSSUnit]
MinFitWidth Attr[CSSUnit]
}
ContextMenuOpts forwards the same sizing / submenu mode attributes used by Menu, but opens from a right-click or keyboard context-menu invocation on the child marked [data-neo-contextmenu-trigger].
type DatalistOpts ¶
type DatalistOpts struct {
// ID names the datalist. A control opts in with list="<id>" (like
// native <input list>). Inline datalists placed inside one control
// don't need an id.
ID Attr[string]
}
DatalistOpts configures a <neo-datalist>, a data-only option container read by Select, Combobox, and TextInput (suggestions).
type DialogOpts ¶
type DialogOpts struct {
// Open seeds the open state.
Open Attr[bool]
// Dismissible controls whether backdrop click and Escape close the
// dialog. Default leaves it dismissible; [DismissibleOff] locks it open
// for must-decide flows where the user has to pick a button.
Dismissible Attr[Dismissible]
}
type Dismissible ¶
type Dismissible int8
Dismissible is the tri-state for the shared `dismissible` attribute used by the overlay components (dialog, drawer, lightbox) and toast. The zero value (DismissibleDefault) emits no attribute and the component's own default applies (dismissible). DismissibleOff emits dismissible="false" (dialog/drawer/lightbox lock open; toast drops its close button); DismissibleOn emits dismissible="true" as an explicit opt-in.
const ( DismissibleDefault Dismissible = iota DismissibleOn DismissibleOff )
type DrawerOpts ¶
type DrawerOpts struct {
// Side defaults to [SideRight] (the host's own default); [SideLeft],
// [SideTop], and [SideBottom] are also accepted.
Side Attr[Side]
// Open seeds the drawer's open state.
Open Attr[bool]
// Dismissible controls whether backdrop click and Escape close the drawer.
// Default leaves it dismissible; [DismissibleOff] locks it open.
Dismissible Attr[Dismissible]
// NoTouchDismiss opts out of the drag-to-close gesture (enabled by
// default); renders `touch-dismiss="off"` on the host.
NoTouchDismiss Attr[bool]
// TouchDismissThreshold overrides the default close threshold of
// 1/2 of the panel's relevant dimension. Any CSS length is accepted,
// including px, rem, and percent.
TouchDismissThreshold Attr[CSSUnit]
}
type ElasticOpts ¶
type ElasticOpts struct {
// Collapsed forces the host to height: 0 by emitting open="false"
// (the transition still animates). The host is open by default.
Collapsed Attr[bool]
// ResetOnCollapse swaps the content back to the
// [data-neo-async-placeholder] template after a completed collapse.
// Re-expanding then reloads from the placeholder (e.g. re-fetches).
ResetOnCollapse Attr[bool]
}
type FlexBasis ¶
type FlexBasis string
FlexBasis is a literal flex-basis for a layout child (neo-flex-basis), limited to the CSS keywords 0, auto, and 100%. For a fixed width set flex-basis via style, e.g. style="flex-basis: var(--neo-size-sidebar)" (the --neo-size-* vars are themeable presets) or a plain length; arbitrary lengths stay out of the attribute surface.
type FlexDirection ¶
type FlexDirection string
FlexDirection sets <neo-layout> flex-direction. Rendered as a boolean attribute whose name is the CSS value. Zero value renders row (the CSS default) and emits no attribute.
const ( DirectionDefault FlexDirection = "" Row FlexDirection = "row" RowReverse FlexDirection = "row-reverse" Column FlexDirection = "column" ColumnReverse FlexDirection = "column-reverse" )
type FlexWrap ¶
type FlexWrap string
FlexWrap sets <neo-layout> flex-wrap, also as a boolean attribute. Zero value renders nowrap (the CSS default) and emits no attribute.
type Gap ¶
type Gap string
Gap is a spacing-scale token for gap / column-gap / row-gap. Zero value emits no attribute. For an arbitrary length set --neo-gap via style instead.
type IfNetworkOpts ¶ added in v0.2.0
type IfNetworkOpts struct {
// Online is a boolean command, where true shows the children while
// online, false while offline and unset in both. Offline is reliable;
// online only means a network is connected, not that the server is
// reachable.
Online Attr[bool]
// Delay is the milliseconds a connection change must last before the
// branch switches. A shorter drop shows nothing. Unset switches at
// once. The state on page load always applies at once.
Delay Attr[int]
}
IfNetworkOpts configures <neo-if-network>, the client-side connection gate. It shows its children only in the connection state Online names; otherwise the subtree is removed from layout. The server can't know the client's connection state. A branch never renders visible before the bundle upgrades it.
type IfPlatformOpts ¶ added in v0.2.0
type IfPlatformOpts struct {
MacOS Attr[bool]
IOS Attr[bool]
Windows Attr[bool]
Linux Attr[bool]
Android Attr[bool]
ChromeOS Attr[bool]
// UserAgent enables server-side pre-rendering. Pass the request
// User-Agent (r.UserAgent()) and a matching branch renders already
// visible, which keeps it from flashing in after the bundle upgrades.
// The client then reconciles against the real platform. Leave empty
// (e.g. on a static/CDN site that can't read the request UA) for
// client-only.
UserAgent Attr[string]
}
IfPlatformOpts configures <neo-if-platform>, the client-side platform gate. Each platform field is a boolean command, where true shows the children on that platform, false hides them there and unset leaves it to the others. The platforms set true are an OR; with none set true, every platform not set false shows. For platform branches the server can't resolve. Capability conditions (touch, hover, pointer) belong in CSS @media queries instead.
type ItemOpts ¶
type ItemOpts struct {
Grow Attr[bool] // neo-flex-grow="1"
NoShrink Attr[bool] // neo-flex-shrink="0"
Basis Attr[FlexBasis] // neo-flex-basis
AlignSelf Attr[AlignSelf] // neo-align-self
Width Attr[ItemSize] // neo-width
Height Attr[ItemSize] // neo-height
MinWidth0 Attr[bool] // neo-min-width="0" (the flex min-size fix, in a row)
MinHeight0 Attr[bool] // neo-min-height="0" (in a column)
Overflow Attr[Overflow] // neo-overflow
Truncate Attr[bool] // neo-truncate (single-line ellipsis)
HideBelow Attr[Collapse] // neo-hide-below: hide while the nearest container is below this tier
ShowBelow Attr[Collapse] // neo-show-below: show only while the container is below this tier
}
ItemOpts is the typed child-layout surface for flex-item behaviour that belongs to the child rather than the container. Item turns it into the neo-* attributes to spread onto any flex child, usually a semantic element instead of a wrapper.
type JustifyContent ¶
type JustifyContent string
JustifyContent sets <neo-layout> justify-content (main-axis distribution). Zero value emits no attribute.
const ( JustifyContentDefault JustifyContent = "" JustifyContentFlexStart JustifyContent = "flex-start" JustifyContentFlexEnd JustifyContent = "flex-end" JustifyContentCenter JustifyContent = "center" JustifyContentSpaceBetween JustifyContent = "space-between" JustifyContentSpaceAround JustifyContent = "space-around" JustifyContentSpaceEvenly JustifyContent = "space-evenly" )
type KbdOpts ¶
type KbdOpts struct {
// Variant is "" (subtle key chip with bottom shadow) or "outline"
// (transparent fill with border).
Variant Attr[string]
// Size is "" (default) or "sm" (compact).
Size Attr[string]
// Key renders the platform-correct glyph for a single key (e.g. "mod" ->
// ⌘ / Ctrl, "enter" -> ↩ / Enter). Overrides any children. Compose
// multi-key shortcuts from several [Kbd] in a [KbdGroup].
Key Attr[string]
// UserAgent enables server-side pre-rendering of the Key glyph. Pass
// the request User-Agent (r.UserAgent()) and the glyph is emitted for
// that OS, which keeps it from flashing in after the bundle upgrades.
// The client then reconciles against the real platform. Leave empty on a
// static/CDN site that can't read the request UA.
UserAgent Attr[string]
}
type KeysOpts ¶
type KeysOpts struct {
Keys Attr[string] // chords; `+` joins, `,` sequences, `|` alternatives
Target Attr[string] // parent | window | document | CSS selector
For Attr[string] // element id to click on a match
Up Attr[bool] // match on keyup instead of keydown
Repeat Attr[bool] // allow auto-repeat to fire
Prevent Attr[bool] // Set(false) emits prevent="false" to keep the default action
Stop Attr[bool] // stopPropagation on a match
InInput Attr[bool] // also fire from text-entry contexts
Disabled Attr[bool] // inert while set
SequenceTimeout Attr[int] // ms between sequence steps (default 1000)
}
KeysOpts configures <neo-keys>, which binds keyboard shortcuts in the scope of a target element (its parent by default) and emits an event on a match. It renders nothing.
type LayoutOpts ¶
type LayoutOpts struct {
Direction Attr[FlexDirection] // row (default) | row-reverse | column | column-reverse
Wrap Attr[FlexWrap] // nowrap (default) | wrap | wrap-reverse
AlignItems Attr[AlignItems]
JustifyContent Attr[JustifyContent]
AlignContent Attr[AlignContent] // wrapped-line distribution; needs Wrap
Gap Attr[Gap]
ColumnGap Attr[Gap]
RowGap Attr[Gap]
MinHeight Attr[MinHeight]
Inline Attr[bool] // display: inline-flex
Container Attr[bool] // container-type: inline-size, a query container for Collapse
Collapse Attr[Collapse] // fold a row to a column below a container-width tier
}
LayoutOpts is the typed attribute surface for <neo-layout>. Every field maps 1:1 to the CSS flex container property of the same name.
type LightboxOpts ¶
type LightboxOpts struct {
// Contained confines the overlay to the host's own box (the host becomes
// the positioned containing block). Default renders to the screen top layer.
Contained Attr[bool]
// Open seeds the open state.
Open Attr[bool]
// Hover opens the overlay when the pointer enters a trigger and
// closes it after the pointer leaves both trigger and surface.
// Mouse only; touch and keyboard fall back to click.
Hover Attr[bool]
// HoverOpenDelay and HoverCloseDelay are the milliseconds the
// component waits before opening / closing on hover. Zero leaves the
// attribute off (component defaults: 100ms open, 200ms close).
HoverOpenDelay Attr[int]
HoverCloseDelay Attr[int]
// Dismissible controls backdrop and Esc dismissal. Default leaves the
// overlay dismissible; [DismissibleOff] locks it open.
Dismissible Attr[Dismissible]
// Transition picks the entry / exit style. The zero value emits no
// attribute and the component defaults to zoom.
Transition Attr[LightboxTransition]
}
type LightboxTransition ¶
type LightboxTransition string
LightboxTransition selects the entry / exit style. The zero value emits no `transition` and the component defaults to zoom.
const ( // LightboxTransitionZoom morphs the surface from the opening trigger's // position and size (a FLIP), and back into it on close. The default. LightboxTransitionZoom LightboxTransition = "zoom" // LightboxTransitionFade is a centered scale + opacity entry. LightboxTransitionFade LightboxTransition = "fade" // LightboxTransitionNone shows the overlay instantly (no surface // animation); the backdrop still fades. LightboxTransitionNone LightboxTransition = "none" )
type LinkOpts ¶
type LinkOpts struct {
// Href is the link target. Empty emits an anchor without an `href`
// attribute (a placeholder that the browser doesn't treat as a link).
Href Attr[string]
// Target follows the native `target` semantics ("_blank", "_self",
// a named browsing context, ...). Modern browsers default to
// `rel="noopener"` for `_blank`, but spell it out explicitly when
// older targets matter.
Target Attr[string]
// Rel sets the link-type relationship as a space-separated list of
// tokens like "noopener", "noreferrer", "nofollow", "external",
// "author". Frequently paired with Target="_blank" on external
// links for the cross-origin tab-isolation guarantee.
Rel Attr[string]
// Download triggers a save-as instead of navigation; the value is
// the suggested filename. Empty emits no `download` attribute. For
// the bare `download` form (use the server-provided filename),
// pass `download=""` via [LinkAttrs].
Download Attr[string]
// HrefLang is the BCP-47 language tag (e.g. "en", "de-CH") of the
// linked resource. Hint only; browsers don't act on it, but AT
// and translation tools do.
HrefLang Attr[string]
// ReferrerPolicy controls how much of the current URL is sent in
// the Referer header on follow ("no-referrer",
// "strict-origin-when-cross-origin", "origin", ...). Empty inherits
// the document-level policy.
ReferrerPolicy Attr[string]
// Variant picks the visual style. Zero value ([LinkVariantDefault])
// renders as a typical inline anchor; the LinkVariantButton*
// family renders with the corresponding <neo-button> styling.
Variant Attr[LinkVariant]
// Disabled doesn't exist natively on <a>; this stamps the standard
// inert markers so AT and keyboard nav treat the link as disabled.
// The kit's CSS owns the visual state.
Disabled Attr[bool]
}
LinkOpts configures the kit's styled anchor. The wrapper renders a plain native <a> carrying `data-neo-link`, the hook the kit's CSS keys on. There is no custom element and no link-specific JS. Behavior is exactly a native link.
type LinkVariant ¶
type LinkVariant string
LinkVariant is the visual style enum for the kit's styled anchor (`<a data-neo-link>`). The zero value (LinkVariantDefault) renders as a typical inline anchor, accent-coloured underlined text suitable for running prose. The LinkVariantButton* family makes the link adopt <neo-button>'s look exactly, which lets the same anchor stand in for a button when the destination is a URL rather than an action. Every button-family value carries the `button-` prefix so CSS can select the whole family by attribute prefix.
LinkVariant is separate from ButtonVariant because the 2 types disagree on what the zero value should mean. <neo-button>'s zero is its neutral styling; the link's is anchor. Sharing one type would force one component or the other to spell its default explicitly.
const ( LinkVariantDefault LinkVariant = "default" LinkVariantButtonDefault LinkVariant = "button-default" LinkVariantButtonPrimary LinkVariant = "button-primary" LinkVariantButtonSecondary LinkVariant = "button-secondary" LinkVariantButtonGhost LinkVariant = "button-ghost" LinkVariantButtonDanger LinkVariant = "button-danger" )
type MenuItemOpts ¶
type MenuItemOpts struct {
// Value identifies the item in the `neo-menuitem-select` event.
Value Attr[string]
// Shortcut is a global hotkey, e.g. "Cmd+S" / "Mod+K" /
// "Shift+Alt+P". The host registers a document keydown that
// activates the item, and renders a trailing kbd hint.
Shortcut Attr[string]
Disabled Attr[bool]
}
type MenuMode ¶
type MenuMode string
MenuMode picks the cascade strategy for nested submenus. Zero value (MenuModeDefault) defers to <neo-menu>'s own default (auto, which cascades when there's room and pushes when there isn't).
type MenuOpts ¶
type MenuOpts struct {
Placement Attr[Placement]
Mode Attr[MenuMode]
// Open seeds the open state (server-rendered expanded menu).
Open Attr[bool]
ScreenOffset Attr[CSSUnit]
ClampPlacement Attr[bool]
MinFitHeight Attr[CSSUnit]
MinFitWidth Attr[CSSUnit]
}
MenuOpts forwards popover-host attributes onto the inner <neo-popover> the host wires up for cascade and submenu panels.
type MinHeight ¶
type MinHeight string
MinHeight is a <neo-layout> min-height preset; values are literal CSS.
type NavGroupOpts ¶
type NavGroupOpts struct {
// [OrientationGrid] are also accepted.
Orientation Attr[Orientation]
// responsive grids.
Columns Attr[int]
Wrap Attr[bool]
// come from data-neo-navgroup-label, aria-label, label, or text.
Typeahead Attr[bool]
// TypeaheadTimeout is the idle reset in ms (0 = kit default 500).
}
NavGroupOpts assumes no ARIA role; set role via attrs to fit the semantics.
type OptGroupOpts ¶
type OptionOpts ¶
type OptionOpts struct {
// Value is the option's identity (matched against the parent
// select's value).
Value Attr[string]
// Label is an optional plain-text label used on the trigger when
// selected; provide it when children are rich markup that doesn't
// compress well into the trigger.
Label Attr[string]
// Disabled marks the option non-selectable; arrow nav skips it.
Disabled Attr[bool]
}
type Orientation ¶
type Orientation string
Orientation is the layout-axis enum for group components that can also lay out as a grid (nav group, sortable). Zero value (OrientationDefault) defers to the host's own default and emits no `orientation` attribute.
Components that only ever flip between horizontal and vertical use Axis instead, which makes `grid` unrepresentable where it has no effect.
const ( OrientationDefault Orientation = "" OrientationHorizontal Orientation = "horizontal" OrientationVertical Orientation = "vertical" OrientationGrid Orientation = "grid" )
type PaginationOpts ¶
type PaginationOpts struct {
// Page is the active page (1-indexed). Set(0) emits page="0",
// the matching idiom [Slider] / [Progress] use for explicit zero values
// that must round-trip as attributes.
Page Attr[int]
// Pages is the total number of pages; the host renders no chips when Pages < 1.
Pages Attr[int]
// SiblingCount controls how many pages flank the current one
// (default in the JS host: 1).
SiblingCount Attr[int]
// BoundaryCount controls how many pages flank the start/end runs
// (default in the JS host: 1).
BoundaryCount Attr[int]
Disabled Attr[bool]
AriaLabel Attr[string]
}
type PersistOpts ¶
type PersistOpts struct {
Key Attr[string]
Props []string
On []string
Session Attr[bool]
For Attr[string]
}
PersistOpts holds the <neo-persist> attributes. For targets by id when non-empty (else first child).
type Placement ¶
type Placement string
Placement is the popover-host anchor enum, shared by every component that opens a floating panel against an anchor (popover, tooltip, menu, submenu). Zero value (PlacementDefault) defers to the host's own default ("bottom-start") and emits no `placement` attribute. A struct literal without the field still produces the correct pre-hydration markup.
const ( PlacementDefault Placement = "" PlacementBottomStart Placement = "bottom-start" PlacementBottom Placement = "bottom" PlacementBottomEnd Placement = "bottom-end" PlacementTopStart Placement = "top-start" PlacementTop Placement = "top" PlacementTopEnd Placement = "top-end" PlacementLeftStart Placement = "left-start" PlacementLeft Placement = "left" PlacementLeftEnd Placement = "left-end" PlacementRightStart Placement = "right-start" PlacementRight Placement = "right" PlacementRightEnd Placement = "right-end" )
type Platform ¶
type Platform string
Platform is the OS used for server-side platform gating (<neo-if-platform>) and shortcut-hint pre-rendering (<neo-kbd>). Detect it from the request User-Agent with DetectPlatform; the client then refines via navigator.userAgentData.platform. Mirrors web/lib/platform.ts so the server pre-render matches what the browser would render, eliminating the flash where content changes after the bundle upgrades the elements.
func DetectPlatform ¶
DetectPlatform classifies a User-Agent header into an OS. The server only has the UA string (no client hints), which makes this a best guess the client may refine. iPadOS Safari sends a Mac UA and detects as PlatformMacOS. An empty UA returns PlatformOther.
type PopoverFollowScroll ¶
type PopoverFollowScroll string
const ( PopoverFollowScrollOff PopoverFollowScroll = "off" PopoverFollowScrollAlways PopoverFollowScroll = "always" PopoverFollowScrollUntilTriggerInvisible PopoverFollowScroll = "until-trigger-invisible" )
PopoverFollowScrollOff is the explicit "off" value, useful for wrappers (Select, Combobox) that default the zero value to PopoverFollowScrollUntilTriggerInvisible and need a sentinel to opt back out.
type PopoverOpts ¶
type PopoverOpts struct {
// Placement picks one of the 12 sides/alignments (bottom-start
// default).
Placement Attr[Placement]
// Open seeds the open state.
Open Attr[bool]
// ScreenOffset is a CSS length controlling the minimum margin
// between panel and viewport edge (mirrored to
// `--neo-popover-screen-offset`).
ScreenOffset Attr[CSSUnit]
// FollowScroll controls how the popover behaves during scroll.
// [PopoverFollowScrollAlways] stays anchored to the trigger;
// [PopoverFollowScrollUntilTriggerInvisible] stays anchored until the
// trigger leaves the viewport, then closes.
FollowScroll Attr[PopoverFollowScroll]
// ClampPlacement opts out of the default strict placement and
// re-anchors the panel position to keep it inside the viewport
// when content would otherwise overflow.
ClampPlacement Attr[bool]
// MinFitHeight / MinFitWidth set CSS-length thresholds, or the
// special value "content", for the strict-placement auto-flip.
// If the slot in the configured placement is shorter than the
// threshold (and the opposite side has more room) the panel flips
// to the opposite primary axis. "content" resolves from the panel's
// scroll size on each positioning pass. Default: content.
MinFitHeight Attr[CSSUnit]
MinFitWidth Attr[CSSUnit]
// MinOpenHeight / MinOpenWidth close the popover when the final
// bounded slot is too small to remain useful.
MinOpenHeight Attr[CSSUnit]
MinOpenWidth Attr[CSSUnit]
TriggerAction Attr[PopoverTriggerAction]
// MatchTriggerWidth makes the panel's border-box width match the
// trigger's border-box width on every positioning pass.
MatchTriggerWidth Attr[bool]
// Flip lets the panel flip to the opposite side when Placement
// doesn't fit (default). Set(false) pins it to Placement (flip="false").
Flip Attr[bool]
// Hover opens the panel when the pointer enters the trigger and
// closes it after the pointer leaves both the trigger and the panel.
// Mouse only; touch falls back to click.
Hover Attr[bool]
// HoverOpenDelay and HoverCloseDelay are the milliseconds the
// component waits before opening / closing on hover. Zero leaves
// the attribute off (component defaults: 100ms open, 200ms close).
HoverOpenDelay Attr[int]
HoverCloseDelay Attr[int]
}
type PopoverTriggerAction ¶
type PopoverTriggerAction string
PopoverTriggerAction overrides the default trigger-click toggle. Zero value emits no `trigger-action`. PopoverTriggerShow is the submenu case. Click only opens, since hover may have already opened the panel.
const ( PopoverTriggerToggle PopoverTriggerAction = "" PopoverTriggerShow PopoverTriggerAction = "show" PopoverTriggerHide PopoverTriggerAction = "hide" )
type ProgressMark ¶
ProgressMark describes one anchor mark on a Progress bar's rail. Value is the numeric position; Label is the optional caption beneath the rail (empty draws just the dot). Marks outside [Min, Max] are skipped.
type ProgressOpts ¶
type ProgressOpts[N Number] struct { Min, Max, Value Attr[N] Label Attr[string] Unit Attr[string] // HideValue suppresses the value readout (and unit); combined // with empty Label this hides the header entirely. HideValue Attr[bool] Vertical Attr[bool] // Indeterminate replaces the determinate fill with a looping // animation; Value is ignored while on, and the bar reads as // `aria-valuenow=""` so AT announces indeterminate state. Indeterminate Attr[bool] // Easing is the transition shorthand for the fill, // with the same syntax as [SliderOpts.Easing]. Easing Attr[string] Marks []ProgressMark AriaLabel Attr[string] }
ProgressOpts numeric defaults match the JS host (Min=0, Max=100, Value=Min). Set a numeric field when an explicit zero needs to be emitted as an attribute (otherwise omitted, host uses its default).
type RadioGroupOpts ¶
type RadioGroupOpts struct {
// Value seeds the initially-checked radio's value.
Value Attr[string]
// Orientation is "" (vertical, default) or "horizontal". A display
// attribute that sets the flex direction only. Arrow keys navigate on
// either axis regardless.
Orientation Attr[Axis]
// Disabled disables every nested radio (per-radio disabled is
// honoured independently).
Disabled Attr[bool]
// AutoActivate selects a radio on focus (arrow keys) rather than
// requiring Enter / Space. Off by default (manual activation).
AutoActivate Attr[bool]
// AriaLabel is the group's accessible name; for a visible label use
// aria-labelledby via attrs instead.
AriaLabel Attr[string]
}
type RatingOpts ¶
type RatingOpts struct {
Value, Max, Precision Attr[float64]
// Icon is the neo-icon name drawn for each symbol (default "star").
Icon Attr[string]
// Label is the accessible name; also mirrored to aria-label.
Label Attr[string]
// Readonly renders the value but blocks interaction (still announced).
// Disabled also dims it. Both drop it from tab order.
Readonly Attr[bool]
Disabled Attr[bool]
// Size scales the symbol. One of "" (default), "sm", "lg".
Size Attr[string]
// AriaLabel is used when Label is empty (e.g. an icon-only rating
// whose meaning is conveyed elsewhere).
AriaLabel Attr[string]
}
RatingOpts is the attribute surface for <neo-rating>. Numeric defaults match the JS host (Max=5, Precision=1, Value=0). Set a numeric field when an explicit zero must still be emitted as an attribute (e.g. for a Datastar binding) rather than omitted.
type ResizableHandles ¶
type ResizableHandles uint16
ResizableHandles is a bitmask of the directions a Resizable exposes drag handles for. Combine with `|`.
const ( ResizableTop ResizableHandles = 1 << iota ResizableBottom ResizableLeft ResizableRight ResizableTopLeft ResizableTopRight ResizableBottomLeft ResizableBottomRight )
func (ResizableHandles) String ¶
func (h ResizableHandles) String() string
String renders the set bits as the space-separated value the `handles=""` attribute expects.
type ResizableOpts ¶
type ResizableOpts[N Number] struct { // Handles is the bitmask of edges/corners to expose drag handles for. // Zero value exposes none (resize disabled). Handles Attr[ResizableHandles] // Width / Height are the initial size. Width, Height Attr[CSSUnit] // Min/Max bounds; any CSS length, or "none" to clear a default. MinWidth, MaxWidth Attr[CSSUnit] MinHeight, MaxHeight Attr[CSSUnit] // StepHorizontal / StepVertical snap width / height to a pixel grid // during resize. Zero (the default) means free resize on that axis. StepHorizontal, StepVertical Attr[N] // HandleIcons overrides the default glyph for specific handles, keyed // by handle name ("bottom-right", "top", ...). The supplied content // renders inside that handle instead of the default <neo-icon>, and is // prerendered so the glyph survives morphs and matches first paint. HandleIcons map[string]templ.Component }
ResizableOpts is the typed attribute surface for <neo-resizable>. The sizing fields are CSS lengths mirrored to inline style for first paint and emitted as the element's observed attributes.
type RevealableOpts ¶
type RevealableOpts struct {
// Open seeds the element open (content visible) instead of concealed.
Open Attr[bool]
// RehideAfter is in ms; >0 auto re-conceals that long after a
// reveal. 0 omits the attribute, which keeps it revealed until the
// user re-activates it (same as `rehide-after="0"`).
RehideAfter Attr[int]
// Variant picks inline grain over text, or a veil + sparser particles
// over an image/section. Auto when empty.
Variant Attr[RevealableVariant]
// Density multiplies the particle count, clamped 0.3-3 by the
// element (e.g. "1.5"). Empty uses the default (1).
Density Attr[string]
// BlurContent (media variant only) teases the shape with a heavy
// blur instead of fully hiding it. No effect on text, which is
// hidden outright.
BlurContent Attr[bool]
}
type RevealableVariant ¶
type RevealableVariant string
RevealableVariant picks the obscure treatment. Zero value (RevealableVariantAuto) lets the element infer it from the host's height (tall -> media, short -> inline) and emits no `variant`.
const ( RevealableVariantAuto RevealableVariant = "" RevealableVariantInline RevealableVariant = "inline" RevealableVariantMedia RevealableVariant = "media" )
type SelectOpts ¶
type SelectOpts struct {
// Value seeds the initial selection.
Value Attr[string]
// Name is the form field name. The control is form-associated and, with
// a Name set, submits its value in a native <form> like a <select>.
Name Attr[string]
// Disabled makes the control non-interactive. The trigger drops out of
// the tab order and ignores clicks and keys.
Disabled Attr[bool]
// Size is the control-size step ("sm" | "lg"); empty is the default
// size. Shared with the other row controls so they line up.
Size Attr[string]
// List points at a shared <neo-datalist> by id (like native
// <input list>) to source options. An inline datalist or directly
// authored options take precedence.
List Attr[string]
// Placeholder is shown on the trigger when nothing is selected
// (overridden by a `[data-neo-select-empty]` template).
Placeholder Attr[string]
// Async lazy-loads options on every open.
Async Attr[bool]
// AsyncRestore keeps the async loading-template restored across a
// server morph (default). Set(false) opts out
// (data-neo-async-restore="false").
AsyncRestore Attr[bool]
// Clearable lets Backspace/Delete return to no-value.
Clearable Attr[bool]
// Typeahead enables the type-to-search buffer (default). Set(false)
// disables it (typeahead="false"; Space then activates the focused
// option instead of feeding the buffer).
Typeahead Attr[bool]
// TypeaheadTimeout is the idle reset in ms (0 = kit default 500).
TypeaheadTimeout Attr[int]
TypeaheadMatch Attr[TypeaheadMatch]
// Caret overrides the trigger's caret icon name (default
// "chevrons-up-down"). Resolved through <neo-icon> and follows the
// active icon theme. Set("") hides the caret entirely.
Caret Attr[string]
AriaLabel Attr[string]
Placement Attr[Placement]
ScreenOffset Attr[CSSUnit]
// FollowScroll forwards a popover scroll-follow mode to the inner
// popover. Defaults to [PopoverFollowScrollUntilTriggerInvisible] so
// the listbox closes once its trigger scrolls off-screen; pass
// [PopoverFollowScrollAlways] to keep it anchored across scrolls, or
// [PopoverFollowScrollOff] to disable.
FollowScroll Attr[PopoverFollowScroll]
ClampPlacement Attr[bool]
MinFitHeight Attr[CSSUnit]
MinFitWidth Attr[CSSUnit]
MinOpenHeight Attr[CSSUnit]
MinOpenWidth Attr[CSSUnit]
// PopoverFitContent sizes the popover to its option rows instead of
// forcing the trigger width. It is still capped by
// --neo-popover-max-width and the viewport.
PopoverFitContent Attr[bool]
}
type Side ¶
type Side string
Side is the edge-anchor enum shared by side-anchored panels (drawer, sidebar). Zero value (SideDefault) defers to the host's default, which is "right" for <neo-drawer> and "left" for <neo-sidebar>.
SideTop and SideBottom are only meaningful for <neo-drawer>; <neo-sidebar> ignores them. The single shared type avoids a separate enum per component for the same edge choice.
type SidebarOpts ¶
type SidebarOpts struct {
// Open pins the sidebar open or closed at every viewport; absent
// gives auto behaviour (open above OverlayBreakpoint, closed below).
Open Attr[bool]
Side Attr[Side]
// Manual disables auto-open-on-wide.
Manual Attr[bool]
// Overlay forces fixed-overlay rendering at every width (e.g.
// settings drawers).
Overlay Attr[bool]
// OverlayBreakpoint overrides the default 50rem cutoff per instance.
// Accepts any CSS length, or a bare number in px.
OverlayBreakpoint Attr[CSSUnit]
// NoTouchDismiss opts out of the drag-to-close gesture (enabled by
// default in overlay mode); renders `touch-dismiss="off"` on the
// host.
NoTouchDismiss Attr[bool]
// TouchDismissThreshold overrides the default close threshold of
// 1/2 of the host's width. Any CSS length is accepted, including px,
// rem, and percent.
TouchDismissThreshold Attr[CSSUnit]
AriaLabel Attr[string]
}
type SkeletonOpts ¶
type SkeletonOpts struct {
Variant Attr[SkeletonVariant]
// Immediate shows the placeholder at once. By default it fades in
// after a short delay so fast loads never flash a skeleton.
Immediate Attr[bool]
}
type SkeletonVariant ¶
type SkeletonVariant string
SkeletonVariant picks the placeholder geometry. Zero value (SkeletonVariantBlock) renders a generic block; SkeletonVariantCircle is 1:1 round, SkeletonVariantLine is an inline text-height bar.
const ( SkeletonVariantBlock SkeletonVariant = "" SkeletonVariantCircle SkeletonVariant = "circle" SkeletonVariantLine SkeletonVariant = "line" )
type SliderMark ¶
SliderMark describes one anchor mark on a Slider's rail. Value is the numeric position. Label is the optional caption beneath the rail (empty draws just the dot). Marks outside [Min, Max] are skipped.
type SliderOpts ¶
type SliderOpts[N Number] struct { Min, Max, Step, Value Attr[N] Label Attr[string] Unit Attr[string] // HideValue suppresses the editable readout. HideValue Attr[bool] // HideTooltip suppresses the value bubble above the thumb. HideTooltip Attr[bool] Vertical Attr[bool] // StaticMarks makes marks decorative (no click-to-snap). StaticMarks Attr[bool] // MarksOnly constrains navigation to land on a mark value. MarksOnly Attr[bool] Disabled Attr[bool] // Easing is the transition shorthand for thumb/fill animation // between commits. Easing Attr[string] Marks []SliderMark AriaLabel Attr[string] }
SliderOpts numeric defaults match the JS host (Min=0, Max=100, Step=1, Value=Min). Set a numeric field when an explicit zero needs to override the default (e.g. Set(0) on Min emits the attribute with "0" verbatim for clarity / Datastar binding).
type SliderRangeOpts ¶
type SliderRangeOpts[N Number] struct { Min, Max, Step, ValueMin, ValueMax Attr[N] Label, Unit, Easing Attr[string] HideValue, HideTooltip, Vertical, Disabled Attr[bool] // StaticMarks makes authored marks decorative (no click-to-snap). StaticMarks Attr[bool] AriaLabel Attr[string] }
SliderRangeOpts is the 2-thumb sibling of SliderOpts, with the same Min/Max/Step grid but a [ValueMin, ValueMax] interval as the selection. Setting a field makes its zero value explicit; otherwise the attribute is omitted and the host falls back to its default (Min=0, Max=100, Step=1, ValueMin=Min, ValueMax=Max).
type SortableOpts ¶
type SortableOpts struct {
// Orientation constrains pointer travel and the reorder axis.
// Zero value defaults to a vertical column; [OrientationGrid]
// enables 2-D reordering.
Orientation Attr[Orientation]
// Disabled freezes reordering and drops the keyboard grip.
Disabled Attr[bool]
// Unbounded opts out of the default behavior of clamping the
// floating dragged element to the host's bounding box, letting it
// follow the pointer anywhere on the page.
Unbounded Attr[bool]
// Easing is the easing for displaced (non-dragged) items. Empty omits
// the attribute (theme --neo-easing at default duration), a bare
// duration ("220ms") pairs with --neo-easing, a full pair is
// verbatim. Explicit empty via [SortableAttrs] disables it.
Easing Attr[string]
// TolerateReorder relaxes the mid-drag abort rule. By default a
// server morph that reorders items aborts the user's drag (the
// slot data semantically changed). With TolerateReorder set,
// order-only changes are treated as a no-op (same set of ids
// and same per-id content, just shuffled) and the drag continues
// against the new layout. Content/set changes still abort.
TolerateReorder Attr[bool]
}
SortableOpts is the attribute surface for <neo-sortable>, whose direct element children drag-reorder via pointer, touch, or keyboard.
type SpinnerOpts ¶
type SpinnerOpts[N Number] struct { Min, Max, Value Attr[N] // Indeterminate forces the spin even when a value is set. Indeterminate Attr[bool] // Label is the accessible name; with it set the spinner reports // role="progressbar". Label Attr[string] // Tooltip wraps the ring in a <neo-tooltip> showing the value // (plus Unit) on hover/focus; no text is painted on the ring // itself. The tooltip text is rendered from the initial value; // set a changing value through aria-valuenow instead. Tooltip Attr[bool] Unit Attr[string] // Easing animates the arc between value commits, with the same // shorthand as [ProgressOpts.Easing]. Easing Attr[string] AriaLabel Attr[string] }
SpinnerOpts is the determinate-ring attribute surface for <neo-spinner>. Numeric defaults match the JS host (Min=0, Max=100, Value=Min). Set a numeric field when an explicit zero must still be emitted as an attribute (otherwise it's omitted and the host falls back to its default).
type SubMenuOpts ¶
type SubMenuOpts struct {
// Label is the trigger text in the parent menu row.
Label Attr[string]
Placement Attr[Placement]
Disabled Attr[bool]
// Open seeds the open state (server-rendered expanded submenu).
Open Attr[bool]
ScreenOffset Attr[CSSUnit]
ClampPlacement Attr[bool]
MinFitHeight Attr[CSSUnit]
MinFitWidth Attr[CSSUnit]
}
SubMenuOpts forwards popover-host attributes onto the cascade popover.
type SwitchOpts ¶
type TabsOpts ¶
type TabsOpts struct {
// Value is the selected tab value (emitted as `value`).
Value Attr[string]
// Orientation is "horizontal" (default) or "vertical"; it also sets
// aria-orientation on the tablist and the primary arrow-key axis.
Orientation Attr[Axis]
// Easing is the transition shorthand for the active-ink slide.
Easing Attr[string]
// EnterAnimation / ExitAnimation name the panel transition.
EnterAnimation Attr[string]
ExitAnimation Attr[string]
// AutoActivate selects a tab on focus (arrow keys) rather than
// requiring Enter/Space.
AutoActivate Attr[bool]
}
TabsOpts is the typed attribute surface for <neo-tabs>.
type TextInputCase ¶
type TextInputCase string
TextInputCase is the free-form case transform. Zero value (TextInputCaseDefault) emits no `case` attribute and preserves the typed case. Ignored when Mask is set; use a cased mask letter (U, A, l, a) instead.
const ( TextInputCaseDefault TextInputCase = "" TextInputCaseUpper TextInputCase = "upper" TextInputCaseLower TextInputCase = "lower" )
type TextInputFormat ¶
type TextInputFormat string
TextInputFormat is the live-formatting mode. Zero value (TextInputFormatDefault) emits no `format` attribute (mask / plain transforms apply instead).
const ( TextInputFormatDefault TextInputFormat = "" TextInputFormatNumber TextInputFormat = "number" )
type TextInputInputmode ¶
type TextInputInputmode string
TextInputInputmode is the native `inputmode` virtual-keyboard hint. String-backed; these are the full WHATWG set.
const ( TextInputInputmodeDefault TextInputInputmode = "" TextInputInputmodeNone TextInputInputmode = "none" TextInputInputmodeText TextInputInputmode = "text" TextInputInputmodeDecimal TextInputInputmode = "decimal" TextInputInputmodeNumeric TextInputInputmode = "numeric" TextInputInputmodeTel TextInputInputmode = "tel" TextInputInputmodeSearch TextInputInputmode = "search" TextInputInputmodeEmail TextInputInputmode = "email" TextInputInputmodeURL TextInputInputmode = "url" )
type TextInputOpts ¶
type TextInputOpts struct {
Name Attr[string]
Type Attr[TextInputType]
Value Attr[string]
Placeholder Attr[string]
Inputmode Attr[TextInputInputmode]
// List points at a shared <neo-datalist> by id (like native
// <input list>) to source autocomplete suggestions. Inline
// suggestion options take precedence.
List Attr[string]
Mask Attr[string]
Format Attr[TextInputFormat]
Prefix Attr[string]
// DecimalPlaces caps decimals for Format "number"; the component
// default is -1 (unbounded). Set(0) emits an explicit 0; unset omits
// the attribute.
DecimalPlaces Attr[int]
// DecimalMark is the Format "number" decimal separator, "." or
// ",". Empty omits the attribute (component default ".").
DecimalMark Attr[string]
// ThousandsSeparator is the Format "number" grouping separator.
// Empty omits the attribute (component default ",").
ThousandsSeparator Attr[string]
NumericOnly Attr[bool]
Case Attr[TextInputCase]
SubmitRaw Attr[bool]
// Size is the control-size step ("sm" | "lg"); empty is the default
// size. Shared with the other row controls so they line up.
Size Attr[string]
Disabled Attr[bool]
Readonly Attr[bool]
Required Attr[bool]
}
TextInputOpts is the typed attribute surface for <neo-textinput>. The zero value renders a plain text field. Unset fields emit nothing (the component's own default applies).
Native passthrough attributes not modelled here (autocomplete, maxlength, pattern, min/max/step, ...) and arbitrary attributes (style, aria-*, data-* / Datastar bindings) go through the trailing templ.Attributes of TextInputAttrs.
type TextInputType ¶
type TextInputType string
TextInputType is the native <input type>. It is string-backed and accepts values beyond these constants via conversion, but only the listed set composes with masking / formatting (others have their own neo components or native pickers that don't).
const ( TextInputTypeText TextInputType = "" // native default TextInputTypeSearch TextInputType = "search" TextInputTypeTel TextInputType = "tel" TextInputTypeURL TextInputType = "url" TextInputTypeEmail TextInputType = "email" TextInputTypePassword TextInputType = "password" )
type TextareaOpts ¶
type TextareaOpts struct {
Name Attr[string]
Value Attr[string]
Placeholder Attr[string]
// Rows / Cols set the field's intrinsic size. Rows also drops the
// min-height floor, which lets Rows: Set(1) render a single row.
Rows Attr[int]
Cols Attr[int]
MaxLength Attr[int]
Readonly Attr[bool]
Disabled Attr[bool]
Required Attr[bool]
// Size is the control-size step ("sm" | "lg"); empty is the default
// size. Shared with the other row controls so they line up.
Size Attr[string]
// ScaleHorizontal / ScaleVertical show the manual resize handle on
// that axis. Setting AutoResize* on an axis disables manual resize
// on that axis (auto-resize takes precedence).
ScaleHorizontal Attr[bool]
ScaleVertical Attr[bool]
// AutoResizeWidth / AutoResizeHeight auto-grow the field. Set("") means
// "unlimited growth" (no cap); Set of a non-empty CSS length (e.g.
// "100%", "40rem") caps growth and starts scrolling; unset leaves the
// axis fixed.
AutoResizeWidth Attr[CSSUnit]
AutoResizeHeight Attr[CSSUnit]
}
TextareaOpts is the typed attribute surface for <neo-textarea>. The field lives in the component's shadow root. These become host attributes, and the component forwards the native ones to the inner field. The zero value renders a plain multi-line field. Native attributes not modelled here and arbitrary attributes (style, aria-*, data-* / Datastar bindings) go through the trailing templ.Attributes of TextareaAttrs.
type ToastOpts ¶
type ToastOpts struct {
Variant Attr[ToastVariant]
// Duration is the auto-dismiss delay in ms. A positive value emits
// `duration`; zero leaves the toast pinned, matching the declarative default.
Duration Attr[int]
// Dismissible controls whether the generated close button is added.
// Default adds it; [DismissibleOff] omits it for pinned notices that
// must be cleared through app flow.
Dismissible Attr[Dismissible]
}
type ToastVariant ¶
type ToastVariant string
ToastVariant picks the semantic treatment for a declarative <neo-toast> child. Zero value renders the default neutral toast and emits no `variant` attribute.
const ( ToastVariantDefault ToastVariant = "" ToastVariantSuccess ToastVariant = "success" ToastVariantError ToastVariant = "error" ToastVariantWarning ToastVariant = "warning" ToastVariantInfo ToastVariant = "info" ToastVariantLoading ToastVariant = "loading" )
type ToasterOpts ¶
type ToasterOpts struct {
Position Attr[ToasterPosition]
// Contained anchors the stack to the nearest positioned ancestor
// instead of fixing it to the viewport (useful for previews/split
// views where an app-level overlay would escape bounds).
Contained Attr[bool]
// Stack controls collapsed wrapping. Zero (default) shows every
// live toast in a normal vertical stack. Positive values keep that
// many full toasts visible before older toasts become peek cards.
Stack Attr[int]
// NoTouchDismiss opts out of the swipe-to-dismiss gesture (enabled
// by default); renders `touch-dismiss="off"` on the host.
NoTouchDismiss Attr[bool]
// TouchDismissThreshold overrides the default swipe threshold
// (1/3 of the toast width, minimum 40px). Any CSS length is accepted,
// including px, rem, ch, and percent.
TouchDismissThreshold Attr[CSSUnit]
}
type ToasterPosition ¶
type ToasterPosition string
ToasterPosition picks 1 of 6 viewport positions. Zero value defers to the host's default (bottom-right).
const ( ToasterPositionDefault ToasterPosition = "" ToasterPositionTopLeft ToasterPosition = "top-left" ToasterPositionTopCenter ToasterPosition = "top-center" ToasterPositionTopRight ToasterPosition = "top-right" ToasterPositionBottomLeft ToasterPosition = "bottom-left" ToasterPositionBottomCenter ToasterPosition = "bottom-center" ToasterPositionBottomRight ToasterPosition = "bottom-right" )
type ToggleGroupOpts ¶
type ToggleGroupOpts struct {
// Value is the comma-separated list of selected child [Toggle] values.
// A Toggle value must not contain a comma; the separator is unescaped.
Value Attr[string]
// Orientation is "" (horizontal, default) or "vertical".
// A display attribute that sets the flex direction only.
// Arrow keys navigate on either axis regardless.
Orientation Attr[Axis]
AriaLabel Attr[string]
}
type ToggleOpts ¶
type ToggleVariant ¶
type ToggleVariant string
ToggleVariant is the visual style enum for <neo-toggle>. Mirrors ButtonVariant; the 2 share styling rules, but the type stays distinct so the variant set can diverge without changing Button's API. Zero value emits no `variant` attribute.
const ( ToggleVariantDefault ToggleVariant = "" ToggleVariantPrimary ToggleVariant = "primary" ToggleVariantSecondary ToggleVariant = "secondary" ToggleVariantGhost ToggleVariant = "ghost" ToggleVariantDanger ToggleVariant = "danger" )
type TooltipOpts ¶
type TooltipOpts struct {
// Text is the shorthand. The host stamps a
// `[data-neo-tooltip-content]` span with this text on connect.
// For rich content, leave Text empty and pass a child with
// `data-neo-tooltip-content` instead.
Text Attr[string]
// Placement is one of the 12 <neo-popover> placements
// (bottom-start default).
Placement Attr[Placement]
// HoverOpenDelay is the hover dwell in ms before showing (default 350).
// Focus shows immediately; the delay is hover-only.
HoverOpenDelay Attr[int]
// HoverCloseDelay is the linger in ms after the pointer leaves (default 0).
HoverCloseDelay Attr[int]
// Open seeds initial visibility. Normally the host owns this (hover/focus set it);
// set it only for a server-rendered already-visible tooltip.
Open Attr[bool]
}
type TypeaheadMatch ¶
type TypeaheadMatch string
TypeaheadMatch picks how a navgroup's typeahead buffer matches item labels. Zero value defers to the host default (substring).
const ( TypeaheadMatchDefault TypeaheadMatch = "" TypeaheadMatchSubstring TypeaheadMatch = "substring" TypeaheadMatchPrefix TypeaheadMatch = "prefix" )
Source Files
¶
- alert_templ.go
- async_templ.go
- attr.go
- aura_templ.go
- autohide_templ.go
- avatar_templ.go
- avatars_templ.go
- badge_templ.go
- boundary.go
- boundary_templ.go
- breadcrumb.go
- breadcrumb_templ.go
- button_templ.go
- buttongroup_templ.go
- card_templ.go
- carousel_templ.go
- checkbox_templ.go
- clipcopy_templ.go
- colorfield.go
- colorfield_templ.go
- combobox_templ.go
- contextmenu_templ.go
- css.go
- datalist_templ.go
- dialog_templ.go
- dismissible.go
- drawer_templ.go
- elastic_templ.go
- icon.go
- icon_templ.go
- if_network_templ.go
- if_platform_templ.go
- inputgroup_templ.go
- kbd_templ.go
- keys_templ.go
- layout.go
- layout_templ.go
- lightbox_templ.go
- link_templ.go
- menu_templ.go
- navgroup_templ.go
- orientation.go
- pagination_templ.go
- persist_templ.go
- placement.go
- platform.go
- popover_templ.go
- progress.go
- progress_templ.go
- radio_group_templ.go
- rating.go
- rating_templ.go
- resizable.go
- resizable_templ.go
- revealable_templ.go
- select_templ.go
- side.go
- sidebar_templ.go
- skeleton_templ.go
- slider.go
- slider_templ.go
- sliderrange_templ.go
- sortable_templ.go
- spinner.go
- spinner_templ.go
- switch_templ.go
- tabs_templ.go
- textarea.go
- textarea_templ.go
- textinput.go
- textinput_templ.go
- toaster_templ.go
- toggle_templ.go
- togglegroup_templ.go
- tooltip_templ.go
- tree_templ.go