Getting Started
快速开始

Start with asset registration, a standard page shell, and a small body composed from Paw primitives. This is the baseline pattern the rest of the docs build on.

从资源注册、标准页面壳,以及由 Paw 原语组成的小型页面主体开始。这是其余文档页面共同依赖的基础模式。
paw.PathAssetspaw.NewAssetsHttpHandler()paw.RenderHeader()paw.Containerpaw.RenderDefaultFooter()
Covered APIs
涵盖 API
API
接口
Description
说明
PathAssets + NewAssetsHttpHandler()
Serve Paw's embedded CSS, JavaScript, icons, and third-party assets.
为 Paw 内置的 CSS、JavaScript、图标和第三方资源提供静态服务。
RenderHeader + RenderDefaultFooter()
Wrap every page with the default document shell and bundled scripts.
用默认文档壳和内置脚本包裹每个页面。
Container
Put your app body inside the default responsive container.
把应用主体放进默认的响应式容器里。
Minimal Example: A first Paw page
最小示例:第一个 Paw 页面

Register the asset handler once, then render a normal http handler with a Paw header, container, and footer.

先注册一次资源处理器,然后在普通 http handler 里输出 Paw 页头、容器和页脚。
Hello Paw
你好 Paw

This body is just normal Paw UI rendered inside a standard page shell.

这里的内容只是放在标准页面壳中的普通 Paw UI。

Next: Page Shell and Assets


http.HandleFunc(paw.PathAssets, paw.NewAssetsHttpHandler())

func renderPage(w http.ResponseWriter, title string, body paw.Ui) {
	paw.RenderHeader(paw.HeaderConfig{
		Wr:    w,
		Title: title,
	})
	if err := (paw.Container{Body: body}).Render(w); err != nil {
		panic(err)
	}
	paw.RenderDefaultFooter(w)
}
Advanced Example: Layer in structure early
进阶示例:尽早建立页面结构

Once the shell is in place, keep adding higher-level layout pieces instead of dropping to raw HTML.

页面壳就位后,优先继续组合更高层的布局组件,而不是回退到原始 HTML。
Guide
指南

Start with the shell, then compose your body from panels, rows, and forms.

先搭好页面壳,再用面板、行布局和表单来拼出页面主体。
Reference
参考

Use the canonical docs pages as a map of the public API.

把这些 canonical docs 页面当成公开 API 的地图来查阅。

Open Layout and Navigation


body := paw.List{
	paw.H1("Users"),
	paw.Row{
		ColumnMax: 2,
		Columns: paw.List{
			paw.Panel{Title: paw.String("List"), Body: paw.String("...")},
			paw.Panel{Title: paw.String("Actions"), Body: paw.String("...")},
		},
	},
}
renderPage(w, "Users", body)
Notes and Related Docs
说明与相关文档

Notes

说明

Paw only renders HTML. Routing, data loading, validation, and persistence still live in your application code.

Paw 只负责渲染 HTML。路由、数据加载、校验和持久化仍然由你的应用代码负责。

Use the default header and footer unless you intentionally want to replace Paw's bundled assets and script wiring.

除非你明确要替换 Paw 的内置资源和脚本接线,否则优先使用默认页头和页脚。

Related Pages

相关页面
Page Shell and Assets
页面壳与静态资源
Serve bundled assets and wrap each page with the default Paw header and footer.
为 Paw 内置资源提供服务,并用默认页头页脚包裹每个页面。
Layout and Navigation
布局与导航
Compose responsive layouts, links, navigation, and progressive disclosure patterns.
组合响应式布局、链接、导航以及渐进展示类交互。
Forms Generated
生成式表单
Generate forms from structs, override field options, and convert submitted values back into models.
从结构体生成表单、覆盖字段选项,并把提交值转换回模型。
Source and References
源码与参考资料