Interface IChip

All Superinterfaces:
IAnyGroup<IChip>, IChildrenOfInputgroup<IChip>, IComponent<IChip>, IDisable<IChip>, IHtmlBasedComponent<IChip>, ILabelElement<IChip>, ILabelImageElement<IChip>, IXulElement<IChip>

public interface IChip extends ILabelImageElement<IChip>, IAnyGroup<IChip>, IDisable<IChip>
Immutable Chip component.

A display-only chip used to show categories, statuses, or keywords, with an optional close button and a severity theme.

Support @Action

Name Action Type
onClose Denotes the user clicked the close button of a closable chip. It carries no action data; unlike Chip.onClose(), nothing is detached for you — render the tree again without this chip to make it disappear.
Since:
11.0.0
Author:
peaker
See Also:
  • Chip
  • Field Details

    • DEFAULT

      static final IChip DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Chip"

      Specified by:
      getWidgetClass in interface IComponent<IChip>
    • getSeverity

      @Nullable default String getSeverity()
      Returns the severity (color theme), or null when it was reset to the default.

      Default: "info".

    • withSeverity

      IChip withSeverity(@Nullable String severity)
      Returns a copy of this immutable component with the specified severity.

      Sets the severity (color theme).

      Parameters:
      severity - one of "info", "success", "warning", "error" or "neutral".

      Default: "info".

      Returns:
      A modified copy of the this object
    • getSize

      @Nullable default String getSize()
      Returns the size of this chip, or null when it was reset to the default.

      Default: "medium". Medium maps to the default 22px row, small reduces the row height for dense layouts.

    • withSize

      IChip withSize(@Nullable String size)
      Returns a copy of this immutable component with the specified size.

      Sets the chip size.

      Parameters:
      size - "small" or "medium".

      Default: "medium".

      Returns:
      A modified copy of the this object
    • isRounded

      default boolean isRounded()
      Returns whether this chip is rounded (pill-shaped).

      Default: false.

    • withRounded

      IChip withRounded(boolean rounded)
      Returns a copy of this immutable component with the specified rounded.

      Sets whether this chip is rounded (pill-shaped).

      Parameters:
      rounded - whether the chip is rounded.

      Default: false.

      Returns:
      A modified copy of the this object
    • isClosable

      default boolean isClosable()
      Returns whether this chip displays a close button.

      Default: false.

    • withClosable

      IChip withClosable(boolean closable)
      Returns a copy of this immutable component with the specified closable.

      Sets whether this chip displays a close button.

      Parameters:
      closable - whether the chip displays a close button.

      Default: false.

      Returns:
      A modified copy of the this object
    • of

      static IChip of(String label)
      Returns the instance with the given label.
      Parameters:
      label - The label of the chip
    • ofId

      static IChip ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component