@@ -179,7 +179,7 @@ Secondary buttons can be styled with different themes for various contexts.
179
179
Success Loading
180
180
</Button>
181
181
</div>
182
-
182
+
183
183
<div className="flex gap-3">
184
184
<Button variant="secondary" theme="danger" disabled>
185
185
Danger Disabled
@@ -428,34 +428,38 @@ Transparent buttons have no background or border and don't accept theme props.
428
428
429
429
## Additional Features
430
430
431
+ When the ` iconOnly ` prop is used, you must also provide ` tooltipProps ` to display content in the tooltip.
432
+
433
+ If you need to skip showing the tooltip, you should set ` ignoreIconOnlyTooltip ` .
434
+
431
435
<DocsPage.ComponentExample
432
436
client :only
433
437
code = { ` <div className="flex flex-col items-start min-w-[600px] gap-8">
434
438
<h4>Icon Only Buttons</h4>
435
439
436
440
<div className="flex gap-3">
437
- <Button iconOnly>
441
+ <Button iconOnly tooltipProps={{ content: "Add" }} >
438
442
<IconV2 name="plus" skipSize />
439
443
</Button>
440
- <Button variant="secondary" size="sm" iconOnly>
444
+ <Button variant="secondary" size="sm" iconOnly ignoreIconOnlyTooltip >
441
445
<IconV2 name="git-branch" skipSize />
442
446
</Button>
443
- <Button variant="transparent" size="sm" iconOnly>
447
+ <Button variant="transparent" size="sm" iconOnly ignoreIconOnlyTooltip >
444
448
<IconV2 name="xmark" skipSize />
445
449
</Button>
446
- <Button variant="outline" size="xs" iconOnly>
450
+ <Button variant="outline" size="xs" iconOnly ignoreIconOnlyTooltip >
447
451
<IconV2 name="check" skipSize />
448
452
</Button>
449
- <Button variant="outline" size="2xs" iconOnly>
453
+ <Button variant="outline" size="2xs" iconOnly ignoreIconOnlyTooltip >
450
454
<IconV2 name="check" skipSize />
451
455
</Button>
452
- <Button variant="outline" size="3xs" iconOnly>
456
+ <Button variant="outline" size="3xs" iconOnly ignoreIconOnlyTooltip >
453
457
<IconV2 name="check" skipSize />
454
458
</Button>
455
- <Button variant="outline" size="2xs" iconOnly>
459
+ <Button variant="outline" size="2xs" iconOnly ignoreIconOnlyTooltip >
456
460
<IconV2 name="xmark" skipSize />
457
461
</Button>
458
- <Button variant="outline" size="3xs" iconOnly>
462
+ <Button variant="outline" size="3xs" iconOnly ignoreIconOnlyTooltip >
459
463
<IconV2 name="xmark" skipSize />
460
464
</Button>
461
465
</div>
@@ -515,7 +519,7 @@ import { Button } from '@harnessio/ui/components'
515
519
<Button rounded >Rounded Button</Button >
516
520
517
521
// Icon only button
518
- <Button iconOnly >
522
+ <Button iconOnly tooltipProps = { { content: ' Add ' } } >
519
523
<IconV2 name = " plus" />
520
524
</Button >
521
525
@@ -618,5 +622,21 @@ This ensures type safety and provides proper development-time feedback on invali
618
622
required: true ,
619
623
value: " ReactNode" ,
620
624
},
625
+ {
626
+ name: " tooltipProps" ,
627
+ description:
628
+ " If provided, wraps the Button in a tooltip with the specified properties." ,
629
+ required: false ,
630
+ defaultValue: " undefined" ,
631
+ value: " Pick<TooltipProps, 'title' | 'content' | 'side'>" ,
632
+ },
633
+ {
634
+ name: " ignoreIconOnlyTooltip" ,
635
+ description:
636
+ " Allows skipping the required tooltipProps when using iconOnly." ,
637
+ required: false ,
638
+ value: " boolean" ,
639
+ defaultValue: " undefined" ,
640
+ },
621
641
]}
622
642
/>
0 commit comments