Divider
orientation horizontal/vertical · align center/left
Separador de 1px na cor line, horizontal ou vertical, opcionalmente com rótulo central.
Linha sendo traçada
<.divider />
orientation × align
center
<div class="flex flex-wrap items-center gap-2.5"><div class="flex-1"><.divider>center</.divider></div><div class="flex-1"><.divider align="left">left</.divider></div><.divider orientation="vertical" class="h-10" /><span class="text-xs text-muted">vertical</span></div>
Uso
<.divider /> <.divider label="ou continue com" />
Regras
- Prefira espaço a divisor: use quando grupos vizinhos têm o mesmo peso visual.
- Em listas dentro de cards (planos, insights), o divisor é
border-topdo item, não um elemento.
Referência da API
Todos os function components, atributos, valores e slots que este componente cobre.
A 1px separator in the line colour, horizontal or vertical, with optional centred or
left-aligned text.
<.divider />
<.divider>ou continue com</.divider>
<.divider align="left">Entrega</.divider>
<div class="flex items-center gap-2.5"><span>Day</span><.divider orientation="vertical" /><span>Month</span></div>
A horizontal divider without text is an <hr> 1px high in the line colour. With text it is a
row of two lines around the text (align="center") or the text followed by one line
(align="left"), the text being a small uppercase label. A vertical divider is a 1px column,
18px high unless you pass style="height:40px" or an h-* class. Styled only with Tailwind
utilities.
<.divider>
| Attr | Type | Default | Values / notes |
|---|---|---|---|
orientation |
:string |
"horizontal" |
horizontal, vertical |
align |
:string |
"center" |
center, left - Where a horizontal divider's text sits. |
label |
:string |
nil |
The text, as an attribute instead of the inner block. |
class |
:any |
nil |
|
style |
:string |
nil |
Any other HTML/phx attribute goes to the root element.
Slots:
<:inner_block>