Separator
Separator primitive
Install
npx ui8kit add separatorPulls in: kit-separator, recipes, utils
Preview
Code
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add separatorcompose/Separator.svelte
<!-- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. -->
<!-- Separator: Separator + recipe separator. -->
<script lang="ts">
import type { ComponentProps, Snippet } from "svelte";
import Prim from "../kit/ui/separator/Separator.svelte";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
let { "orientation": v_orientation, "variant": v_variant, class: className, children, ...rest }: ComponentProps<typeof Prim> & { "orientation"?: string | number; "variant"?: string | number; class?: string; children?: Snippet } = $props();
const cls = $derived(cn(rc("separator", { "orientation": v_orientation, "variant": v_variant }), className));
</script>
<Prim class={cls} {...rest} />
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdnnpx ui8kit add separatorcompose/separator.tsx
// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
import type { ComponentProps } from "react";
import { Separator as Prim } from "../kit/ui/separator/separator";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
export type SeparatorProps = Omit<ComponentProps<typeof Prim>, "tag" | "orientation" | "variant"> & { "orientation"?: string | number; "variant"?: string | number; className?: string };
/** Separator: Separator + recipe separator. */
export function Separator({ "orientation": v_orientation, "variant": v_variant, className, ...rest }: SeparatorProps) {
return <Prim className={cn(rc("separator", { "orientation": v_orientation, "variant": v_variant }), className)} {...rest} />;
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdnnpx ui8kit add separatorcompose/Separator.vue
<!-- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. -->
<!-- Separator: Separator + recipe separator. -->
<script setup lang="ts">
import { computed, useAttrs } from "vue";
import Prim from "../kit/ui/separator/Separator.vue";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
defineOptions({ name: "Separator", inheritAttrs: false });
const props = defineProps<{ "orientation"?: string | number; "variant"?: string | number }>();
const attrs = useAttrs();
const rest = computed(() => {
const { class: _class, ...r } = attrs;
return r;
});
const cls = computed(() => cn(rc("separator", { "orientation": props["orientation"], "variant": props["variant"] }), attrs.class as string | undefined));
const tagValue = computed(() => "");
</script>
<template>
<Prim :class="cls" v-bind="rest" />
</template>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdnnpx ui8kit add separatorcompose/separator.solid.tsx
// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
import { splitProps, type ComponentProps } from "solid-js";
import { Separator as Prim } from "../kit/ui/separator/separator.solid";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
export type SeparatorProps = Omit<ComponentProps<typeof Prim>, "tag" | "class" | "className" | "orientation" | "variant"> & { "orientation"?: string | number; "variant"?: string | number; class?: string; className?: string };
/** Separator: Separator + recipe separator. */
export function Separator(props: SeparatorProps) {
const [local, rest] = splitProps(props, ["orientation", "variant", "class", "className"]);
return <Prim class={cn(rc("separator", { "orientation": local["orientation"], "variant": local["variant"] }), local.class ?? local.className)} {...rest} />;
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdnnpx ui8kit add separatorcompose/separator.templ
// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
package compose
import "github.com/ui8kit/codegen/generated/templ/ui/separator"
// SeparatorProps: Separator: Separator + recipe separator.
type SeparatorProps struct {
Orientation string
Variant string
separator.SeparatorProps
}
func separatorInner(p SeparatorProps) separator.SeparatorProps {
in := p.SeparatorProps
in.Class = Join(Rc("separator", map[string]string{"orientation": p.Orientation, "variant": p.Variant}), p.SeparatorProps.Class)
return in
}
// Separator renders Separator with the composition classes.
templ Separator(p SeparatorProps) {
@separator.Separator(separatorInner(p))
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdnnpx ui8kit add separatorcompose/Separator.html.twig
{# Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. #}
{# Separator: Separator + recipe separator. Params: orientation, variant, class, attrs + the params of Separator. #}
{% include 'ui/separator/Separator.html.twig' with compose_props('Separator', _context) only %}Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdnnpx ui8kit add separatorcompose/Separator.latte
{* Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. *}
{* Separator: Separator + recipe separator. *}
{parameters
string $class = '',
bool $decorative = false,
array $attrs = [],
$orientation = null,
$variant = null,
}
{include '../ui/separator/Separator.latte', ...[...\CodegenX\Compose\Latte\Compose::props('Separator', ['class' => $class, 'decorative' => $decorative, 'attrs' => $attrs, 'orientation' => $orientation, 'variant' => $variant]), 'orientation' => '']}Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdnnpx ui8kit add separatorcompose/separator.html.j2
{#- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
Separator: Separator + recipe separator. Props (p): Orientation, Variant, Class, Attrs + the props of Separator. -#}
{%- with p = compose_props('Separator', p) %}{% include 'ui/separator/separator.html.j2' %}{% endwith %}Props
Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.
Separator renders a void hr; no children.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | string | - | horizontal (default) | vertical |
| decorative | boolean | - | purely visual: role=none, no separator semantics |