mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
docs(clickable-tile): improve docs
This commit is contained in:
parent
0e891c2d7e
commit
7c82cbe841
1 changed files with 9 additions and 1 deletions
|
@ -3,15 +3,19 @@
|
|||
import Preview from "../../components/Preview.svelte";
|
||||
</script>
|
||||
|
||||
Clickable tiles create interactive content areas that link to other pages or trigger actions. Use them to group related content and provide clear navigation targets.
|
||||
|
||||
## Default
|
||||
|
||||
Create a clickable tile with an `href` to link to another page.
|
||||
|
||||
<ClickableTile href="https://www.carbondesignsystem.com/">
|
||||
Carbon Design System
|
||||
</ClickableTile>
|
||||
|
||||
## Prevent default behavior
|
||||
|
||||
Use the forwarded `click` event and invoke `e.preventDefault()` to prevent the native link behavior.
|
||||
Handle the `click` event to override the default link behavior. Use `e.preventDefault()` to stop navigation.
|
||||
|
||||
<ClickableTile
|
||||
href="/"
|
||||
|
@ -25,12 +29,16 @@ Use the forwarded `click` event and invoke `e.preventDefault()` to prevent the n
|
|||
|
||||
## Light variant
|
||||
|
||||
Set `light` to `true` to use the light color scheme.
|
||||
|
||||
<ClickableTile light href="https://www.carbondesignsystem.com/">
|
||||
Carbon Design System
|
||||
</ClickableTile>
|
||||
|
||||
## Disabled state
|
||||
|
||||
Set `disabled` to `true` to prevent interaction.
|
||||
|
||||
<ClickableTile disabled href="https://www.carbondesignsystem.com/">
|
||||
Carbon Design System
|
||||
</ClickableTile>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue