site

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ComponentGroups = []NavGroup{
	{"Action", []NavLink{
		{href.PageButton(), "Button", "component-button"},
		{href.PageButtonGroup(), "Button group", "component-button-group"},
		{href.PageClipcopy(), "Clipcopy", "component-clipcopy"},
		{href.PageContextMenu(), "Context menu", "component-context-menu"},
		{href.PageLink(), "Link", "component-link"},
		{href.PageMenu(), "Menu", "component-menu"},
	}},
	{"Input", []NavLink{
		{href.PageCheckbox(), "Checkbox", "component-checkbox"},
		{href.PageColorField(), "Color field", "component-color-field"},
		{href.PageCombobox(), "Combobox", "component-combobox"},
		{href.PageInputGroup(), "Input group", "component-input-group"},
		{href.PageOTP(), "OTP", "component-otp"},
		{href.PageRadioGroup(), "Radio group", "component-radio-group"},
		{href.PageRating(), "Rating", "component-rating"},
		{href.PageSelect(), "Select", "component-select"},
		{href.PageSlider(), "Slider", "component-slider"},
		{href.PageSliderRange(), "Slider range", "component-slider-range"},
		{href.PageSwitch(), "Switch", "component-switch"},
		{href.PageTextInput(), "Text input", "component-text-input"},
		{href.PageTextarea(), "Textarea", "component-textarea"},
		{href.PageToggle(), "Toggle", "component-toggle"},
		{href.PageToggleGroup(), "Toggle group", "component-toggle-group"},
	}},
	{"Data", []NavLink{
		{href.PageDatalist(), "Datalist", "component-datalist"},
		{href.PageOptgroup(), "Optgroup", "component-optgroup"},
		{href.PageOption(), "Option", "component-option"},
	}},
	{"Navigation", []NavLink{
		{href.PageBreadcrumb(), "Breadcrumb", "component-breadcrumb"},
		{href.PageCarousel(), "Carousel", "component-carousel"},
		{href.PagePagination(), "Pagination", "component-pagination"},
		{href.PageSidebar(), "Sidebar", "component-sidebar"},
		{href.PageTabs(), "Tabs", "component-tabs"},
		{href.PageTree(), "Tree", "component-tree"},
	}},
	{"Overlay", []NavLink{
		{href.PageDialog(), "Dialog", "component-dialog"},
		{href.PageDrawer(), "Drawer", "component-drawer"},
		{href.PageLightbox(), "Lightbox", "component-lightbox"},
		{href.PagePopover(), "Popover", "component-popover"},
		{href.PageTooltip(), "Tooltip", "component-tooltip"},
	}},
	{"Feedback", []NavLink{
		{href.PageAlert(), "Alert", "component-alert"},
		{href.PageProgress(), "Progress", "component-progress"},
		{href.PageSkeleton(), "Skeleton", "component-skeleton"},
		{href.PageSpinner(), "Spinner", "component-spinner"},
		{href.PageToaster(), "Toaster", "component-toaster"},
	}},
	{"Display", []NavLink{
		{href.PageAura(), "Aura", "component-aura"},
		{href.PageAvatar(), "Avatar", "component-avatar"},
		{href.PageAvatars(), "Avatars", "component-avatars"},
		{href.PageBadge(), "Badge", "component-badge"},
		{href.PageCompare(), "Compare", "component-compare"},
		{href.PageIcon(), "Icon", "component-icon"},
		{href.PageKbd(), "Kbd", "component-kbd"},
		{href.PageOdometer(), "Odometer", "component-odometer"},
		{href.PageRevealable(), "Revealable", "component-revealable"},
	}},
	{"Layout", []NavLink{
		{href.PageAutohide(), "Autohide", "component-autohide"},
		{href.PageCard(), "Card", "component-card"},
		{href.PageElastic(), "Elastic", "component-elastic"},
		{href.PageLayout(), "Layout", "component-layout"},
		{href.PageResizable(), "Resizable", "component-resizable"},
		{href.PageSortable(), "Sortable", "component-sortable"},
	}},
	{"Utility", []NavLink{
		{href.PageBoundary(), "Boundary", "component-boundary"},
		{href.PageIfNetwork(), "If network", "component-if-network"},
		{href.PageIfPlatform(), "If platform", "component-if-platform"},
		{href.PageKeys(), "Keys", "component-keys"},
		{href.PageNavgroup(), "Navgroup", "component-navgroup"},
		{href.PagePersist(), "Persist", "component-persist"},
	}},
}

ComponentGroups lists every component page by the task it serves, in sidebar order. Each page is in exactly 1 group, and each group is alphabetical. Adding a <neo-X> page takes 2 steps:

  1. Create page_X.go + page_X.templ that follow the existing pattern (`Page<Name>` struct + `pageX()` template wrapped in `@appLayout("/x")`).
  2. Add the entry to its group here so the sidebar surfaces it, and draw its icon as static/icons/component-x.svg (36x24, stroke 1.5) and static/icons-matrix/component-x.svg (18x12 pixel grid). The part the component adds is full color. Its frame, context and content are at opacity .4. Put frames on the keylines the other icons share, e.g. the wide field 2.25-33.75 x 5.25-18.75 of component-select.svg.
View Source
var DocLinks = []NavLink{
	{href.PageGettingStarted(), "Getting started", "rocket"},
	{href.PageFrameworks(), "Frameworks", "code"},
	{href.PageTheming(), "Theming", "sparkles"},
	{href.PageServerDriven(), "Server-driven architecture", "arrow-left-right"},
	{href.PageProjectStatus(), "Status & Contribution", "sprout"},
}

DocLinks are the guide pages under the sidebar's Documentation heading.

View Source
var LazyTreeData = []LazyNode{
	{Path: "src", Label: "src", Children: []LazyNode{
		{Path: "src/components", Label: "components", Children: []LazyNode{
			{Path: "src/components/Button.tsx", Label: "Button.tsx"},
			{Path: "src/components/Card.tsx", Label: "Card.tsx"},
			{Path: "src/components/Modal.tsx", Label: "Modal.tsx"},
		}},
		{Path: "src/hooks", Label: "hooks", Children: []LazyNode{
			{Path: "src/hooks/useDebounce.ts", Label: "useDebounce.ts"},
			{Path: "src/hooks/useMediaQuery.ts", Label: "useMediaQuery.ts"},
		}},
		{Path: "src/App.tsx", Label: "App.tsx"},
	}},
	{Path: "docs", Label: "docs", Children: []LazyNode{
		{Path: "docs/intro.md", Label: "intro.md"},
		{Path: "docs/guide", Label: "guide", Children: []LazyNode{
			{Path: "docs/guide/setup.md", Label: "setup.md"},
			{Path: "docs/guide/usage.md", Label: "usage.md"},
		}},
		{Path: "docs/api.md", Label: "api.md"},
	}},
	{Path: "tests", Label: "tests", Children: []LazyNode{
		{Path: "tests/unit", Label: "unit", Children: []LazyNode{
			{Path: "tests/unit/parser.test.ts", Label: "parser.test.ts"},
			{Path: "tests/unit/router.test.ts", Label: "router.test.ts"},
		}},
		{Path: "tests/integration.test.ts", Label: "integration.test.ts"},
	}},
}
View Source
var ToolLinks = []NavLink{
	{href.PageBundleBuilder(), "Bundle builder", "download"},
}

ToolLinks are the pages under the sidebar's Tools heading.

Functions

func ComponentDocs

func ComponentDocs(doc ComponentDoc) templ.Component
func ComponentLink(tagName, url string) templ.Component
func EventLink(name, url string) templ.Component

func LandingPage

func LandingPage() templ.Component

LandingPage is the bare marketing-style shell, with the same head as Page but no sidebar frame, breadcrumb header, or settings panel.

func Page

func Page(currentPath, title, morpheusVersion string) templ.Component

func PageAlert

func PageAlert(morpheusVersion string) templ.Component

func PageAura added in v0.2.0

func PageAura(morpheusVersion string) templ.Component

func PageAutohide added in v0.4.0

func PageAutohide(morpheusVersion string) templ.Component

func PageAvatar

func PageAvatar(morpheusVersion string) templ.Component

func PageAvatars

func PageAvatars(morpheusVersion string) templ.Component

func PageBadge

func PageBadge(morpheusVersion string) templ.Component

func PageBoundary

func PageBoundary(morpheusVersion string) templ.Component
func PageBreadcrumb(morpheusVersion string) templ.Component

func PageBundleBuilder

func PageBundleBuilder(morpheusVersion string, versions []BundleVersion) templ.Component

func PageButton

func PageButton(morpheusVersion string) templ.Component

func PageButtonGroup

func PageButtonGroup(morpheusVersion string) templ.Component

func PageCard

func PageCard(morpheusVersion string) templ.Component

func PageCarousel

func PageCarousel(morpheusVersion string) templ.Component

func PageCheckbox

func PageCheckbox(morpheusVersion string) templ.Component

func PageClipcopy

func PageClipcopy(morpheusVersion string) templ.Component

func PageColorField

func PageColorField(morpheusVersion string) templ.Component

func PageCombobox

func PageCombobox(morpheusVersion string) templ.Component

func PageCompare added in v0.6.0

func PageCompare(morpheusVersion string) templ.Component

func PageComponents

func PageComponents(morpheusVersion string) templ.Component

func PageContextMenu

func PageContextMenu(morpheusVersion string) templ.Component

func PageDatalist

func PageDatalist(morpheusVersion string) templ.Component

func PageDebug

func PageDebug(morpheusVersion string) templ.Component

PageDebug renders the hidden /debug/ harness, a full-page fat morph every 2s. Verifies popover-hosted components stay open + keep focus across morph cycles. Simulator + injected trigger carry data-ignore-morph so they survive each patch. Not linked from navigation.

func PageDebugBorders

func PageDebugBorders(morpheusVersion string) templ.Component

PageDebugBorders renders the hidden /debug-borders/ harness for visually auditing border width/color consistency across every bordered control, standalone and composed inside input groups. Custom top bar flips theme, color mode, and high contrast so the same grid can be compared across every combination. Not linked from navigation.

func PageDialog

func PageDialog(morpheusVersion string) templ.Component

func PageDoc

func PageDoc(currentPath, title, morpheusVersion string) templ.Component

PageDoc wraps Page with the docs-specific frame so a single edit applies to every doc page. Non-doc shells (LandingPage, ...) use Page directly.

func PageDrawer

func PageDrawer(morpheusVersion string) templ.Component

func PageElastic

func PageElastic(morpheusVersion string) templ.Component

func PageFrameworks

func PageFrameworks(morpheusVersion string) templ.Component

func PageGettingStarted

func PageGettingStarted(morpheusVersion string) templ.Component

func PageIcon

func PageIcon(morpheusVersion string) templ.Component

func PageIfNetwork added in v0.2.0

func PageIfNetwork(morpheusVersion string) templ.Component

func PageIfPlatform added in v0.2.0

func PageIfPlatform(morpheusVersion string) templ.Component

func PageIndex

func PageIndex(morpheusVersion string) templ.Component

func PageInputGroup

func PageInputGroup(morpheusVersion string) templ.Component

func PageKbd

func PageKbd(morpheusVersion string) templ.Component

func PageKeys

func PageKeys(morpheusVersion string) templ.Component

func PageLayout

func PageLayout(morpheusVersion string) templ.Component

func PageLightbox

func PageLightbox(morpheusVersion string) templ.Component
func PageLink(morpheusVersion string) templ.Component
func PageMenu(morpheusVersion string) templ.Component
func PageNavgroup(morpheusVersion string) templ.Component

func PageOTP added in v0.5.0

func PageOTP(morpheusVersion string) templ.Component

func PageOdometer added in v0.5.0

func PageOdometer(morpheusVersion string) templ.Component

func PageOptgroup

func PageOptgroup(morpheusVersion string) templ.Component

func PageOption

func PageOption(morpheusVersion string) templ.Component

func PagePagination

func PagePagination(morpheusVersion string) templ.Component

func PagePersist

func PagePersist(morpheusVersion string) templ.Component

func PagePopover

func PagePopover(morpheusVersion string) templ.Component

func PageProgress

func PageProgress(morpheusVersion string) templ.Component

func PageProjectStatus

func PageProjectStatus(morpheusVersion string) templ.Component

func PageRadioGroup

func PageRadioGroup(morpheusVersion string) templ.Component

func PageRating

func PageRating(morpheusVersion string) templ.Component

func PageResizable

func PageResizable(morpheusVersion string) templ.Component

func PageRevealable

func PageRevealable(morpheusVersion string) templ.Component

func PageSelect

func PageSelect(morpheusVersion string) templ.Component

func PageServerDriven

func PageServerDriven(morpheusVersion string) templ.Component

func PageSidebar

func PageSidebar(morpheusVersion string) templ.Component

func PageSkeleton

func PageSkeleton(morpheusVersion string) templ.Component

func PageSlider

func PageSlider(morpheusVersion string) templ.Component

func PageSliderRange

func PageSliderRange(morpheusVersion string) templ.Component

func PageSortable

func PageSortable(morpheusVersion string) templ.Component

func PageSpinner

func PageSpinner(morpheusVersion string) templ.Component

func PageSwitch

func PageSwitch(morpheusVersion string) templ.Component

func PageTabs

func PageTabs(morpheusVersion string) templ.Component

func PageTextInput

func PageTextInput(morpheusVersion string) templ.Component

func PageTextarea

func PageTextarea(morpheusVersion string) templ.Component

func PageTheming

func PageTheming(morpheusVersion string) templ.Component

func PageToaster

func PageToaster(morpheusVersion string) templ.Component

func PageToggle

func PageToggle(morpheusVersion string) templ.Component

func PageToggleGroup

func PageToggleGroup(morpheusVersion string) templ.Component

func PageTooltip

func PageTooltip(morpheusVersion string) templ.Component

func PageTree

func PageTree(morpheusVersion string) templ.Component

func Playground

func Playground(opts PlaygroundOpts) templ.Component

Playground renders the reusable component-doc playground shell. State templates are trusted docs source and become editable in-page.

func SetInlineThemeDefaultCSS

func SetInlineThemeDefaultCSS(css string)

SetInlineThemeDefaultCSS sets the CSS [pageHead] inlines in place of the theme-default.css <link>. internal/cmd/gen calls it with the built min/theme-default.css before rendering pages.

func W3CEventURL

func W3CEventURL(name string) string

Types

type Assignee

type Assignee struct {
	ID, Name string
}

type BoundaryScopes

type BoundaryScopes struct {
	NoDismiss     bool
	NoPositioning bool
	Scroll        bool
	Stacking      bool
}

BoundaryScopes tunes the <neo-boundary> scopes on a preview region. The zero value keeps the default scopes (dismiss + positioning) and renders no attribute. Any non-zero field renders an explicit scope="..." token list. NoDismiss / NoPositioning drop a default scope, Scroll / Stacking add an opt-in one. See the Boundary page.

type BundleVersion added in v0.2.0

type BundleVersion struct {
	Name   string   `json:"name"`
	Absent []string `json:"absent,omitempty"`
	Themes []string `json:"-"`
}

BundleVersion is a release tag the bundle builder builds, or "main" for the working tree. Absent are the selectable ids it lacks and Themes its bundle.Manifest.Themes. internal/cmd/gen lists the default first, which is the newest release without a pre-release suffix.

type ComponentDoc

type ComponentDoc struct {
	// Prefix namespaces the per-section anchored h3 ids when more than
	// one ComponentDoc renders on the same page (e.g. menu / menuitem /
	// submenu on /menu/). Empty Prefix yields "attributes" / "slots" /
	// "events"; a non-empty Prefix yields "<prefix>-attributes" etc.
	Prefix     string
	Attributes []DocAttribute
	States     []DocState
	Slots      []DocSlot
	Events     []DocEvent
	Parts      []DocPart
	CSSProps   []DocCSSProp
}

type DemoFrameOpts

type DemoFrameOpts struct {
	Width          string
	Height         string
	StageMinHeight string
	StageMaxHeight string
	StageMinWidth  string
	StageMaxWidth  string
	StageClass     string
	StageHandles   neo.ResizableHandles

	// Boundary opts out of individual <neo-boundary> scopes for the
	// stage's overlays (default: all scopes on).
	Boundary BoundaryScopes

	// StageAttrs carries stage attributes no dedicated field covers
	// (e.g. data-attr:width, min-width).
	StageAttrs templ.Attributes

	// HTMLSource / TemplSource non-empty adds source tabs to the footer.
	HTMLSource  string
	TemplSource string
	CSSSource   string

	// TSXSource / TypeScriptSource add React (.tsx) and ambient-types
	// (.ts) tabs, used by the framework-integration pages.
	TSXSource        string
	TypeScriptSource string

	// ScriptSource is typically embedded from the .js module the page
	// also loads at runtime so the tab can't drift from reality.
	ScriptSource string

	// DefaultTab overrides which footer tab opens first (e.g. "tsx").
	// Empty starts the demo collapsed on the "hide" tab.
	DefaultTab string
}

DemoFrameOpts configures demoFrameWith, the wrapper every per-page demo composes around its content.

type DocAttribute

type DocAttribute struct {
	Name    string
	Type    string
	Default string
	// Reflected marks an attribute the component writes back to the DOM
	// as its state changes (internal -> attribute). Observed marks one the
	// component reacts to when changed from outside, e.g. author, morph,
	// or framework binding (attribute -> internal). The flags are independent.
	// An attribute can be both, either, or neither. Each renders a badge in
	// the Type column.
	Reflected   bool
	Observed    bool
	Description templ.Component
}

type DocCSSProp

type DocCSSProp struct {
	Name        string
	Default     string
	Description templ.Component
}

DocCSSProp documents a CSS custom property the component reads. Name is the full property (e.g. "--neo-card-gap"); Default is the fallback value.

type DocEvent

type DocEvent struct {
	Name        string
	URL         string // if set, Name renders as an external link (W3C / MDN)
	Detail      string
	Bubbles     bool
	Description templ.Component
}

type DocPart

type DocPart struct {
	Name        string
	Description templ.Component
}

DocPart documents a shadow ::part() exposed for page CSS. Name is the bare part name; it renders as ::part(<Name>).

type DocSlot

type DocSlot struct {
	Name        string
	Description templ.Component
}

type DocState

type DocState struct {
	Name        string
	Description templ.Component
}

DocState documents a CSS custom state the component sets on itself as its internal state changes. Name is the bare state name; it renders as :state(<Name>). States are not attributes. Nothing outside the component sets them, and a morph cannot strip them.

type LazyNode

type LazyNode struct {
	Path     string     `json:"path"`
	Label    string     `json:"label"`
	Children []LazyNode `json:"children,omitempty"`
}

type Member

type Member struct {
	ID, Name, Title, Avatar string
}
type NavGroup struct {
	Name  string // singular, as in "Input"
	Links []NavLink
}

NavGroup is a titled list of pages in the sidebar, on the components index and in the Mod+K palette. Icon is the sidebar heading's icon and names a file in static/icons and in static/icons-matrix.

func (g NavGroup) Heading() string

Heading is the group's title in the sidebar and on the components index.

type NavLink struct {
	Path  string
	Label string
	Icon  string
}

NavLink is a page in the sidebar, on the components index and in the Mod+K palette. Icon names a file in static/icons and in static/icons-matrix.

type PlaygroundOpts

type PlaygroundOpts struct {
	ID string
	// Height is optional. An empty value tracks preview content until
	// the user resizes the viewport. The playground is always full
	// content width; the preview stage is resizable from its edges.
	Height neo.CSSUnit
	// MinWidth sets the preview stage's minimum width (the resizable's
	// left/right drag lower bound). Empty defaults to "14rem"; raise it for
	// components that need room to stay legible when dragged narrow
	// (e.g. a sidebar shell).
	MinWidth neo.CSSUnit
	States   []PlaygroundState
	// Autoplay starts cycling through enabled states on connect (once in
	// view). Off by default; the user can still opt in via the toolbar.
	Autoplay bool
	// Boundary opts out of individual <neo-boundary> scopes for the
	// preview's overlays (default: all scopes on).
	Boundary BoundaryScopes
}

type PlaygroundState

type PlaygroundState struct {
	Label string
	HTML  string
	// CSS is the state's styling, shown in the editor's CSS tab and
	// applied to the preview wrapped in <style>@scope { ... }</style> so it
	// scopes to the preview subtree only. Empty for states with no styling.
	CSS string
}

Source Files

Directories

Path Synopsis
Package htmlfmt pretty-prints compact HTML for the doc-site source tabs.
Package htmlfmt pretty-prints compact HTML for the doc-site source tabs.

Jump to

Keyboard shortcuts

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