# Divider

Source: https://ecosphere.dev/docs/layout/divider (Ecosphere 1.5). Install `vue-ecosphere` for Vue 3 or `react-ecosphere` for React 18.2+/19: same components, props, markup and stylesheet.

A hairline between two runs of content on one surface, optionally naming the run below it.

`import { EcoDivider } from "vue-ecosphere"`

## Rule

An hr in the border colour, a card gap above and below.

Vue (vue-ecosphere):

```vue
<p class="body-sm">Fees are billed per term.</p>
<EcoDivider />
<p class="body-sm">Late fees apply after the 10th.</p>
```

React (react-ecosphere):

```tsx
<p className="body-sm">Fees are billed per term.</p>
<EcoDivider />
<p className="body-sm">Late fees apply after the 10th.</p>
```

## Labelled

The label names the fields that follow, so the rule sits a section gap below what came before and a card gap above what it heads.

Vue (vue-ecosphere):

```vue
<EcoDivider label="Student" first />
<EcoFieldGrid first>
  <EcoTextField v-model="student" label="Name" />
  <EcoTextField v-model="grade" label="Grade" />
</EcoFieldGrid>
<EcoDivider label="Guardian details" />
<EcoFieldGrid first>
  <EcoTextField v-model="guardian" label="Name" />
  <EcoTextField v-model="phone" label="Phone" type="tel" />
</EcoFieldGrid>
```

React (react-ecosphere):

```tsx
<EcoDivider label="Student" first />
<EcoFieldGrid first>
  <EcoTextField value={student} onChange={setStudent} label="Name" />
  <EcoTextField value={grade} onChange={setGrade} label="Grade" />
</EcoFieldGrid>
<EcoDivider label="Guardian details" />
<EcoFieldGrid first>
  <EcoTextField value={guardian} onChange={setGuardian} label="Name" />
  <EcoTextField value={phone} onChange={setPhone} label="Phone" type="tel" />
</EcoFieldGrid>
```

## Centred

For a short word between two alternatives.

Vue (vue-ecosphere):

```vue
<EcoDivider label="Or" align="center" />
```

React (react-ecosphere):

```tsx
<EcoDivider label="Or" align="center" />
```

## EcoDivider

Vue (vue-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | — | Text on the rule (divider__t), in small caps; the default slot overrides it. Without either, a plain <hr>. |
| `align` | `"start" \| "center"` | "start" | Label at the start of the rule (section labels) or centred on it (an Or between two routes). |
| `first` | `boolean` | false | First thing in its container: drops the top margin (divider--first). |

React (react-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | — | Text on the rule (divider__t), in small caps; children override it. Without either, a plain <hr>. |
| `align` | `"start" \| "center"` | "start" | Label at the start of the rule (section labels) or centred on it (an Or between two routes). |
| `first` | `boolean` | false | First thing in its container: drops the top margin (divider--first). |
