Divider | jaspr_daisyui_components
jaspr_daisyui_components
pub.dev ↗

Divider

Divider will be used to separate content vertically or horizontally.

Class name Type Description
divider Component A divider line between two elements
divider-neutral Color neutral color
divider-primary Color primary color
divider-secondary Color secondary color
divider-accent Color accent color
divider-success Color success color
divider-warning Color warning color
divider-info Color info color
divider-error Color error color
divider-vertical Direction Divide vertical elements (on top of each other)
divider-horizontal Direction Divide horizontal elements (next to each other)
divider-start Placement Pushes the divider text to the start
divider-end Placement Pushes the divider text to the end

Divider

content
OR
content
<div class="flex w-full flex-col">
  <div class="card bg-base-300 rounded-box grid h-20 place-items-center">content</div>
  <div class="divider">OR</div>
  <div class="card bg-base-300 rounded-box grid h-20 place-items-center">content</div>
</div>
div(
  [
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-20 place-items-center',
    ),
    Divider([Component.text('OR')]),
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-20 place-items-center',
    ),
  ],
  classes: 'flex w-full flex-col',
);

Divider horizontal

content
OR
content
<div class="flex w-full">
  <div class="card bg-base-300 rounded-box grid h-20 grow place-items-center">content</div>
  <div class="divider divider-horizontal">OR</div>
  <div class="card bg-base-300 rounded-box grid h-20 grow place-items-center">content</div>
</div>
div(
  [
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-20 grow place-items-center',
    ),
    Divider([Component.text('OR')], direction: DividerDirection.horizontal),
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-20 grow place-items-center',
    ),
  ],
  classes: 'flex w-full',
);

Divider with no text

content
content
<div class="flex w-full flex-col">
  <div class="card bg-base-300 rounded-box grid h-20 place-items-center">content</div>
  <div class="divider"></div>
  <div class="card bg-base-300 rounded-box grid h-20 place-items-center">content</div>
</div>
div(
  [
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-20 place-items-center',
    ),
    Divider(const []),
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-20 place-items-center',
    ),
  ],
  classes: 'flex w-full flex-col',
);

responsive (lg:divider-horizontal)

content
OR
content
<div class="flex w-full flex-col lg:flex-row">
  <div class="card bg-base-300 rounded-box grid h-32 grow place-items-center">content</div>
  <div class="divider lg:divider-horizontal">OR</div>
  <div class="card bg-base-300 rounded-box grid h-32 grow place-items-center">content</div>
</div>
div(
  [
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-32 grow place-items-center',
    ),
    Divider([Component.text('OR')], classes: 'lg:divider-horizontal'),
    Card(
      [Component.text('content')],
      classes: 'bg-base-300 rounded-box grid h-32 grow place-items-center',
    ),
  ],
  classes: 'flex w-full flex-col lg:flex-row',
);

Divider with colors

Default
Neutral
Primary
Secondary
Accent
Success
Warning
Info
Error
<div class="flex w-full flex-col">
  <div class="divider">Default</div>
  <div class="divider divider-neutral">Neutral</div>
  <div class="divider divider-primary">Primary</div>
  <div class="divider divider-secondary">Secondary</div>
  <div class="divider divider-accent">Accent</div>
  <div class="divider divider-success">Success</div>
  <div class="divider divider-warning">Warning</div>
  <div class="divider divider-info">Info</div>
  <div class="divider divider-error">Error</div>
</div>
div(
  [
    Divider([Component.text('Default')]),
    Divider([Component.text('Neutral')], color: DividerColor.neutral),
    Divider([Component.text('Primary')], color: DividerColor.primary),
    Divider([Component.text('Secondary')], color: DividerColor.secondary),
    Divider([Component.text('Accent')], color: DividerColor.accent),
    Divider([Component.text('Success')], color: DividerColor.success),
    Divider([Component.text('Warning')], color: DividerColor.warning),
    Divider([Component.text('Info')], color: DividerColor.info),
    Divider([Component.text('Error')], color: DividerColor.error),
  ],
  classes: 'flex w-full flex-col',
);

Divider in different positions

Start
Default
End
<div class="flex w-full flex-col">
  <div class="divider divider-start">Start</div>
  <div class="divider">Default</div>
  <div class="divider divider-end">End</div>
</div>
div(
  [
    Divider([Component.text('Start')], placement: DividerPlacement.start),
    Divider([Component.text('Default')]),
    Divider([Component.text('End')], placement: DividerPlacement.end),
  ],
  classes: 'flex w-full flex-col',
);

Divider in different positions (horizontal)

Start
Default
End
<div class="flex w-full">
  <div class="divider divider-horizontal divider-start">Start</div>
  <div class="divider divider-horizontal">Default</div>
  <div class="divider divider-horizontal divider-end">End</div>
</div>
div(
  [
    Divider(
      [Component.text('Start')],
      direction: DividerDirection.horizontal,
      placement: DividerPlacement.start,
    ),
    Divider([Component.text('Default')], direction: DividerDirection.horizontal),
    Divider(
      [Component.text('End')],
      direction: DividerDirection.horizontal,
      placement: DividerPlacement.end,
    ),
  ],
  classes: 'flex w-full',
);