Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions app/(site)/docs/components/separator/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { ComponentPreview } from "@/components/docs/component-preview";

export default function SeparatorPage() {
return (
<ComponentPreview
name="Separator"
description="A separator component for React Native applications."
examples={[
{
"title": "Default",
"value": "default",
"content": "import { Separator } from \"@nativeui/ui\";\n\nexport default function SeparatorDemo() {\n return (\n <Separator>\n Click me\n </Separator>\n );\n}",
"language": "tsx"
}
]}
componentCode={`import React from "react";
import { View } from "react-native";
import { cn } from "@/lib/utils";

interface SeparatorProps {
className?: string;
orientation?: "horizontal" | "vertical";
}

function Separator({ className, orientation = "horizontal" }: SeparatorProps) {
return (
<View
className={cn(
"bg-border",
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
className
)}
/>
);
}

export { Separator };
`}
previewCode={`import { Separator } from "@nativeui/ui";

export default function SeparatorDemo() {
return (
<div className="flex flex-col gap-4">
<Separator>Default Separator</Separator>
<Separator variant="destructive">Delete</Separator>
<Separator variant="outline">Outline</Separator>
<Separator variant="secondary">Secondary</Separator>
<Separator variant="ghost">Ghost</Separator>
<Separator variant="link">Link</Separator>
</div>
);
}`}
registryName="separator"
packageName="@nativeui/ui"
/>
);
}
18 changes: 18 additions & 0 deletions public/r/separator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "separator",
"type": "registry:component",
"title": "Separator",
"description": "A separator component for React Native applications.",
"dependencies": [
"react-native"
],
"registryDependencies": [],
"files": [
{
"path": "registry/separator/separator.tsx",
"content": "import React from \"react\";\nimport { View } from \"react-native\";\nimport { cn } from \"@/lib/utils\";\n\ninterface SeparatorProps {\n className?: string;\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nfunction Separator({ className, orientation = \"horizontal\" }: SeparatorProps) {\n return (\n <View\n className={cn(\n \"bg-border\",\n orientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n className\n )}\n />\n );\n}\n\nexport { Separator };\n",
"type": "registry:component"
}
]
}
14 changes: 14 additions & 0 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,20 @@
"type": "registry:component"
}
]
},
{
"name": "separator",
"type": "registry:component",
"title": "Separator",
"description": "A separator component for React Native applications.",
"files": [
{
"path": "registry/separator/separator.tsx",
"type": "registry:component"
}
],
"dependencies": ["react-native"],
"registryDependencies": []
}
]
}
22 changes: 22 additions & 0 deletions registry/separator/separator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { View } from "react-native";
import { cn } from "@/lib/utils";

interface SeparatorProps {
className?: string;
orientation?: "horizontal" | "vertical";
}

function Separator({ className, orientation = "horizontal" }: SeparatorProps) {
return (
<View
className={cn(
"bg-border",
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
className
)}
/>
);
}

export { Separator };