feat(button): infer hasIconOnly using $$slots API

- requires Svelte version >=3.25
This commit is contained in:
Eric Liu 2021-01-22 16:13:22 -08:00
commit 74d48e78cd
2 changed files with 2 additions and 5 deletions

View file

@ -1,7 +1,3 @@
---
description: High-level description
---
<script>
import { Button } from "carbon-components-svelte";
import Add16 from "carbon-icons-svelte/lib/Add16";
@ -48,7 +44,7 @@ Set `hasIconOnly` to `true` to use the icon-only button variant.
The tooltip position and alignment can be controlled by the `tooltipPosition`, `tooltipAlignment` props, respectively.
<Button hasIconOnly tooltipPosition="bottom" tooltipAlignment="center" iconDescription="Tooltip text" icon={Add16} />
<Button tooltipPosition="bottom" tooltipAlignment="center" iconDescription="Tooltip text" icon={Add16} />
### Link button