chip-component.mdx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. title: "ChipComponent"
  3. generated: true
  4. ---
  5. <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
  6. ## ChipComponent
  7. <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/components/chip/chip.component.ts" sourceLine="16" packageName="@vendure/admin-ui" />
  8. A chip component for displaying a label with an optional action icon.
  9. *Example*
  10. ```html
  11. <vdr-chip [colorFrom]="item.value"
  12. icon="close"
  13. (iconClick)="clear(item)">
  14. {{ item.value }}</vdr-chip>
  15. ```
  16. ```ts title="Signature"
  17. class ChipComponent {
  18. @Input() icon: string;
  19. @Input() invert = false;
  20. @Input() colorFrom = '';
  21. @Input() colorType: 'error' | 'success' | 'warning';
  22. @Output() iconClick = new EventEmitter<MouseEvent>();
  23. }
  24. ```
  25. <div className="members-wrapper">
  26. ### icon
  27. <MemberInfo kind="property" type={`string`} />
  28. The icon should be the name of one of the available Clarity icons: https://clarity.design/foundation/icons/shapes/
  29. ### invert
  30. <MemberInfo kind="property" type={``} />
  31. ### colorFrom
  32. <MemberInfo kind="property" type={``} />
  33. If set, the chip will have an auto-generated background
  34. color based on the string value passed in.
  35. ### colorType
  36. <MemberInfo kind="property" type={`'error' | 'success' | 'warning'`} />
  37. The color of the chip can also be one of the standard status colors.
  38. ### iconClick
  39. <MemberInfo kind="property" type={``} />
  40. </div>