Components Layout

Separator

Draw a quiet boundary between neighboring groups of content.

Live previewGo + HTML

Usage

Use a horizontal separator between sections. Set Vertical to true for an inline divider and specify its height in your own layout. Set Decorative to true to hide a purely visual rule from assistive technology.

Register separator with Head and pass its properties to Render. Go setup guide

Go usage
Go usage
err := mono.UI.Render(w, "separator", mono.Props{
	"Decorative": false,
	"Vertical":   false,
})
Rendered HTML
Rendered HTML
<span data-mono="separator" id="demo-separator" role="separator" aria-orientation="horizontal" data-direction="horizontal"></span>
Go template
Go template
<span data-mono="separator" id="{{.ID}}" {{if .Decorative}}aria-hidden="true"{{else}}role="separator" aria-orientation="{{if .Vertical}}vertical{{else}}horizontal{{end}}"{{end}} data-direction="{{if .Vertical}}vertical{{else}}horizontal{{end}}"></span>
Component CSS
Component CSS
[data-mono="separator"] { display:block; width:100%; height:1px; background:currentColor; opacity:.32; }
[data-mono="separator"][data-direction="vertical"] { display:inline-block; width:1px; height:1.5rem; vertical-align:middle; }
Use the HTML in a static site

Copy the rendered HTML above. Download these assets into the same folder as your page, then add the tags below to its head.

Shared CSS Component CSS

HTML head
<link rel="stylesheet" href="./base.css">
<link rel="stylesheet" href="./separator.css">

Copy into your project

Run this command from the Mono checkout. Set -out to the component directory in your application.

Terminal
go run ./cmd/mono-ui add -out ./components separator
Example properties (JSON)
example.json
{
  "Decorative": false,
  "Vertical": false
}