> ## Documentation Index
> Fetch the complete documentation index at: https://araf.badr.co.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Separator

> A thin horizontal or vertical line for visually dividing content sections — supports decorative and semantic usage.

## Overview

<div style={{padding:"28px 24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb",display:"flex",flexDirection:"column",gap:"20px"}}>
  <div style={{fontFamily:"Inter,sans-serif"}}>
    <div style={{fontSize:"14px",color:"#344054",marginBottom:"12px"}}>Section A</div>

    <div style={{height:"1px",background:"#E5E7EB",width:"100%"}} />

    <div style={{fontSize:"14px",color:"#344054",marginTop:"12px"}}>Section B</div>
  </div>

  <div style={{display:"flex",alignItems:"center",gap:"16px",fontFamily:"Inter,sans-serif"}}>
    <span style={{fontSize:"14px",color:"#344054"}}>Item 1</span>

    <div style={{width:"1px",height:"18px",background:"#E5E7EB"}} />

    <span style={{fontSize:"14px",color:"#344054"}}>Item 2</span>

    <div style={{width:"1px",height:"18px",background:"#E5E7EB"}} />

    <span style={{fontSize:"14px",color:"#344054"}}>Item 3</span>
  </div>
</div>

**Separator** renders a thin `<hr>` or `<div>` line to visually separate content sections. It can be horizontal (default) or vertical, and decorative (hidden from screen readers) or semantic.

***

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @araf-ds/core
  ```

  ```bash yarn theme={null}
  yarn add @araf-ds/core
  ```

  ```bash pnpm theme={null}
  pnpm add @araf-ds/core
  ```
</CodeGroup>

***

## Usage

```tsx theme={null}
import { Separator } from "@araf-ds/core"

export default function Example() {
  return (
    <div>
      <p>Section A</p>
      <Separator />
      <p>Section B</p>
    </div>
  )
}
```

***

## Variants

### Horizontal (Default)

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb",fontFamily:"Inter,sans-serif"}}>
  <div style={{fontSize:"14px",fontWeight:500,color:"#344054",marginBottom:"12px"}}>Typography</div>
  <div style={{fontSize:"13px",color:"#667085",marginBottom:"12px"}}>A collection of font styles used across the design system.</div>

  <div style={{height:"1px",background:"#E5E7EB"}} />

  <div style={{fontSize:"14px",fontWeight:500,color:"#344054",marginTop:"12px"}}>Spacing</div>
  <div style={{fontSize:"13px",color:"#667085",marginTop:"4px"}}>Base-4 spacing scale from 4px to 96px.</div>
</div>

```tsx theme={null}
<div>
  <div>
    <h4>Typography</h4>
    <p>A collection of font styles used across the design system.</p>
  </div>
  <Separator />
  <div>
    <h4>Spacing</h4>
    <p>Base-4 spacing scale from 4px to 96px.</p>
  </div>
</div>
```

### Vertical

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",alignItems:"center",height:"20px",gap:"16px",fontFamily:"Inter,sans-serif",fontSize:"13px",color:"#344054"}}>
    <span>Blog</span>

    <div style={{width:"1px",height:"100%",background:"#E5E7EB"}} />

    <span>Docs</span>

    <div style={{width:"1px",height:"100%",background:"#E5E7EB"}} />

    <span>Source</span>
  </div>
</div>

```tsx theme={null}
<div className="flex items-center gap-4 h-5">
  <span>Blog</span>
  <Separator orientation="vertical" />
  <span>Docs</span>
  <Separator orientation="vertical" />
  <span>Source</span>
</div>
```

### With Label ("OR" divider)

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb",fontFamily:"Inter,sans-serif"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"16px",maxWidth:"320px"}}>
    <button style={{padding:"9px 16px",borderRadius:"8px",border:"none",background:"#0479CE",color:"#fff",fontSize:"14px",fontWeight:500,cursor:"pointer"}}>Continue with Google</button>

    <div style={{display:"flex",alignItems:"center",gap:"12px"}}>
      <div style={{flex:1,height:"1px",background:"#E5E7EB"}} />

      <span style={{fontSize:"12px",color:"#9CA3AF",fontWeight:500}}>OR</span>

      <div style={{flex:1,height:"1px",background:"#E5E7EB"}} />
    </div>

    <button style={{padding:"9px 16px",borderRadius:"8px",border:"1px solid #D0D5DD",background:"#fff",color:"#344054",fontSize:"14px",fontWeight:500,cursor:"pointer"}}>Sign in with email</button>
  </div>
</div>

```tsx theme={null}
<div className="flex flex-col gap-4">
  <Button>Continue with Google</Button>
  <div className="flex items-center gap-3">
    <Separator className="flex-1" />
    <span className="text-xs text-muted-foreground font-medium">OR</span>
    <Separator className="flex-1" />
  </div>
  <Button variant="outline">Sign in with email</Button>
</div>
```

***

## API Reference

<ParamField path="orientation" type="string" default="horizontal">
  Direction of the line. Values: `horizontal` · `vertical`
</ParamField>

<ParamField path="decorative" type="boolean" default="true">
  When `true`, the separator is hidden from screen readers (`aria-hidden="true"`). Set to `false` when the separator has semantic meaning (e.g. separating distinct content sections).
</ParamField>

<ParamField path="className" type="string">
  Additional class names for custom color, thickness, or spacing.
</ParamField>

***

## Accessibility

* Decorative separators (`decorative={true}`) render with `aria-hidden="true"` — screen readers skip them
* Semantic separators (`decorative={false}`) render as `<hr role="separator">` — screen readers announce the division
* Vertical separators inside flex containers must have an explicit height set via `className` or `style`

***

## Do's & Don'ts

<CardGroup cols={2}>
  <Card title="Do" icon="check" iconType="solid" color="#16A34A">
    * Use `orientation="vertical"` inside `flex` rows (nav links, breadcrumbs, toolbars)
    * Use `decorative={false}` when separating distinct, non-obvious content sections
    * Combine with a label ("OR", "AND") for auth flows or filter sections
    * Use consistent spacing (`my-4` or `my-6`) above and below separators
  </Card>

  <Card title="Don't" icon="xmark" iconType="solid" color="#DC2626">
    * Don't overuse separators — too many creates visual noise
    * Don't use Separator as a border replacement for cards or panels
    * Don't forget to set height for vertical separators — they won't show without it
    * Don't use a `<hr>` directly — use this component to ensure correct ARIA attributes
  </Card>
</CardGroup>
