Theme Switcher

Separator

Visually or semantically separates content.

mantle

An open-source UI component library.

Blog
Docs
Source

ngrok mantle

ngrok mantle

ngrok mantle

import { HorizontalSeparatorGroup, Separator } from "@ngrok/mantle/separator";

<div>
	<div className="space-y-1">
		<h4 className="text-sm font-medium leading-none">mantle</h4>
		<p className="text-muted-foreground text-sm">An open-source UI component library.</p>
	</div>
	<Separator className="my-4" />
	<Separator className="my-4" semantic />
	<div className="flex h-5 items-center gap-4 text-sm">
		Blog
		<Separator orientation="vertical" />
		Docs
		<Separator orientation="vertical" />
		Source
	</div>
	<HorizontalSeparatorGroup>
		<Separator />
		<h3>ngrok mantle</h3>
		<Separator />
	</HorizontalSeparatorGroup>
	<HorizontalSeparatorGroup>
		<h3>ngrok mantle</h3>
		<Separator />
	</HorizontalSeparatorGroup>
	<HorizontalSeparatorGroup>
		<Separator />
		<h3>ngrok mantle</h3>
	</HorizontalSeparatorGroup>
</div>

Composition

When you want to render something else as a HorizontalSeparatorGroup or Separator, you can use the asChild prop to compose.

Choose your favorite fruit!
Blog
Docs
Source
import { HorizontalSeparatorGroup, Separator } from "@ngrok/mantle/separator";

<form>
	<fieldset className="space-y-4">
		<HorizontalSeparatorGroup className="w-full" asChild>
			<legend>
				Choose your favorite fruit!
				<Separator asChild>
					<span />
				</Separator>
			</legend>
		</HorizontalSeparatorGroup>

		<div className="space-y-2">
			<div className="space-x-2">
				<input type="radio" id="apple" name="monster" value="apple" />
				<label htmlFor="apple">Apple</label>
			</div>

			<div className="space-x-2">
				<input type="radio" id="mango" name="monster" value="mango" />
				<label htmlFor="mango">Mango</label>
			</div>

			<div className="space-x-2">
				<input type="radio" id="pear" name="monster" value="pear" />
				<label htmlFor="pear">Pear</label>
			</div>
		</div>
	</fieldset>
</form>

<div className="flex h-5 items-center space-x-4 text-sm">
	<div>Blog</div>
	<Separator orientation="vertical" asChild>
		<span />
	</Separator>
	<div>Docs</div>
	<Separator orientation="vertical" asChild>
		<span />
	</Separator>
	<div>Source</div>
</div>

API Reference

Separator

Visually or semantically separates content.

All props from div, plus:

PropTypeDefaultDescription
orientation
  • horizontal
  • vertical
horizontal

The orientation of the separator, does it render horizontally or verticallly.

semantic
booleanfalse

If true, the separator will be rendered with all accessibility-related attributes and role="separator".

If false, the separator is purely decorative and all accessibility-related attributes are updated so that the rendered element is removed from the accessibility tree.

asChild
booleanfalse

Use the asChild prop to compose the Separator styling and functionality onto alternative element types or your own React components.

HorizontalSeparatorGroup

A container to layout a group of horizontal separators and other children.

Overrides all children Separators to be orientation="horizontal".

All props from div, plus:

PropTypeDefaultDescription
asChild
booleanfalse

Use the asChild prop to compose the HorizontalSeparatorGroup styling and functionality onto alternative element types or your own React components.