Info
import "@taprootio/espalier/info";
<esp-info>
Used to show an informational message.
Slots
<esp-info> has the following slots:
Default
The default slot is for the text to display.
icon-slot
Optional custom SVG icon. Slotted icons override the generated SVG from the icon attribute.
Attributes
<esp-info> has the following attributes:
icon
icon has a default value of "".
Optional icon name from the configured Espalier SVG sprite.
Slotted icon-slot content remains supported and overrides
this generated icon.
destroyable
destroyable has a default value of false.
If an info box is destroyable, it has a button that will fire the
esp-info-destroy event when clicked.
intent
intent has a default value of undefined.
The element's intent — its meaning: neutral
(no pin), or success, warning, danger, info — each pinned
to its fixed status family (blue for info), retunable per theme
via intents. On token-emitting controls a non-neutral intent pins the
filled-action pair to that family, derived over the governing
zone's theme; class-styled chrome (badges, callouts, status pills)
opts out of inline emission and renders its treatment from CSS
classes instead. An intent never repaints the surrounding zone,
which is what contexts are for. Removing the attribute restores
the element's own default intent.
context
context has a default value of undefined.
A theme-defined color zone. The selected context rebinds designer-facing roles and emits a complete, contrast-enforced semantic token table on this host for descendants to inherit.
Methods
<esp-info> has the following methods:
traverseToClosest
Traverse up the DOM tree to find the closest element that matches the selector. This method is aware of shadow DOM boundaries and will traverse through them to find the element.
Events
<esp-info> emits the following events:
esp-info-destroy
esp-info-destroy is of type CustomEvent<DestroyEspalierInfo>.
Fired when the user clicks the destroy button.
CSS Properties
<esp-info> has the following CSS properties:
--esp-info-color-border
The border color of the info box.
--esp-info-color-background
The background color of the info box.
--esp-info-color-text
The text color of the info box
--esp-field-background
Background color of the shared field shell. Defaults to var(--esp-color-layer-2).
--esp-field-border-color
Border color of the shared field shell. Defaults to var(--esp-color-border).
--esp-field-border-width
Border width of the shared field shell. Defaults to 1px.
--esp-field-text-color
Text color used inside the shared field shell. Defaults to var(--esp-color-text).
--esp-field-hover-bg
Hover background color of the shared field shell. Derived from --esp-field-background.
--esp-field-focus-bg
Focus background color of the shared field shell. Derived from --esp-field-background.
--esp-field-focus-shadow
Shadow color used for shared field focus treatment. Defaults to var(--esp-color-shadow).