Popover

A dynamic and flexible popover component used for dropdowns, tooltips, and contextual menus.

Samples

Popover Samples

A flexible popover component for tooltips, dropdowns, and more.

1. Basic Popover

Standard popover that toggles on click.

0

<script>

1

  import { Popover } from 'fluid-ui-svelte/components';

2

  import { Text } from 'fluid-ui-svelte/base';

3

</script>

4

5

<Popover>

6

  {#snippet trigger()}

7

    <Text class="bg-primary-500 text-white p-2 rounded-md">Click Me</Text>

8

  {/snippet}

9

  {#snippet content()}

10

    <Text>This is a popover content!</Text>

11

  {/snippet}

12

</Popover>

2. Positions

Popovers can be positioned in four different directions.

0

<script>

1

  import { Popover } from 'fluid-ui-svelte/components';

2

  import { Text } from 'fluid-ui-svelte/base';

3

</script>

4

5

<Popover position="top">

6

  {#snippet trigger()}

7

    <Text class="border border-primary-500 text-primary-500 p-2 rounded-md">Top Popover</Text>

8

  {/snippet}

9

  {#snippet content()}

10

    <Text>Content on top</Text>

11

  {/snippet}

12

</Popover>

13

14

<Popover position="right">

15

  {#snippet trigger()}

16

    <Text class="border border-primary-500 text-primary-500 p-2 rounded-md">Right Popover</Text>

17

  {/snippet}

18

  {#snippet content()}

19

    <Text>Content on right</Text>

20

  {/snippet}

21

</Popover>