Action chip
Action chip
Component demo
Interactive example
<ic-action-chiplabel="Summon a coffee"onClick={()=>console.log("Coffee summoned")}></ic-action-chip><ic-action-chiplabel="See more beans"href="#"target="_blank"></ic-action-chip>
Action chip details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The text rendered within the chip. |
|
|
If |
|
|
If |
|
|
The <form> element to associate the chip with. |
|
|
The URL that processes the information submitted by the chip. It overrides the action attribute of the chip's form owner. Does nothing if there is no form owner. |
|
|
The way the submitted form data is encoded. |
|
|
The HTTP method used to submit the form. |
|
|
If |
|
|
The place to display the response from submitting the form. It overrides the target attribute of the chip's form owner. |
|
|
The URL that the link points to. This will render the chip as an "a" tag. |
|
|
The human language of the linked URL. |
|
|
If |
|
|
How much of the referrer to send when following the link. |
|
|
The relationship of the linked URL as space-separated link types. |
|
|
The size of the chip. |
|
|
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
|
|
Sets the chip to the dark or light theme colors. "inherit" will set the color based on the system settings or ic-theme component. |
|
|
If |
|
|
The type of the chip. |
|
|
The emphasis of the chip. |
|
The text rendered within the chip. |
If |
If |
The <form> element to associate the chip with. |
The URL that processes the information submitted by the chip. It overrides the action attribute of the chip's form owner. Does nothing if there is no form owner. |
The way the submitted form data is encoded. |
The HTTP method used to submit the form. |
If |
The place to display the response from submitting the form. It overrides the target attribute of the chip's form owner. |
The URL that the link points to. This will render the chip as an "a" tag. |
The human language of the linked URL. |
If |
How much of the referrer to send when following the link. |
The relationship of the linked URL as space-separated link types. |
The size of the chip. |
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
Sets the chip to the dark or light theme colors. "inherit" will set the color based on the system settings or ic-theme component. |
If |
The type of the chip. |
The emphasis of the chip. |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
---|---|
|
|
|
|
|
|
Methods
|
|
|
---|---|---|
|
|
|
|
Variants
Sizes
Interactive example
<ic-action-chiplabel="Small"size="small"></ic-action-chip><ic-action-chiplabel="Medium"></ic-action-chip><ic-action-chiplabel="Large"size="large"></ic-action-chip>
Outlined
Interactive example
<ic-action-chiplabel="Outlined"variant="outlined"></ic-action-chip><ic-action-chiplabel="Non transparent"variant="outlined"transparentBackground="false"></ic-action-chip>
Disabled
Interactive example
<ic-action-chiplabel="Default"disabled="true"></ic-action-chip><ic-action-chiplabel="Outlined"disabled="true"variant="outlined"></ic-action-chip><ic-action-chip label="Non transparent" disabled variant="outlined" transparentBackground="false"}"></ic-action-chip>
Icon
Interactive example
<ic-action-chiplabel="With icon"><svgslot="icon"width="20"height="20"viewBox="0 0 20 20"fill="currentColor"xmlns="http://www.w3.org/2000/svg"aria-label="account"><pathd="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 3C11.66 3 13 4.34 13 6C13 7.66 11.66 9 10 9C8.34 9 7 7.66 7 6C7 4.34 8.34 3 10 3ZM10 17.2C7.5 17.2 5.29 15.92 4 13.98C4.03 11.99 8 10.9 10 10.9C11.99 10.9 15.97 11.99 16 13.98C14.71 15.92 12.5 17.2 10 17.2Z"/></svg></ic-action-chip>
Badge
Interactive example
<ic-action-chiplabel="With badge"variant="outlined"><ic-badgelabel="1"slot="badge"position="near"variant="success"></ic-badge></ic-action-chip>
Link
Interactive example
<ic-action-chiplabel="View More Coffees"href="#"target="_blank"/></ic-action-chip>
Themes
Interactive example
Light
Dark
<divstyle="display: flex;flex-direction: column"><divstyle="background-color:white;padding:8px"><ic-themetheme="light"><ic-typographyvariant="body"><p>Light</p></ic-typography><ic-action-chiplabel="Default"style="margin-right:8px"><svgslot="icon"width="20"height="20"viewBox="0 0 20 20"fill="currentColor"xmlns="http://www.w3.org/2000/svg"aria-label="account"><pathd="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 3C11.66 3 13 4.34 13 6C13 7.66 11.66 9 10 9C8.34 9 7 7.66 7 6C7 4.34 8.34 3 10 3ZM10 17.2C7.5 17.2 5.29 15.92 4 13.98C4.03 11.99 8 10.9 10 10.9C11.99 10.9 15.97 11.99 16 13.98C14.71 15.92 12.5 17.2 10 17.2Z"/></svg></ic-action-chip><ic-action-chiplabel="Outlined"variant="outlined"style="margin-right:8px"><svgslot="icon"width="20"height="20"viewBox="0 0 20 20"fill="currentColor"xmlns="http://www.w3.org/2000/svg"aria-label="account"><pathd="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 3C11.66 3 13 4.34 13 6C13 7.66 11.66 9 10 9C8.34 9 7 7.66 7 6C7 4.34 8.34 3 10 3ZM10 17.2C7.5 17.2 5.29 15.92 4 13.98C4.03 11.99 8 10.9 10 10.9C11.99 10.9 15.97 11.99 16 13.98C14.71 15.92 12.5 17.2 10 17.2Z"/></svg></ic-action-chip><ic-action-chiplabel="Monochrome"monochrome="true"style="margin-right:8px"><svgslot="icon"width="20"height="20"viewBox="0 0 20 20"fill="currentColor"xmlns="http://www.w3.org/2000/svg"aria-label="account"><pathd="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 3C11.66 3 13 4.34 13 6C13 7.66 11.66 9 10 9C8.34 9 7 7.66 7 6C7 4.34 8.34 3 10 3ZM10 17.2C7.5 17.2 5.29 15.92 4 13.98C4.03 11.99 8 10.9 10 10.9C11.99 10.9 15.97 11.99 16 13.98C14.71 15.92 12.5 17.2 10 17.2Z"/></svg></ic-action-chip></ic-theme></div><divstyle="background-color:black;padding:8px"><ic-themetheme="dark"><ic-typographyvariant="body"><p>Dark</p></ic-typography><ic-action-chiplabel="Default"style="margin-right:8px"><svgslot="icon"width="20"height="20"viewBox="0 0 20 20"fill="currentColor"xmlns="http://www.w3.org/2000/svg"aria-label="account"><pathd="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 3C11.66 3 13 4.34 13 6C13 7.66 11.66 9 10 9C8.34 9 7 7.66 7 6C7 4.34 8.34 3 10 3ZM10 17.2C7.5 17.2 5.29 15.92 4 13.98C4.03 11.99 8 10.9 10 10.9C11.99 10.9 15.97 11.99 16 13.98C14.71 15.92 12.5 17.2 10 17.2Z"/></svg></ic-action-chip><ic-action-chiplabel="Outlined"variant="outlined"style="margin-right:8px"><svgslot="icon"width="20"height="20"viewBox="0 0 20 20"fill="currentColor"xmlns="http://www.w3.org/2000/svg"aria-label="account"><pathd="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 3C11.66 3 13 4.34 13 6C13 7.66 11.66 9 10 9C8.34 9 7 7.66 7 6C7 4.34 8.34 3 10 3ZM10 17.2C7.5 17.2 5.29 15.92 4 13.98C4.03 11.99 8 10.9 10 10.9C11.99 10.9 15.97 11.99 16 13.98C14.71 15.92 12.5 17.2 10 17.2Z"/></svg></ic-action-chip><ic-action-chiplabel="Monochrome"monochrome="true"style="margin-right:8px"><svgslot="icon"width="20"height="20"viewBox="0 0 20 20"fill="currentColor"xmlns="http://www.w3.org/2000/svg"aria-label="account"><pathd="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 3C11.66 3 13 4.34 13 6C13 7.66 11.66 9 10 9C8.34 9 7 7.66 7 6C7 4.34 8.34 3 10 3ZM10 17.2C7.5 17.2 5.29 15.92 4 13.98C4.03 11.99 8 10.9 10 10.9C11.99 10.9 15.97 11.99 16 13.98C14.71 15.92 12.5 17.2 10 17.2Z"/></svg></ic-action-chip></ic-theme></div></div>