mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-21 04:39:19 +00:00
selectedItem and AutoComplete example available
This commit is contained in:
parent
0934a7d2c9
commit
ac97e7a966
24 changed files with 8267 additions and 653 deletions
|
@ -1,5 +1,21 @@
|
|||
<script>
|
||||
import { Button } from "carbon-components-svelte";
|
||||
import { AutoComplete } from "carbon-components-svelte";
|
||||
|
||||
let selectedId = 0;
|
||||
let selectedItem = undefined;
|
||||
</script>
|
||||
|
||||
<Button>Primary button</Button>
|
||||
<AutoComplete
|
||||
titleText="Contact"
|
||||
bind:selectedId
|
||||
bind:selectedItem
|
||||
placeholder="Placeholder"
|
||||
items="{[
|
||||
{ id: '0', text: 'Slack' },
|
||||
{ id: '11', text: 'Email1' },
|
||||
{ id: '12', text: 'Email2' },
|
||||
{ id: '2', text: 'Fax' },
|
||||
]}"
|
||||
/>
|
||||
|
||||
Selected: {selectedItem?.text} ({selectedId})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue