chip-component.mdx 1.3 KB

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