mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
parent
dbbf8ed3c6
commit
4e29ca8b7c
1 changed files with 22 additions and 2 deletions
|
@ -3,7 +3,7 @@ source: Tile/ExpandableTile.svelte
|
|||
---
|
||||
|
||||
<script>
|
||||
import { ExpandableTile } from "carbon-components-svelte";
|
||||
import { ExpandableTile, Button } from "carbon-components-svelte";
|
||||
import Preview from "../../components/Preview.svelte";
|
||||
</script>
|
||||
|
||||
|
@ -34,3 +34,23 @@ source: Tile/ExpandableTile.svelte
|
|||
<div slot="above" style="height: 10rem">Above the fold content here</div>
|
||||
<div slot="below" style="height: 10rem">Below the fold content here</div>
|
||||
</ExpandableTile>
|
||||
|
||||
## With interactive content
|
||||
|
||||
For tiles containing interactive content, use `stopPropagation` to prevent the tile from toggling.
|
||||
|
||||
<ExpandableTile tileExpandedLabel="View less" tileCollapsedLabel="View more">
|
||||
<div slot="above" style="height: 10rem">
|
||||
<a href="/" on:click|preventDefault|stopPropagation={() => console.log("Hello world")}>
|
||||
Native element
|
||||
</a>
|
||||
<br /><br />
|
||||
<Button on:click={e => {
|
||||
e.stopPropagation();
|
||||
console.log("Hello world");
|
||||
}}>
|
||||
Svelte component
|
||||
</Button>
|
||||
</div>
|
||||
<div slot="below" style="height: 10rem">Below the fold content here</div>
|
||||
</ExpandableTile>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue