Skip to content

Commit

Permalink
add basic elements
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Aug 20, 2024
1 parent 781a78b commit b89a227
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions src/lib/components/AbstractDropdown.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<script>
import { Button, Dropdown, DropdownDivider, DropdownItem } from 'flowbite-svelte';
import { ChevronDownOutline } from 'flowbite-svelte-icons';
export class DropdownData {
constructor(items, name) {
this.items = items;
Expand All @@ -7,13 +10,37 @@
}
}
export let header = 'dummy dropdown data';
export const defaultOptions = ['gar nicht', 'ansatzweise', 'weitgehend', 'zuverlässig'];
export let dropdownData = [
new DropdownData([1, 2, 3], 'numbers'),
new DropdownData(['a', 'b', 'c'], 'letters'),
new DropdownData(['lamb', 'fox', 'lion'], 'animals')
new DropdownData(defaultOptions, 'standing up'),
new DropdownData(defaultOptions, 'making a mess'),
new DropdownData(defaultOptions, 'gripping a pen the right way')
];
const style = {
basic: {},
buttonstyle: {
button: ,
icon: ''
},
dropdownstyle: {
item: '',
dropdown: ''
}
};
</script>

<div>
{#each dropdownData as dropdown}{/each}
<h1>{header}</h1>
{#each dropdownData as dropdown}
<Button class={style.buttonstyle.button}>{dropdown.name} <ChevronDownOutline /></Button>
<Dropdown>
{#each dropdown.items as item}
<DropdownItem>{item}</DropdownItem>
<DropdownDivider />
{/each}
</Dropdown>
{/each}
</div>

0 comments on commit b89a227

Please sign in to comment.