flowbite-svelte icon indicating copy to clipboard operation
flowbite-svelte copied to clipboard

Button alignment in Modals - how can I override footer item alignment?

Open v79 opened this issue 2 years ago • 1 comments

Summary

In Modal dialogues, the footer can contain buttons. But unlike most systems, Flowbite-svelte left-aligns everything in the footer slot. How can I pull this to the right, where most other UI frameworks put them?

Basic example

Current: Screenshot 2023-08-19 155435 Desired: Screenshot 2023-08-19 155435 desired

Motivation

Most UI frameworks align modal dialog buttons to the right hand side. It's very jarring for flowbite to do it differently.

v79 avatar Aug 19 '23 14:08 v79

you can just wrap your buttons in a element and align them

<svelte:fragment slot="footer">
    <div class="flex justify-end w-full gap-x-4">
      <Button on:click={() => alert('Handle "success"')}>I accept</Button>
      <Button color="alternative">Decline</Button>
    </div>
  </svelte:fragment>

gi4no avatar Sep 14 '23 23:09 gi4no